cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.06k stars 3.19k forks source link

Double reload when you run the test #30191

Open WarnnerSinotti opened 2 months ago

WarnnerSinotti commented 2 months ago

Current behavior

When you init the test, cypress reload twice.

My test contem: Describe, beforeEach, it

Cypress

Desired behavior

No response

Test code to reproduce

import dateToday from '../../../../utils/dateToday';
import dados from 'cypress/utils/dados';
import dadosFake from 'cypress/utils/dadosFake';

const email: string = 'emailsecret' + Cypress.env('DOMAIN_EMAIL');

describe('Teste de documentos', () => {
    beforeEach(() => {
        cy.apiUploadDocumentoE2E(email).then(
            (response: any) => {
                expect(response.status).to.equal(200);
            }
        );

        cy.login(email, Cypress.env('LEXIO_E2E_PASSWORD'));
    });

    it('LE-85A Visualizando e editando documento', () => {
        cy.allure().severity('normal');

        cy.revisaoDocumento(documentName);

    });
});

Cypress Version

v13.14.2

Node version

V20.9.0

Operating System

windows 11

Debug Logs

No response

Other

No response

jennifer-shehane commented 2 months ago

@WarnnerSinotti Are you setting a baseUrl? https://docs.cypress.io/guides/references/best-practices#Setting-a-Global-baseUrl

WarnnerSinotti commented 2 months ago

Nop, i set my enviroment in cypress.env.json and a i have one command the name "Login". This login contain, cy.visit(Cypress.env('BASE_URL')

all my test need to use this command

Ram2103 commented 1 week ago

I am facing the same issue in v13.5.0