Cypress.Commands.add('login', (nome, senha) => {
cy.get('[data-test="registerUserName"]').type('nome');
cy.get('[data-test="registerPassword"]').type('senha');
cy.contains('button', 'Register').click();
})
describe('Página de login', () => {
beforeEach(() => {
cy.visit ('http://localhost:4200/#/home')
})
it('Preencher os campos de login corretamente para realizar login', () => {
cy.login('catarinamm', 'catarina000')
})
})
Página de login
Preencher os campos de login corretamente para realizar login:
AssertionError: Timed out retrying after 4000ms: Expected to find element: `[data-test="registerUserName"]`, but never found it.
at Context.eval (webpack:///./cypress/support/commands.js:13:7)