Archi's Academy

BLACK FRIDAY

85% Discount for all November

clock-icon
00days
00hours
00minutes
00seconds
Get in touch

Manual testing

Let's try to stop the time! with a command in cypress. If we want to test a timer on our website, we can use this command and proceed.

How does it work?

Before using cy. clock our timer in the website has been running. But when we use it, the timer stops on 0. Fortunately, it is expected behavior in our test-case scenario. We've set and stopped the time. Now we can test the timer easily. cy. clock() command overrides native global functions related to time allowing them to be controlled synchronously via cy. tick() or the yielded clock object.

You can find more info about cy. clock in the URL:

https://docs.cypress.io/api/commands/clock.html#Syntaxtext

Surumi-skill-training

Surumi Riju

Wednesday, Jan 20, 2021