Utilizing the new Clock API allows to manipulate and control time within tests to verify time-related behavior. This API covers many common scenarios, including:
testing with predefined time;
keeping consistent time and timers;
monitoring inactivity;
ticking through time manually.
// Initialize clock and let the page load naturally.
await page.clock.install({ time: new Date('2024-02-02T08:00:00') });
await page.goto('http://localhost:3333');
// Pretend that the user closed the laptop lid and opened it again at 10am,
// Pause the time once reached that point.
await page.clock.pauseAt(new Date('2024-02-02T10:00:00'));
// Assert the page state.
await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:00:00 AM');
// Close the laptop lid again and open it at 10:30am.
await page.clock.fastForward('30:00');
await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:30:00 AM');
New CLI option --fail-on-flaky-tests that sets exit code to 1 upon any flaky tests. Note that by default, the test runner exits with code 0 when all failed tests recovered upon a retry. With this option, the test run will fail in such case.
New enviroment variable PLAYWRIGHT_FORCE_TTY controls whether built-in list, line and dot reporters assume a live terminal. For example, this could be useful to disable tty behavior when your CI environment does not handle ANSI control sequences well. Alternatively, you can enable tty behavior even when to live terminal is present, if you plan to post-process the output and handle control sequences.
# Avoid TTY features that output ANSI control sequences
PLAYWRIGHT_FORCE_TTY=0 npx playwright test
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the npm group with 5 updates in the /playwright directory:
1.42.1
1.45.0
8.57.0
9.6.0
16.6.2
17.9.0
6.1.1
6.4.0
16.14.18
16.14.20
Updates
@playwright/test
from 1.42.1 to 1.45.0Release notes
Sourced from
@playwright/test
's releases.... (truncated)
Commits
4f3f6ee
cherry-pick(#31421): docs: release notes for 1.45d557b7b
cherry-pick(#31420): docs(java): correctly parse time (#31422)1368bca
cherry-pick(#31419): docs: deprecatehandle
option inexposeBinding
6c3fc49
cherry-pick(#31404): feat(chromium): roll to r11244ae151f
cherry-pick(#31340): docs: add guide for print dialogsa11585f
cherry-pick(#31331): docs(test-parameterize): improve forEach exampleafcf8d2
cherry-pick(#31350): docs: fix typo in 1.45 release notes599d074
cherry-pick(#31356): fix(clock): throw for invalid date2451791
cherry-pick(#31357): fix(clock): under reused context56ca1e1
cherry-pick(#31369): docs: use long for time in milliseconds (#31371)Updates
eslint
from 8.57.0 to 9.6.0Release notes
Sourced from eslint's releases.
... (truncated)
Changelog
Sourced from eslint's changelog.
... (truncated)
Commits
473d1bb
9.6.0f435566
Build: changelog update for 9.6.0b15ee30
chore: upgrade@eslint/js
@9
.6.0 (#18632)d655503
chore: package.json update for@eslint/js
release1613e2e
fix: Allow escaping characters in config patterns on Windows (#18628)13dbecd
docs: Limit search to just docs (#18627)7c78ad9
refactor: Use language.visitorKeys and check for non-JS SourceCode (#18625)e2b16e2
feat: Implement feature flags (#18516)69ff64e
refactor: Return value of applyInlineConfig() (#18623)375227f
docs: Update getting-started.md - add pnpm to init eslint config (#18599)Updates
eslint-plugin-n
from 16.6.2 to 17.9.0Release notes
Sourced from eslint-plugin-n's releases.
... (truncated)
Changelog
Sourced from eslint-plugin-n's changelog.
... (truncated)
Commits
67bbfdf
chore(master): release 17.9.0 (#299)0609431
feat: Add flag ignorePrivate to no-unpublished-x rules (#298)1bcb006
ci: Use up to dategoogleapis/release-please-action
action name (#292)988bdd4
chore(master): release 17.8.1 (#291)e82974f
fix: hashbang + eslint v8 compat issue (#290)6dca24c
chore(master): release 17.8.0 (#281)92e18b5
fix: Allow for misconfigured default exports (#288)0efe751
chore: update dependency markdownlint-cli to ^0.41.0 (#287)5221c40
feat(node-builtin): Add node 22.2.0 support (#282)4f50dfe
test: add a test for self-ref (#280)Updates
eslint-plugin-promise
from 6.1.1 to 6.4.0Release notes
Sourced from eslint-plugin-promise's releases.
Commits
ecbce9f
feat: add support for flat config (#479)4dfc8a7
feat: add support for eslint v9 (#478)afbda82
chore(deps-dev): bump braces from 3.0.2 to 3.0.3 (#477)5e4546d
fix(no-callback-in-promise): false positives when the exception is an argumen...c0c716b
feat: ResolvegetAncestors
andgetScope
calls in eslint v9 (#466)7d33c30
chore: add pkg.funding (#468)ce9ae7f
chore(deps-dev): bump@babel/traverse
from 7.19.1 to 7.24.1 (#453)62af490
chore(deps): bump actions/checkout from 3 to 4 (#461)19b21b4
chore(deps): bump codecov/codecov-action from 3 to 4 (#459)8c74b9b
chore(deps): bump actions/setup-node from 3 to 4 (#460)Updates
npm-check-updates
from 16.14.18 to 16.14.20Commits
116846b
16.14.203b12e6a
Enable bun on Windows (#1401)a788309
16.14.19dfb9466
fix: use HOME environment variable for npm configuration file lookup (#1399)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show