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

195
Vistas
cy.visit() must be called with a url or an options object containing a url as its 1st argumentLearn more

enter image description hereI have a problem as below. I need to test login functionality, but facing with this problem. I looked for some solutions here in Stackoverflow as well but did not help any of them. please look at it and kindly share your thoughts. Thank you!

describe("LoginFunctionality", function () {
  beforeEach(() => {
    cy.restoreLocalStorage();

    Cypress.Cookies.defaults({
      preserve: /[\s\S]*/,
    });
  });

  afterEach(() => {
    cy.saveLocalStorage();
  });

  let href;

  let LOCAL_STORAGE_MEMORY = {};

  Cypress.Commands.add("saveLocalStorage", () => {
    Object.keys(localStorage).forEach((key) => {
      LOCAL_STORAGE_MEMORY[key] = localStorage[key];
    });
  });

  Cypress.Commands.add("restoreLocalStorage", () => {
    Object.keys(LOCAL_STORAGE_MEMORY).forEach((key) => {
      localStorage.setItem(key, LOCAL_STORAGE_MEMORY[key]);
    });
  });

  Cypress.Commands.add("visitMultipleURL", (url) => {
    cy.window().then((win) => {
      return win.open(url, "_self");
    });
  });

  it.only("LoginFunctionality", function () {
    cy.visit("xxx");
    cy.get(".chakra-stack > .css-1n94901").click();

    cy.contains("Login with aaaa").click();

    cy.url().then((url) => {
      href = url;

      cy.log("href ", href);
    });
  });

  it.only("Verification of login", function () {
    cy.visit(href);

    cy.url().should("include", "bbbb"); //assertion of that we are in this url
  });
about 4 years ago · Juan Pablo Isaza
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