Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!