Skip to content

Commit a792811

Browse files
authored
chore(e2e): fix for rare e2e test flake (#6516)
fix for rare e2e test flake
1 parent 3d2441a commit a792811

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/compass-e2e-tests/helpers/commands/hide-visible-toasts.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export async function hideAllVisibleToasts(
3232
return;
3333
}
3434

35-
const toastTestId = await _toast.getAttribute('data-testid');
36-
const toastSelector = `[data-testid=${toastTestId}]`;
37-
3835
try {
36+
const toastTestId = await _toast.getAttribute('data-testid');
37+
const toastSelector = `[data-testid=${toastTestId}]`;
38+
3939
await browser.hover(Selectors.LGToastContainer);
4040
const isToastVisible = await browser.$(toastSelector).isDisplayed();
4141
if (!isToastVisible) {
@@ -50,10 +50,11 @@ export async function hideAllVisibleToasts(
5050
await browser
5151
.$(toastSelector)
5252
.waitForExist({ ...waitOptions, reverse: true });
53+
54+
debug('done closing', toastTestId);
5355
} catch (err) {
5456
// if the toast disappears by itself in the meantime, that's fine
5557
debug('ignoring', err);
5658
}
57-
debug('done closing', toastTestId);
5859
}
5960
}

0 commit comments

Comments
 (0)