Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress: Fix cy.clock not freezing time #4060

Merged
merged 1 commit into from
Aug 13, 2019
Merged

Conversation

gabrieldutra
Copy link
Member

What type of PR is this? (check all applicable)

  • Other

Description

With this I noticed that time wasn't being frozen after using cy.clock (it was set, but some second differences were happening). In order to properly set that it must come before cy.visit, but this was causing page loading issues. Solved those by using cy.clock(timestamp, ['Date']) so the Date element is affected and other Timer functions are not.

Note: Could remove all workarounds after that 🙂

Related Tickets & Documents

--

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

--

@gabrieldutra gabrieldutra requested a review from ranbena August 11, 2019 16:08
@gabrieldutra gabrieldutra self-assigned this Aug 11, 2019
Copy link
Contributor

@ranbena ranbena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

How come there's no need for workaround? I thought it was a render/display issue.

@gabrieldutra
Copy link
Member Author

How come there's no need for workaround? I thought it was a render/display issue.

I initially thought that as well, I was surprised that Cypress pointed me to remove the workarounds. My guess is that cy.clock was affecting other internal functions (such as Timeout ones).

@gabrieldutra gabrieldutra merged commit 4698408 into master Aug 13, 2019
@gabrieldutra gabrieldutra deleted the cypress-fix-date-tests branch August 13, 2019 10:09
harveyrendell pushed a commit to pushpay/redash that referenced this pull request Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants