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

166
Views
Cypress removes user-agent header after every page changing

I am writing some tests for mobile and tablet devices. I should use user-agent header while writing this tests. When i adding user-agent to cy.visit path with this method it works fine;

cy.visit("/mypath", {
  headers: { "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",
  },
});

But after changing page with click or similar methods (Click methods requests another page), my user-agent have lost. I tried to add userAgent to cypress.json file but that is not working for my test pages. I can only used it on cy.visit method. How can i add this header to all my test suites pages ? Thanks for your helping.

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!