2023-11-17 11:07:12 +01:00
|
|
|
import { test } from '../fixtures';
|
2023-11-10 11:54:22 -05:00
|
|
|
import { generateRandomValue } from '../utils/forms';
|
2023-11-17 11:07:12 +01:00
|
|
|
import { createIntegration, searchIntegrationAndAssertItsPresence } from '../utils/integrations';
|
2024-08-16 18:43:52 +02:00
|
|
|
import { goToOnCallPage } from '../utils/navigation';
|
2023-11-10 11:54:22 -05:00
|
|
|
|
2023-12-05 13:43:48 +01:00
|
|
|
test('Integrations table shows data in Monitoring Systems and Direct Paging tabs', async ({
|
|
|
|
|
adminRolePage: { page },
|
|
|
|
|
}) => {
|
2024-08-16 18:43:52 +02:00
|
|
|
test.slow();
|
2023-11-10 11:54:22 -05:00
|
|
|
const ID = generateRandomValue();
|
|
|
|
|
const WEBHOOK_INTEGRATION_NAME = `Webhook-${ID}`;
|
|
|
|
|
const ALERTMANAGER_INTEGRATION_NAME = `Alertmanager-${ID}`;
|
2023-11-17 11:07:12 +01:00
|
|
|
const DIRECT_PAGING_INTEGRATION_NAME = `Direct paging integration name`;
|
2023-11-10 11:54:22 -05:00
|
|
|
|
2023-11-17 11:07:12 +01:00
|
|
|
// Create 2 integrations that are not Direct Paging
|
2023-11-10 11:54:22 -05:00
|
|
|
await createIntegration({ page, integrationSearchText: 'Webhook', integrationName: WEBHOOK_INTEGRATION_NAME });
|
2023-11-17 11:07:12 +01:00
|
|
|
await page.waitForTimeout(1000);
|
2024-08-16 18:43:52 +02:00
|
|
|
await goToOnCallPage(page, 'integrations');
|
2023-11-10 11:54:22 -05:00
|
|
|
await createIntegration({
|
|
|
|
|
page,
|
|
|
|
|
integrationSearchText: 'Alertmanager',
|
|
|
|
|
integrationName: ALERTMANAGER_INTEGRATION_NAME,
|
|
|
|
|
});
|
2023-11-17 11:07:12 +01:00
|
|
|
await page.waitForTimeout(1000);
|
2024-08-16 18:43:52 +02:00
|
|
|
await goToOnCallPage(page, 'integrations');
|
2023-11-10 11:54:22 -05:00
|
|
|
|
|
|
|
|
// Create 1 Direct Paging integration if it doesn't exist
|
2024-08-28 16:43:52 +02:00
|
|
|
await page.getByText('Manual Direct Paging').click();
|
2023-11-17 11:07:12 +01:00
|
|
|
const integrationsTable = page.getByTestId('integrations-table');
|
|
|
|
|
await page.waitForTimeout(2000);
|
|
|
|
|
const isDirectPagingAlreadyCreated = (await integrationsTable.getByText('Direct paging').count()) >= 1;
|
2023-11-10 11:54:22 -05:00
|
|
|
if (!isDirectPagingAlreadyCreated) {
|
|
|
|
|
await createIntegration({
|
|
|
|
|
page,
|
|
|
|
|
integrationSearchText: 'Direct paging',
|
|
|
|
|
integrationName: DIRECT_PAGING_INTEGRATION_NAME,
|
|
|
|
|
});
|
2023-11-17 11:07:12 +01:00
|
|
|
await page.waitForTimeout(1000);
|
2023-11-10 11:54:22 -05:00
|
|
|
}
|
2024-08-16 18:43:52 +02:00
|
|
|
await goToOnCallPage(page, 'integrations');
|
2023-11-10 11:54:22 -05:00
|
|
|
|
2023-12-05 13:43:48 +01:00
|
|
|
// By default Monitoring Systems tab is opened and newly created integrations are visible except Direct Paging one
|
2023-12-15 09:58:25 +01:00
|
|
|
await searchIntegrationAndAssertItsPresence({ page, integrationName: WEBHOOK_INTEGRATION_NAME });
|
2023-11-17 11:07:12 +01:00
|
|
|
await searchIntegrationAndAssertItsPresence({
|
|
|
|
|
page,
|
|
|
|
|
integrationName: ALERTMANAGER_INTEGRATION_NAME,
|
|
|
|
|
});
|
|
|
|
|
await searchIntegrationAndAssertItsPresence({
|
|
|
|
|
page,
|
|
|
|
|
integrationName: DIRECT_PAGING_INTEGRATION_NAME,
|
|
|
|
|
visibleExpected: false,
|
|
|
|
|
});
|
2023-11-10 11:54:22 -05:00
|
|
|
|
|
|
|
|
// Then after switching to Direct Paging tab only Direct Paging integration is visible
|
2024-08-28 16:43:52 +02:00
|
|
|
await page.getByText('Manual Direct Paging').click();
|
2023-11-17 11:07:12 +01:00
|
|
|
await searchIntegrationAndAssertItsPresence({
|
|
|
|
|
page,
|
|
|
|
|
integrationName: WEBHOOK_INTEGRATION_NAME,
|
|
|
|
|
visibleExpected: false,
|
|
|
|
|
});
|
|
|
|
|
await searchIntegrationAndAssertItsPresence({
|
|
|
|
|
page,
|
|
|
|
|
integrationName: ALERTMANAGER_INTEGRATION_NAME,
|
|
|
|
|
visibleExpected: false,
|
|
|
|
|
});
|
|
|
|
|
await searchIntegrationAndAssertItsPresence({
|
|
|
|
|
page,
|
|
|
|
|
integrationName: 'Direct paging',
|
|
|
|
|
});
|
2023-11-10 11:54:22 -05:00
|
|
|
});
|