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

[Bug]: Date.now() returns float value when called from page Js after using clock.install() on page instance #31644

Closed
Lazar-Adrian opened this issue Jul 11, 2024 · 0 comments · Fixed by #31648
Assignees
Labels

Comments

@Lazar-Adrian
Copy link

Version

1.45.1

Steps to reproduce

  1. Clone https://github.com/Lazar-Adrian/FloatingDate
  2. npm install
  3. npx playwright test

Expected behavior

All tests should pass

Actual behavior

Some of the tests that use clock.install(), will fail because the return value of Date.now() is not an integer

Additional context

Having Date.now() return a float value will affect the test ecosystem if the Js from the AUT will try to use the return value of Date.now() as an integer.
Note that from my runs i have noticed that only the tests that use page.waitForTimeout() might cause the issue to appear.

Environment

System:
  OS: macOS Sonoma 14.5
  CPU: Apple M1 Pro
Binaries:
  Node: v20.9.0
  npm: 10.1.0
npmPackages:
  @playwright/test: 1.45.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants