cy.clock() cy.visit('http://localhost:3333') cy.get('#search').type('Acme Company') cy.tick(1000) // more test code here // restore the clock cy.clock().then((clock) => { clock.restore() })
How to set timezone in Cypress while running test? I am in Vietnam, my time zone is GMT+7 While I run test, I want my test run in Timezone GMT+8.
To set a now timestamp you could use:
const now = new Date(Date.UTC(2021, 1, 26)).getTime(); cy.clock(now);
More info in the documentation: cy.clock() - Now
1.4m articles
1.4m replys
5 comments
57.0k users