Skip to content

Commit

Permalink
chore: add e2e tests (#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Jul 25, 2022
1 parent 1308f13 commit 5b5a6f4
Show file tree
Hide file tree
Showing 9 changed files with 410 additions and 20 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/build.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
name: Playwright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm i -g npm@8
- name: Install dependencies
run: npm ci
- name: Build site
run: npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v2
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ node_modules
/versioned_sidebars
/versions.json
/docusaurus.config.js
/playwright/
/playwright/
/test-results/
/playwright-report/
/playwright/.cache/
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ To roll the docs in PowerShell, make sure you set the env variable correctly, i.
$env:SRC_DIR="C:\Users\user\src\playwright"; npm run roll
```

### Run end-to-end tests

#### Run on local machine

Run this on one terminal:

```sh
npm run start-nodejs
```

and this on another, it will automatically use the local docusaurus server:

```sh
npx playwright test nodejs
```

#### Run on different environment

You can set the `BASE_URL=https://playwright.dev` env var, otherwise `http://localhost:3000` gets used by default.

### Publishing Doc Changes After a Release

In [microsoft/playwright](https://github.com/microsoft/playwright):
Expand Down
Loading

0 comments on commit 5b5a6f4

Please sign in to comment.