Skip to content

Commit

Permalink
E2E test: minor flake fix (#5831)
Browse files Browse the repository at this point in the history
If trying to close all toasts, allow for case when toasts auto close
before you get to them

### QA Notes

Not doing a test run for just this
  • Loading branch information
testlabauto authored Dec 19, 2024
1 parent 2c2a8d0 commit 5d407ae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/automation/src/positron/positronPopups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ export class PositronPopups {
const count = await this.toastLocator.count();
this.code.logger.log(`Closing ${count} toasts`);
for (let i = 0; i < count; i++) {
await this.toastLocator.nth(i).hover();
await this.code.driver.page.locator(`${NOTIFICATION_TOAST} .codicon-notifications-clear`).nth(i).click();
try {
await this.toastLocator.nth(i).hover();
await this.code.driver.page.locator(`${NOTIFICATION_TOAST} .codicon-notifications-clear`).nth(i).click();
} catch (error) { // toasts can auto close before we get to them
this.code.logger.log(`Failed to close toast ${i}`);
}
}
}

Expand Down

0 comments on commit 5d407ae

Please sign in to comment.