Skip to content

Commit

Permalink
feat(roll): roll to ToT Playwright (02-07-24)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 2, 2024
1 parent a6d2040 commit be705f2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dotnet/docs/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Utilizing the new [Clock] API allows to manipulate and control time within tests
```csharp
// Initialize clock with some time before the test time and let the page load naturally.
// `Date.now` will progress as the timers fire.
await Page.Clock.InstallAsync(new
await Page.Clock.InstallAsync(new()
{
Time = new DateTime(2024, 2, 2, 8, 0, 0)
TimeDate = new DateTime(2024, 2, 2, 8, 0, 0)
});
await Page.GotoAsync("http://localhost:3333");

Expand All @@ -31,11 +31,11 @@ await Page.GotoAsync("http://localhost:3333");
await Page.Clock.PauseAtAsync(new DateTime(2024, 2, 2, 10, 0, 0));

// Assert the page state.
await Expect(Page.GetByTestId("current-time")).ToHaveText("2/2/2024, 10:00:00 AM");
await Expect(Page.GetByTestId("current-time")).ToHaveTextAsync("2/2/2024, 10:00:00 AM");

// Close the laptop lid again and open it at 10:30am.
await Page.Clock.FastForwardAsync("30:00");
await Expect(Page.GetByTestId("current-time")).ToHaveText("2/2/2024, 10:30:00 AM");
await Expect(Page.GetByTestId("current-time")).ToHaveTextAsync("2/2/2024, 10:30:00 AM");
```

See [the clock guide](./clock.mdx) for more details.
Expand Down
18 changes: 17 additions & 1 deletion nodejs/docs/ci.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,22 @@ steps:
- 'CI=true'
```
### Drone
To run Playwright tests on Drone, use our public Docker image ([see Dockerfile](./docker.mdx)).
```yml
kind: pipeline
name: default
type: docker
steps:
- name: test
image: mcr.microsoft.com/playwright:v1.45.0-jammy
commands:
- npx playwright test
```
## Caching browsers
Caching browser binaries is not recommended, since the amount of time it takes to restore the cache is comparable to the time it takes to download the binaries. Especially under Linux, [operating system dependencies](./browsers.mdx#install-system-dependencies) need to be installed, which are not cacheable.
Expand All @@ -357,7 +373,7 @@ By default, Playwright launches browsers in headless mode. See in our [Running t
On Linux agents, headed execution requires [Xvfb](https://en.wikipedia.org/wiki/Xvfb) to be installed. Our [Docker image](./docker.mdx) and GitHub Action have Xvfb pre-installed. To run browsers in headed mode with Xvfb, add `xvfb-run` before the actual command.
```bash
xvfb-run npx playwrght test
xvfb-run npx playwright test
```
Expand Down

0 comments on commit be705f2

Please sign in to comment.