Skip to content

Commit 5b5a6f4

Browse files
authored
chore: add e2e tests (microsoft#655)
1 parent 1308f13 commit 5b5a6f4

File tree

9 files changed

+410
-20
lines changed

9 files changed

+410
-20
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
8+
jobs:
9+
test:
10+
name: Playwright
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: '14'
17+
- run: npm i -g npm@8
18+
- name: Install dependencies
19+
run: npm ci
20+
- name: Build site
21+
run: npm run build
22+
- name: Install Playwright Browsers
23+
run: npx playwright install --with-deps
24+
- name: Run Playwright tests
25+
run: npx playwright test
26+
- uses: actions/upload-artifact@v2
27+
if: always()
28+
with:
29+
name: playwright-report
30+
path: playwright-report/
31+
retention-days: 30

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ node_modules
2323
/versioned_sidebars
2424
/versions.json
2525
/docusaurus.config.js
26-
/playwright/
26+
/playwright/
27+
/test-results/
28+
/playwright-report/
29+
/playwright/.cache/

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,26 @@ To roll the docs in PowerShell, make sure you set the env variable correctly, i.
6565
$env:SRC_DIR="C:\Users\user\src\playwright"; npm run roll
6666
```
6767

68+
### Run end-to-end tests
69+
70+
#### Run on local machine
71+
72+
Run this on one terminal:
73+
74+
```sh
75+
npm run start-nodejs
76+
```
77+
78+
and this on another, it will automatically use the local docusaurus server:
79+
80+
```sh
81+
npx playwright test nodejs
82+
```
83+
84+
#### Run on different environment
85+
86+
You can set the `BASE_URL=https://playwright.dev` env var, otherwise `http://localhost:3000` gets used by default.
87+
6888
### Publishing Doc Changes After a Release
6989

7090
In [microsoft/playwright](https://github.com/microsoft/playwright):

0 commit comments

Comments
 (0)