Cypress - Test Organization and Patterns
You have this Page Object method:
But your test calls
login(username, password) {
cy.get('#user').type(username)
cy.get('#pass').type(password)
cy.get('button.login').click()
}But your test calls
cy.visit('/login') before login(), yet fails because the username input is not found. What is the likely problem?