Skip to content

Commit

Permalink
tweak playwright config
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmcadam committed Aug 1, 2024
1 parent c8aeaef commit 16320da
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 26 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
branches: [main, master]
pull_request:
branches: [ main, master ]
branches: [main, master]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Build
run: pnpm run build
- name: Install Playwright Browsers
run: pnpm run e2e:install
- name: Run Playwright tests
run: pnpm run e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"prettier": "prettier --check 'src/**/*.{ts,tsx,js,jsx,html,css}'",
"prettier:fix": "prettier --check --write 'src/**/*.{ts,tsx,js,jsx,html,css}'",
"typecheck": "tsc --noEmit",
"test": "vitest src"
"test": "vitest src",
"e2e": "playwright test",
"e2e:install": "playwright install --with-deps chromium",
"e2e:ui": "playwright test --ui"
},
"dependencies": {
"@radix-ui/react-slot": "^1.1.0",
Expand Down
14 changes: 7 additions & 7 deletions tests/visitor-completes-quiz.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { test, expect } from "@playwright/test";
test("smoke test", async ({ page }) => {
await page.goto("/");

await page
.getByRole(
await expect(
page.getByRole(
"button",

{ name: /take the quiz/i },
)
.click();

await expect(
page.getByRole("heading", { name: /is manual right for you/i }),
),
).toBeVisible();

// await expect(
// page.getByRole("heading", { name: /is manual right for you/i }),
// ).toBeVisible();
});

0 comments on commit 16320da

Please sign in to comment.