I am running a bunch of tests in a fixture and from time to time and I am having the failure:
cy.click() failed because it requires a DOM element. It occured in this line: cy.get(Cypress.env('page.commandButton')).click();
Desired behavior:
I expect the fixture to always pass without having this flaky result
Cypress.Commands.add("logout", () => {
cy.get(Cypress.env('page.commandButton')).click();
cy.get(Cypress.env('page.signoutButton')).click();
})
//some tests exist here but regardless of what tests exist, the failure is happening always in the after each block. The failure is not happening in a specific test, it occurs in the after each for various tests. The code above will help reproducing the problem
})
Current behavior:
I am running a bunch of tests in a fixture and from time to time and I am having the failure: cy.click() failed because it requires a DOM element. It occured in this line: cy.get(Cypress.env('page.commandButton')).click();
Desired behavior:
I expect the fixture to always pass without having this flaky result
Test code to reproduce
context('SomeFixture', () => { before(() => { cy.visit('') })
Cypress.Commands.add("logout", () => { cy.get(Cypress.env('page.commandButton')).click(); cy.get(Cypress.env('page.signoutButton')).click();
}) //some tests exist here but regardless of what tests exist, the failure is happening always in the after each block. The failure is not happening in a specific test, it occurs in the after each for various tests. The code above will help reproducing the problem })
Versions