You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 11, 2021. It is now read-only.
-[Skip tests with annotations](#skip-tests-with-annotations)
19
+
-[Export JUnit report](#export-junit-report)
19
20
20
21
## Get started
21
22
@@ -30,12 +31,12 @@ npm i -D @playwright/test
30
31
Create `foo.spec.ts` to define your test. The test function uses the [`page`](https://playwright.dev/#path=docs%2Fapi.md&q=class-page) argument for browser automation.
31
32
32
33
```js
33
-
import { it, expect } from'@playwright/test';
34
+
import { it, expect } from"@playwright/test";
34
35
35
-
it('is a basic test with the page', async ({ page }) => {
# Run tests with slowMo (slows down Playwright operations by n milliseconds)
83
+
npx folio --param slowMo=100
84
+
81
85
# Save screenshots on failure in test-results directory
82
86
npx folio --param screenshotOnFailure
83
87
84
88
# Record videos
85
89
npx folio --param video
86
90
91
+
# Retry test failures
92
+
npx folio --retries 3
93
+
87
94
# See all options
88
95
npx folio --help
89
96
```
@@ -111,9 +118,9 @@ Save the run command as an NPM script.
111
118
The default `context` argument is a [BrowserContext][browser-context]. Browser contexts are isolated execution environments that can host multiple pages. See [multi-page scenarios][multi-page] for more examples.
112
119
113
120
```js
114
-
import { it } from'@playwright/test';
121
+
import { it } from"@playwright/test";
115
122
116
-
it('tests on multiple web pages', async ({ context }) => {
123
+
it("tests on multiple web pages", async ({ context }) => {
117
124
constpageFoo=awaitcontext.newPage();
118
125
constpageBar=awaitcontext.newPage();
119
126
// Test function
@@ -125,19 +132,19 @@ it('tests on multiple web pages', async ({ context }) => {
125
132
The `contextOptions` fixture defines default options used for context creation. This fixture can be overriden to configure mobile emulation in the default `context`.
The `expect` API supports visual comparisons with `toMatchSnapshot`. This uses the [pixelmatch](https://github.com/mapbox/pixelmatch) library, and you can pass `threshold` as an option.
0 commit comments