From 6c7fd7708abccaf76b4d6845a2dc402ace38dc08 Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Fri, 4 Oct 2024 23:46:05 -0700 Subject: [PATCH 1/5] chore: PR comment example --- .github/workflows/test-basic-pwc.yml | 13 ++----------- basic/0-failing.spec.ts | 2 +- basic/pw.config.shared.ts | 16 ++++++++-------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-basic-pwc.yml b/.github/workflows/test-basic-pwc.yml index 26b1970..c90a421 100644 --- a/.github/workflows/test-basic-pwc.yml +++ b/.github/workflows/test-basic-pwc.yml @@ -37,20 +37,11 @@ jobs: npm ci npx playwright install chrome - - name: Run Project A + - name: Playwright Tests continue-on-error: false working-directory: ./basic env: CURRENTS_PROJECT_ID: bnsqNa CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }} run: | - npx pwc --project a --shard=${{ matrix.shard }}/${{ strategy.job-total }} - - - name: Run Project B - continue-on-error: false - working-directory: ./basic - env: - CURRENTS_PROJECT_ID: bnsqNa - CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }} - run: | - npx pwc --project --shard=${{ matrix.shard }}/${{ strategy.job-total }} + npx pwc --shard=${{ matrix.shard }}/${{ strategy.job-total }} diff --git a/basic/0-failing.spec.ts b/basic/0-failing.spec.ts index b367e92..94c43dc 100644 --- a/basic/0-failing.spec.ts +++ b/basic/0-failing.spec.ts @@ -7,7 +7,7 @@ test("basic test @basic", async ({ page }) => { const inputBox = page.locator("input.new-todo"); const todoList = page.locator(".todo-list"); - await inputBox.fill("Stop using Cypress"); + await inputBox.fill("Learn JavaScript"); await inputBox.press("Enter"); await expect(todoList).toHaveText("Learn Playwright"); }); diff --git a/basic/pw.config.shared.ts b/basic/pw.config.shared.ts index a79e7ad..36a6721 100644 --- a/basic/pw.config.shared.ts +++ b/basic/pw.config.shared.ts @@ -13,13 +13,6 @@ const config: PlaywrightTestConfig = { retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, - webServer: { - command: "node ./server", - port: 4346, - cwd: __dirname, - reuseExistingServer: true, - }, - use: { actionTimeout: 0, trace: "on", @@ -29,7 +22,14 @@ const config: PlaywrightTestConfig = { projects: [ { - name: "a", + name: "Project A", + retries: 2, + use: { + ...devices["Desktop Chrome"], + }, + }, + { + name: "Project B", retries: 2, use: { ...devices["Desktop Chrome"], From 766f38a4996c99e7afdf314341e5012334e31457 Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Fri, 4 Oct 2024 23:47:26 -0700 Subject: [PATCH 2/5] chore: start workflows manually --- .github/workflows/argos-example.yml | 5 +---- .github/workflows/rerun-shards-pwc.yml | 1 - .github/workflows/rerun-shards-reporter.yml | 2 +- .github/workflows/reruns-or8n.yml | 2 +- .github/workflows/test-basic-pwc.yml | 5 +---- .github/workflows/test-basic-reporter.yml | 5 +---- .github/workflows/test-or8n.yml | 5 +---- 7 files changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/argos-example.yml b/.github/workflows/argos-example.yml index 38402a1..819b057 100644 --- a/.github/workflows/argos-example.yml +++ b/.github/workflows/argos-example.yml @@ -1,10 +1,7 @@ name: demo.playwright.pwc-p.argos on: workflow_dispatch: - pull_request: - branches: [main] - push: - branches: [main] + jobs: basicTests: strategy: diff --git a/.github/workflows/rerun-shards-pwc.yml b/.github/workflows/rerun-shards-pwc.yml index eac9d4b..98646f9 100644 --- a/.github/workflows/rerun-shards-pwc.yml +++ b/.github/workflows/rerun-shards-pwc.yml @@ -49,4 +49,3 @@ jobs: COMMAND="npx pwc ${{ steps.last-failed-action.outputs.extra-pw-flags }}" echo "Running command: $COMMAND" $COMMAND - diff --git a/.github/workflows/rerun-shards-reporter.yml b/.github/workflows/rerun-shards-reporter.yml index 4d184db..86bc026 100644 --- a/.github/workflows/rerun-shards-reporter.yml +++ b/.github/workflows/rerun-shards-reporter.yml @@ -1,7 +1,7 @@ name: failed-only-reporter on: - push: + workflow_dispatch: jobs: test-reporter: diff --git a/.github/workflows/reruns-or8n.yml b/.github/workflows/reruns-or8n.yml index 2540bcd..04fb398 100644 --- a/.github/workflows/reruns-or8n.yml +++ b/.github/workflows/reruns-or8n.yml @@ -1,7 +1,7 @@ name: failed-only-or8n on: - push: + workflow_dispatch: jobs: test-or8n: diff --git a/.github/workflows/test-basic-pwc.yml b/.github/workflows/test-basic-pwc.yml index c90a421..d7955ab 100644 --- a/.github/workflows/test-basic-pwc.yml +++ b/.github/workflows/test-basic-pwc.yml @@ -1,10 +1,7 @@ name: demo.playwright.pwc on: workflow_dispatch: - pull_request: - branches: [main] - push: - branches: [main] + jobs: basicTests: strategy: diff --git a/.github/workflows/test-basic-reporter.yml b/.github/workflows/test-basic-reporter.yml index 9214df2..e00341b 100644 --- a/.github/workflows/test-basic-reporter.yml +++ b/.github/workflows/test-basic-reporter.yml @@ -1,10 +1,7 @@ name: demo.playwright.reporter on: workflow_dispatch: - pull_request: - branches: [main] - push: - branches: [main] + jobs: basicTests: strategy: diff --git a/.github/workflows/test-or8n.yml b/.github/workflows/test-or8n.yml index 2c91bc9..18051e1 100644 --- a/.github/workflows/test-or8n.yml +++ b/.github/workflows/test-or8n.yml @@ -1,10 +1,7 @@ name: demo.playwright.pwc-p on: workflow_dispatch: - pull_request: - branches: [main] - push: - branches: [main] + jobs: basicTests: strategy: From f63c6a8a225186a5edd69bec41cc4f8519568f4a Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Fri, 4 Oct 2024 23:49:53 -0700 Subject: [PATCH 3/5] chore: use latest playwright image version --- .github/workflows/test-basic-pwc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-basic-pwc.yml b/.github/workflows/test-basic-pwc.yml index d7955ab..3125004 100644 --- a/.github/workflows/test-basic-pwc.yml +++ b/.github/workflows/test-basic-pwc.yml @@ -13,7 +13,7 @@ jobs: name: "Playwright Tests - pwc" timeout-minutes: 60 runs-on: ubuntu-22.04 - container: mcr.microsoft.com/playwright:1.46.1 + container: mcr.microsoft.com/playwright:latest steps: - uses: actions/checkout@v4 From d6b287ce4f83f33b1da8be558d8b8e6bc4e4c37b Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Fri, 4 Oct 2024 23:54:28 -0700 Subject: [PATCH 4/5] chore: run pwc example on PR --- .github/workflows/test-basic-pwc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-basic-pwc.yml b/.github/workflows/test-basic-pwc.yml index 3125004..04c1616 100644 --- a/.github/workflows/test-basic-pwc.yml +++ b/.github/workflows/test-basic-pwc.yml @@ -1,6 +1,7 @@ name: demo.playwright.pwc on: workflow_dispatch: + pull_request: jobs: basicTests: From 0d22cf5f1ed04835a7f6c754d5df37857ccde56b Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Sat, 5 Oct 2024 00:01:43 -0700 Subject: [PATCH 5/5] chore: skip a test, trigger new action --- basic/7-accessibility.spec.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/basic/7-accessibility.spec.ts b/basic/7-accessibility.spec.ts index 7209f9e..64c212b 100644 --- a/basic/7-accessibility.spec.ts +++ b/basic/7-accessibility.spec.ts @@ -1,5 +1,5 @@ -import { test, expect } from "@playwright/test"; import AxeBuilder from "@axe-core/playwright"; // 1 +import { expect, test } from "@playwright/test"; test.describe("homepage", () => { // 2 @@ -14,7 +14,7 @@ test.describe("homepage", () => { }); }); -test("navigation menu should not have automatically detectable accessibility violations", async ({ +test.skip("navigation menu should not have automatically detectable accessibility violations", async ({ page, }) => { await page.goto("https://currents.dev/"); @@ -33,13 +33,14 @@ test("navigation menu should not have automatically detectable accessibility vio expect(accessibilityScanResults.violations).toEqual([]); }); - -test('should not have any automatically detectable WCAG A or AA violations', async ({ page }) => { +test("should not have any automatically detectable WCAG A or AA violations", async ({ + page, +}) => { await page.goto("https://currents.dev/"); const accessibilityScanResults = await new AxeBuilder({ page }) - .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']) - .analyze(); + .withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"]) + .analyze(); expect(accessibilityScanResults.violations).toEqual([]); -}); \ No newline at end of file +});