Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

117
Vistas
Why cypress back to login page after the third IT?

I've been looking and doing research but the results are the same. Why does the it only run 2 times not to finish. When running the 3rd task cypress direct again to the login page.

describe("Overview Page", () => {
  before("Behaviour to overview page", () => {
    cy.SignIn();
    cy.preverseAllCookiesOnce();
  });

  it("Overview Page Check (Sidebar and Header)", () => {
    cy.intercept({
      method: "GET",
      url: "https://api.mapbox.com/**",
    }).as("dataMapbox");

    cy.intercept({
      method: "GET",
      url: "https://api.com/v2/**",
    }).as("data");

    cy.contains("Science Park").click();
    cy.wait("@dataMapbox", { timeout: 90000 })
      .its("response.statusCode")
      .should("equal", 200);

    cy.wait("@data", { timeout: 90000 })
      .its("response.statusCode")
      .should("equal", 200);
    // sidebar
    cy.get(".toc > .attached").as("sidebar");
    cy.get("@sidebar").should("be.visible");
    // page loaded
    cy.wait(15000);
    cy.get(".twelve > .header").should("have.text", "Overview");
  });

  it("Button Current and Dissmiss", () => {
    // current and dismiss
    cy.get(
      ':nth-child(1) > .top > [style="display: flex; align-items: center; flex-grow: 1; justify-content: flex-end;"] > .ui > .active'
    ).click();
   
  });

  it("Mapbox Button Check", () => {
    cy.get(
      ':nth-child(2) > .top > [style="display: flex; align-items: center; flex-grow: 1; justify-content: flex-end;"] > .ui > .active'
    ).click();
    for (let n = 0; n < 5; n++) {
      cy.get('[data-tooltip="Map rotate 45 degree anticlockwise."]').click();
    }

    for (let n = 0; n < 5; n++) {
      cy.get('[data-tooltip="Map rotate 45 degree clockwise."]').click();
    }
   
  });
});

The command.js

Cypress.Commands.add("preverseAllCookiesOnce", () => {
  cy.getCookies().then((cookies) => {
    const namesOfCookies = cookies.map((c) => c.name);
    Cypress.Cookies.preserveOnce(...namesOfCookies);
  });
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Just found it out. This is the correct structure.

describe("Overview Page", () => {
  before("Behaviour to overview page", () => {
    cy.SignIn();
  });
  beforeEach("keep using the session", function () {
    cy.preverseAllCookiesOnce();
  });
})
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda