Skip to content

Commit a6f8d79

Browse files
Fix test
1 parent 0d244ce commit a6f8d79

File tree

1 file changed

+3
-3
lines changed
  • dotcom-rendering/playwright/lib

1 file changed

+3
-3
lines changed

dotcom-rendering/playwright/lib/cmp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ const CMP_LAYER2_REJECT_ALL_BUTTON = 'button.sp_choice_type_REJECT_ALL';
1616
*/
1717
const cmpAcceptAll = async (page: Page, rootIframe?: string): Promise<void> => {
1818
const root = rootIframe ? page.frameLocator(rootIframe) : page;
19-
const acceptAllButton = root
20-
.frameLocator(CMP_LAYER1_IFRAME)
21-
.locator(CMP_LAYER1_ACCEPT_ALL_BUTTON);
19+
const acceptAllButton = root.locator(
20+
`${CMP_LAYER1_ACCEPT_ALL_BUTTON}:visible`,
21+
);
2222
await acceptAllButton.click();
2323
// wait for consent settings to apply
2424
await new Promise((r) => setTimeout(r, 2000));

0 commit comments

Comments
 (0)