oncall-engine/grafana-plugin/e2e-tests/outgoingWebhooks/createSimpleWebhook.test.ts
Dominik Broj c2ffd28675
Snow outgoing webhooks tab (#3918)
# What this PR does
- implement visual part of ServiceNow Outgoing Tab
- reuse created components on outgoing webhooks page
- make yarn:lint:fix to remove unused imports
- fix live reload during development
- remove unused babel dependencies

## Which issue(s) this PR fixes
- https://github.com/grafana/oncall/issues/3408
- partially https://github.com/grafana/oncall-private/issues/2462

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2024-02-26 13:52:26 +00:00

24 lines
1.1 KiB
TypeScript

import { test } from '../fixtures';
import { clickButton, generateRandomValue } from '../utils/forms';
import { goToOnCallPage } from '../utils/navigation';
import { checkWebhookPresenceInTable } from '../utils/outgoingWebhooks';
test('create simple webhook and check it is displayed on the list correctly', async ({ adminRolePage: { page } }) => {
const WEBHOOK_NAME = generateRandomValue();
const WEBHOOK_URL = 'https://example.com';
await goToOnCallPage(page, 'outgoing_webhooks');
await clickButton({ page, buttonText: 'New Outgoing Webhook' });
await page.getByText('Simple').first().click();
await page.waitForTimeout(2000);
await page.keyboard.insertText(WEBHOOK_URL);
await page.locator('[name=name]').fill(WEBHOOK_NAME);
await page.getByLabel('New Outgoing Webhook').getByRole('img').nth(1).click(); // Open team dropdown
await page.getByLabel('Select options menu').getByText('No team').click();
await clickButton({ page, buttonText: 'Create' });
await checkWebhookPresenceInTable({ page, webhookName: WEBHOOK_NAME, expectedTriggerType: 'Escalation step' });
});