Reputation: 1
In the test ,I have to change a comment and save In the edit history I can see who changed what and the time when it is changed. I want to verify the time it was changed.
Two things to verify
Your help is appreciated
Upvotes: 0
Views: 461
Reputation: 31904
There is the cy.clock() command,
Essentially, cy.clock()
freezes the time in the app so you don't get any variation due to fast/slow processing.
Adapted from the example in the docs:
const now = new Date(2021, 3, 14) // month is 0-indexed
cy.clock(now) // use a specific date for testing purposes
// change the comment
cy.get('#comment').should('have.value', '04/14/2021')
Upvotes: 1