docs: artifacts and headful execution (#20)
* docs: artifacts and headful execution * Add auto-servernum for xvfb
This commit is contained in:
Родитель
cd8c1c8c86
Коммит
9d539ef79c
|
@ -27,4 +27,4 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: cd sample && npm install
|
||||
- name: Run Playwright
|
||||
run: cd sample && HEADFUL=true xvfb-run node index.js
|
||||
run: cd sample && HEADFUL=true xvfb-run --auto-servernum -- node index.js
|
||||
|
|
32
README.md
32
README.md
|
@ -20,12 +20,44 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-node@v1
|
||||
|
||||
- uses: microsoft/playwright-github-action@v1
|
||||
|
||||
- name: Install dependencies and run tests
|
||||
run: npm install && npm test
|
||||
```
|
||||
|
||||
### Upload artifacts
|
||||
|
||||
This GitHub Action can be combined with the [Upload Artifact action](https://github.com/actions/upload-artifact) to upload test artifacts (like screenshots or logs).
|
||||
|
||||
```yml
|
||||
steps:
|
||||
- uses: microsoft/playwright-github-action@v1
|
||||
|
||||
- name: Install dependencies and run tests
|
||||
run: npm install && npm test
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: test-artifacts
|
||||
path: path/to/artifacts
|
||||
```
|
||||
|
||||
### Run in headful mode
|
||||
|
||||
This GitHub Action can also execute tests in headful mode. To do this, use `xvfb-run` on a Linux agent.
|
||||
|
||||
```sh
|
||||
# Windows/macOS
|
||||
$ npm test
|
||||
|
||||
# Linux
|
||||
$ xfvb-run --auto-servernum -- npm test
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
* [Get started with Playwright](https://github.com/microsoft/playwright)
|
||||
|
|
Загрузка…
Ссылка в новой задаче