beforeEach(() => {
cy.visit('https://alura-fotos.herokuapp.com/#/home')
})
it('verifica mensagens validacao', () => {
cy.contains('a', 'Register now').click();
cy.contains('button', 'Register').click();
cy.contains('ap-vmessage', 'Email is required!').should('be.visible');
cy.contains('button', 'Register').click();
cy.contains('ap-vmessage', 'User name is required!').should('be.visible');
cy.contains('ap-vmessage', 'Password is required!').should('be.visible');
cy.contains('ap-vmessage', 'Full name is required').should('be.visible');
})
it('verifica mensagem de email invalido', () => {
cy.contains('a', 'Register now').click();
cy.get('input[formcontrolname="email"]').type('Matteo')
cy.contains('button', 'Register').click();
cy.contains('ap-vmessage', 'Invalid e-mail').should('be.visible');
})
it('verifica mensagem de senha com menos de 8 caracteres', () => {
cy.contains('a', 'Register now').click();
cy.get('input[formcontrolname="password"]').type('123')
cy.contains('button', 'Register').click();
cy.contains('ap-vmessage', 'Mininum length is 8').should('be.visible');
})
it('verifica mensagem de username com letras maiusculas', () => {
cy.contains('a', 'Register now').click();
cy.get('input[formcontrolname="userName"]').type('MATTEO')
cy.contains('button', 'Register').click();
cy.contains('ap-vmessage', 'Must be lower case').should('be.visible');
})