Skip to content

Commit 2146e07

Browse files
authored
Merge pull request #9615 from asirvadAbrahamVarghese/enhance-expect-alerts-command
Switch cy.on to cy.once to unregister handler after scope
2 parents 3601e71 + 2ab3a17 commit 2146e07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cypress/support/assertions/expect_alerts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Cypress.Commands.add(
6464
'expect_browser_confirm_with_text',
6565
({ confirmTriggerFn, containsText, proceed = true }) => {
6666
let alertTriggered = false;
67-
cy.on('window:confirm', (actualText) => {
67+
cy.once('window:confirm', (actualText) => {
6868
alertTriggered = true;
6969
if (containsText) {
7070
expect(actualText.toLowerCase()).to.include(containsText.toLowerCase());

0 commit comments

Comments
 (0)