I am using github actions to run my test cases it is working fine for 2-3 months but now it is skipping test on github actions. Tried adding wait but still nothing change. Can anyone Guide?
I increase timeout but still skipping tests on github actions and giving this error
AssertionError: Timed out retrying after 10000ms: expected '/login' to match //dashboard$/
The first thing to note is that expected '/login' to match //dashboard$/
is a strong indication that the login failed.
This can mean
All these fit with the chronology you describe, the tests ran for 3 months and suddenly stop.
I suggest you add a simple login-only test in a new repo and check the results for the above problems.
The other thing to check is testIsolation
, see Test Isolation as a Best Practice. This has been recently introduced, and the effect is to block credentials from carrying over from one test to another.
There are two steps you can take:
const { defineConfig } = require('cypress')
module.exports = defineConfig({
e2e: {
testIsolation: false,
},
})
cy.session()
command around your login to make the login credentials persist across multiple test
Cypress.Commands.add('loginWithUI', (username, password) => {
cy.session(username, () => {
cy.visit('/login')
cy.get('#username-input').type(username)
cy.get('#password-input').type(password)
cy.get('#submit-button').click()
})
})