From 2a611e97043e7482e1a464afd7659410bbd8706e Mon Sep 17 00:00:00 2001 From: Tom Koscielniak Date: Thu, 19 Jun 2025 11:51:43 +0200 Subject: [PATCH] playwright: Add handler for new intercom notifications Adds handler for the new intercom popup notifications that trigger OpenScap window. Also adds noWaitAfter for the click action to fix flakiness. --- playwright/helpers/helpers.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/playwright/helpers/helpers.ts b/playwright/helpers/helpers.ts index 2e966b2b..69e105c7 100644 --- a/playwright/helpers/helpers.ts +++ b/playwright/helpers/helpers.ts @@ -28,12 +28,17 @@ export const closePopupsIfExist = async (page: Page) => { page .locator('iframe[name="intercom-modal-frame"]') .contentFrame() - .getByRole('button', { name: 'Close' }), + .getByRole('button', { name: 'Close' }), // This closes the intercom pop-up + page + .locator('iframe[name="intercom-notifications-frame"]') + .contentFrame() + .getByRole('button', { name: 'Profile image for Rob Rob' }) + .last(), // This closes the intercom pop-up notification at the bottom of the screen, the last notification is displayed first if stacked (different from the modal popup handled above) ]; for (const locator of locatorsToCheck) { await page.addLocatorHandler(locator, async () => { - await locator.first().click(); // There can be multiple toast pop-ups + await locator.first().click({ timeout: 10_000, noWaitAfter: true }); // There can be multiple toast pop-ups }); } };