I am using Cypress version 10.9.0
for e2e
testing. Of course, there are more step defs but it stops at the first then
step as it can be seen from the SS image.
When('I enter an invalid username on the login page', () => {
cy.get('#username').type('portal').invoke('removeAttr', 'value').click({ force: true }, { timeout: 30000 })
cy.get('#password').type('SwY66bc3VZLUFR9')
cy.get('[type="submit"]').click()
})
Then('an error message is displayed with the text Invalid username/password', () => {
cy.get(".invalid.text-left").should('contain.text', 'Invalid username/password')
})
Cypress GUI error
DOM element