2
respostas

Não consigo escrever email em um teste

Meu código está dando erro dizendo que existe uma Unexpected token: ",". Código abaixo:

describe('aluralogin', () => {

beforeEach(() => {
    cy.visit('https://www.alura.com.br/');
})

 it('verifica mensagens validacao', () => {
     cy.contains('a','Entrar').click();
    cy.get('#login-email').type("emanuelyjochims31@gmail.com");
})

})

Estou tentando fazer meu login na alura e ele me apresenta este erro:

SyntaxError The following error originated from your application code, not from Cypress.

Unexpected token ','

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.

This behavior is configurable, and you can choose to turn this off by listening to the uncaught:exception event.Learn more View stack trace Print

2 respostas

Creio que o erro seja a falta de um ")" nesta linha aqui depos de "valicacao',":

it('verifica mensagens validacao', () => {

Oi mano, eu descobri que era um erro no site da alura mesmo. ai cliquei em learn more e descobri que podia ignorar o erro escrevendo assim: describe('aluralogin', () => {

beforeEach(() => {
    cy.visit('https://www.alura.com.br/');
})

 it('verifica mensagens validacao', () => {
     cy.contains('a','Entrar').click();
     Cypress.on('uncaught:exception', (err, runnable) => {
        return false
      });
    cy.get('#login-email').type("emanuelyjochims");
    cy.get('#password').type("*******");
    cy.get('.btn-login').click();
})

})

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software