Skip to content

Commit

Permalink
cherry-pick(#26465): docs(test-sharding): fix GitHub workflow snippets (
Browse files Browse the repository at this point in the history
#26468)

This PR cherry-picks the following commits:

- 373a149

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
playwrightmachine and github-actions[bot] authored Aug 14, 2023
1 parent 35c63d9 commit ca975a9
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions docs/src/test-sharding-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,16 @@ This will produce a standard HTML report into `playwright-report` directory.
One of the easiest ways to shard Playwright tests across multiple machines is by using GitHub Actions matrix strategy. For example, you can configure a job to run your tests on four machines in parallel like this:

```yaml title=".github/workflows/playwright.yml"
name: "Playwright Tests"

name: Playwright Tests
on:
push:
branches:
- main

branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
playwright-tests:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -65,10 +66,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install
run: npx playwright install --with-deps

- name: Run Playwright tests
run: npx playwright test --shard ${{ matrix.shard }}
Expand Down Expand Up @@ -96,6 +99,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci

Expand Down

0 comments on commit ca975a9

Please sign in to comment.