From d0a70dfbbe2241e2d33a70271fdcfc8e386fedb1 Mon Sep 17 00:00:00 2001 From: Dominik Vagner Date: Mon, 26 May 2025 16:47:41 +0200 Subject: [PATCH] fix(test): add close pop-ups locator for intercom modal This locator should automatically close all "openscap faster trigger" pop-ups in playwright tests. --- playwright/helpers/helpers.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playwright/helpers/helpers.ts b/playwright/helpers/helpers.ts index 3cd26521..ce5cf047 100644 --- a/playwright/helpers/helpers.ts +++ b/playwright/helpers/helpers.ts @@ -25,6 +25,10 @@ export const closePopupsIfExist = async (page: Page) => { page.locator(`button[id^="pendo-close-guide-"]`), // This closes the pendo guide pop-up page.locator(`button[id="truste-consent-button"]`), // This closes the trusted consent pop-up page.getByLabel('close-notification'), // This closes a one off info notification (May be covered by the toast above, needs recheck.) + page + .locator('iframe[name="intercom-modal-frame"]') + .contentFrame() + .getByRole('button', { name: 'Close' }), ]; for (const locator of locatorsToCheck) {