docs: artifacts and headful execution (#20)

* docs: artifacts and headful execution

* Add auto-servernum for xvfb
This commit is contained in:
Arjun Attam 2020-06-15 22:13:15 -07:00 коммит произвёл GitHub
Родитель cd8c1c8c86
Коммит 9d539ef79c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 33 добавлений и 1 удалений

2
.github/workflows/ubuntu.yml поставляемый
Просмотреть файл

@ -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

Просмотреть файл

@ -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)