Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

194
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda