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

331
Views
Wait for web page to adjust DOM when viewport is changed in cypress

I'm trying to change the viewport of my application multiple times using cypress.

cy.viewport(393, 851);
// do something
cy.viewport(1366, 768);
// do something

Once the view port changes, the dom will take some time to adjust itself.

How can I wait here for the dom to adjust itself and continue the execution?

I have tried to reload the app after changing the view port. But I don't recommend this solution as it consumes time and not all pages are reloadable.

cy.viewport(393, 851);
cy.reload();
// do something
cy.viewport(1366, 768);
cy.reload();
// do something
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

A different way of changing viewports is by setting them via test configuration.

describe(
  'page display on medium size screen',
  {
    viewportHeight: 1000,
    viewportWidth: 400,
  }

or

it(
  'page display on medium size screen',
  {
    viewportHeight: 1000,
    viewportWidth: 400,
  }, () => {
  // visit and take snapshot
})
about 4 years ago · Juan Pablo Isaza Report
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!