[Synthetics] E2e test update test logic to remove flakiness !! (#209554)

## Summary

 E2e test update test logic to remove flakiness !!
This commit is contained in:
Shahzad 2025-02-05 11:22:12 +01:00 committed by GitHub
parent dd21a92ab9
commit 0f5a523deb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { journey, step, before, after } from '@elastic/synthetics';
import { journey, step, before, after, expect } from '@elastic/synthetics';
import { syntheticsAppPageProvider } from '../../page_objects/synthetics_app';
import { SyntheticsServices } from '../services/synthetics_services';
@ -51,10 +51,15 @@ journey(`CustomStatusAlert`, async ({ page, params }) => {
await page.getByTestId('createNewStatusRule').click();
await page.getByTestId('ruleNameInput').fill('Synthetics status rule');
let requestMade = false;
page.on('request', (request) => {
if (request.url().includes('api/alerting/rule') && request.method() === 'POST') {
requestMade = true;
}
});
await page.getByTestId('saveRuleButton').click();
await page.getByTestId('confirmModalConfirmButton').click();
await page.waitForSelector(`text='Created rule "Synthetics status rule"'`);
expect(requestMade).toBe(true);
});
step('verify rule creation', async () => {