Skip to content

Example PR comment #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/argos-example.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: demo.playwright.pwc-p.argos
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
basicTests:
strategy:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/rerun-shards-pwc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ jobs:
COMMAND="npx pwc ${{ steps.last-failed-action.outputs.extra-pw-flags }}"
echo "Running command: $COMMAND"
$COMMAND

2 changes: 1 addition & 1 deletion .github/workflows/rerun-shards-reporter.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: failed-only-reporter

on:
push:
workflow_dispatch:

jobs:
test-reporter:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reruns-or8n.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: failed-only-or8n

on:
push:
workflow_dispatch:

jobs:
test-or8n:
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/test-basic-pwc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: demo.playwright.pwc
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
basicTests:
strategy:
Expand All @@ -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
Expand All @@ -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 }}
5 changes: 1 addition & 4 deletions .github/workflows/test-basic-reporter.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: demo.playwright.reporter
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
basicTests:
strategy:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/test-or8n.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: demo.playwright.pwc-p
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
basicTests:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion basic/0-failing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
15 changes: 8 additions & 7 deletions basic/7-accessibility.spec.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/");
Expand All @@ -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([]);
});
});
16 changes: 8 additions & 8 deletions basic/pw.config.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"],
Expand Down
Loading