From ca975a92ebf6d05ddc834dc384ae0bff2b92a688 Mon Sep 17 00:00:00 2001 From: Playwright Service <89237858+playwrightmachine@users.noreply.github.com> Date: Mon, 14 Aug 2023 07:11:56 -0700 Subject: [PATCH] cherry-pick(#26465): docs(test-sharding): fix GitHub workflow snippets (#26468) This PR cherry-picks the following commits: - 373a149a231934228e857bb640541b686209a657 Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- docs/src/test-sharding-js.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/src/test-sharding-js.md b/docs/src/test-sharding-js.md index fbc9ea9ab3..be15077071 100644 --- a/docs/src/test-sharding-js.md +++ b/docs/src/test-sharding-js.md @@ -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: @@ -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 }} @@ -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