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 26b1970..04c1616 100644 --- a/.github/workflows/test-basic-pwc.yml +++ b/.github/workflows/test-basic-pwc.yml @@ -2,9 +2,7 @@ name: demo.playwright.pwc on: workflow_dispatch: pull_request: - branches: [main] - push: - branches: [main] + jobs: basicTests: strategy: @@ -16,7 +14,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 @@ -37,20 +35,11 @@ jobs: npm ci npx playwright install chrome - - name: Run Project A - 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 + - 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 --shard=${{ matrix.shard }}/${{ strategy.job-total }} + npx pwc --shard=${{ matrix.shard }}/${{ strategy.job-total }} 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: 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/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 +}); 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"],