Skip to content

Commit c96535f

Browse files
committed
Ensure open modals are interactable
1 parent 948a7be commit c96535f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

packages/compass-e2e-tests/helpers/commands/wait-for-open-modal.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,19 @@ export async function waitForOpenModal(
99
): Promise<void> {
1010
await browser.waitUntil(
1111
async () => {
12-
const open = await browser.isModalOpen(selector);
13-
return reverse ? !open : open;
12+
const modals = await browser.getOpenModals(selector);
13+
if (reverse) {
14+
return modals.length === 0;
15+
} else {
16+
for (const modal of modals) {
17+
// Ensure any modals are interactable if open
18+
await modal.waitForClickable({
19+
timeout: 500,
20+
timeoutMsg: 'Timeout waiting for open modal to become clickable',
21+
});
22+
}
23+
return modals.length > 0;
24+
}
1425
},
1526
{
1627
timeout: 2_000,

0 commit comments

Comments
 (0)