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.
This commit is contained in:
parent
b499dfcf93
commit
2a611e9704
1 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue