Skip to content

test(playwright): finalize automated screenshot flow per issue#42

Closed
jdjioe5-cpu wants to merge 3 commits into
GoodDollar:mainfrom
jdjioe5-cpu:fix/issue40-finalize-playwright-flow
Closed

test(playwright): finalize automated screenshot flow per issue#42
jdjioe5-cpu wants to merge 3 commits into
GoodDollar:mainfrom
jdjioe5-cpu:fix/issue40-finalize-playwright-flow

Conversation

@jdjioe5-cpu

@jdjioe5-cpu jdjioe5-cpu commented Jul 22, 2026

Copy link
Copy Markdown

What changed

  • tests-playwright/wallet-flows.e2e.ts
    • Store defaultLoginMethod as a JSON-encoded string so useLocalStorageValue's JSON.parse round-trip no longer throws SyntaxError: Unexpected token 'e' on every passing run.
    • Move screenshots under flow directories (login-onboarding/, home/, claim/) using the screenshot-<state>-<viewport>.png naming required by the plan in issue.
  • package.json
    • Replace the misleading test:e2e:screenshots script (which invoked playwright test --update-snapshots against a suite with no snapshot assertion) with a real playwright test --grep filter that targets the approved screenshot flows.
    • Add test:e2e:headed, test:e2e:debug, and test:e2e:update-baselines helpers.
  • .gitignore
    • Ignore generated Playwright screenshots, traces, videos, and reports while explicitly whitelisting the screenshot-<state>-<viewport>.png baseline pattern under each flow directory.
  • README.md
    • Add contributor documentation covering install, run, test-mode boundaries, screenshot layout, adding a flow, baseline update policy, and failure triage.

Required follow-up: agent-triggered CI workflow

The plan in issue and the scope check in issue both call for an agent-triggered Playwright CI path that runs only when launched from the Actions tab (so the suite never becomes an unconditional PR gate) and uploads screenshots, traces, videos, and logs as CI artifacts.

I drafted .github/workflows/playwright-agent.yml in this workspace but could not push it through git push: the OAuth token on the authenticated jdjioe5-cpu account only has gist, read:org, and repo scopes — GitHub refuses to create or update a workflow file without the workflow scope. The maintainer (or any account with workflow scope) can apply the exact file I drafted by copying the contents in the collapsible block below into .github/workflows/playwright-agent.yml on this branch.

playwright-agent.yml (draft, full contents)
name: Playwright agent

on:
  workflow_dispatch:
    inputs:
      grep:
        description: "Optional Playwright --grep filter to scope the run to a subset of tests."
        required: false
        default: ""

concurrency:
  group: playwright-agent-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  playwright:
    name: Run Playwright browser suite
    runs-on: ubuntu-latest
    timeout-minutes: 30
    env:
      NEXT_PUBLIC_PLAYWRIGHT_TEST_MODE: "true"
      NEXT_PUBLIC_LOGIN_GOOGLE_ENABLED: "false"
      NEXT_PUBLIC_LOGIN_FACEBOOK_ENABLED: "false"
      NEXT_PUBLIC_LOGIN_PWLESS_ENABLED: "false"
      NEXT_PUBLIC_TEST_LOGIN_ENABLED: "true"

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 24
      - uses: borales/actions-yarn@v5
        with:
          cmd: install
      - run: yarn playwright install --with-deps chromium
      - id: playwright
        run: |
          set -euo pipefail
          if [ -n "${{ inputs.grep }}" ]; then
            yarn test:e2e --grep "${{ inputs.grep }}"
          else
            yarn test:e2e
          fi
      - if: always()
        uses: actions/upload-artifact@v4
        with:
          name: playwright-screenshots
          path: |
            tests-playwright/**/*.png
            !tests-playwright/artifacts/**
          if-no-files-found: warn
          retention-days: 14
      - if: failure()
        uses: actions/upload-artifact@v4
        with:
          name: playwright-diagnostics
          path: |
            tests-playwright/artifacts/
            playwright-report/
            test-results/
          if-no-files-found: ignore
          retention-days: 14
      - if: always()
        uses: actions/upload-artifact@v4
        with:
          name: playwright-report
          path: |
            playwright-report/index.html
            playwright-report/data/
          if-no-files-found: ignore
          retention-days: 14

Verification performed on this branch

  • yarn biome:verify:all: 411 files checked, no errors.
  • yarn test: 4 files, 83 unit tests passed.
  • tsc --noEmit on tests-playwright/wallet-flows.e2e.ts: clean.

Reviewer checklist (for maintainer)

  • Apply the workflow YAML above to .github/workflows/playwright-agent.yml on this branch.
  • Launch the Playwright agent workflow from the Actions tab to upload screenshots, traces, videos, and logs.
  • Confirm the three approved screenshots land under tests-playwright/{login-onboarding,home,claim}/screenshot-*-{desktop,mobile}.png.
  • Confirm yarn build, the existing Check build workflow, and the Vitest suite remain intact.

Copilot AI and others added 3 commits July 22, 2026 12:00
…llar#40

Pick up the existing PR GoodDollar#39 and address the contributor scope checks from
issue GoodDollar#40 so the Playwright suite can ship behind an agent-triggered CI
workflow without turning into an unconditional PR gate.

- tests-playwright/wallet-flows.e2e.ts
  - Store defaultLoginMethod as a JSON-encoded string so useLocalStorageValue's
    JSON.parse round-trip no longer throws SyntaxError on every run.
  - Move screenshots under flow directories (login-onboarding/, home/, claim/)
    using the screenshot-<state>-<viewport>.png naming required by issue GoodDollar#38.

- package.json
  - Replace the misleading 'test:e2e:screenshots' (which ran
    playwright test --update-snapshots against a suite with no snapshot
    assertion) with a real Playwright --grep filter that targets the approved
    screenshot flows.
  - Add test:e2e:headed, test:e2e:debug, test:e2e:update-baselines helpers.

- .gitignore
  - Ignore generated Playwright screenshots, traces, videos, and reports
    while explicitly whitelisting the screenshot-<state>-<viewport>.png
    baseline pattern under each flow directory.

- README.md
  - Add contributor documentation covering install, run, test-mode
    boundaries, screenshot layout, adding a flow, baseline update policy,
    and failure triage.

CI workflow: a draft of .github/workflows/playwright-agent.yml is included
untracked in this workspace. It cannot be pushed through the current
authenticated GitHub account because the OAuth token lacks the 'workflow'
scope required by GitHub when creating or updating a workflow file through
git. The maintainer (or any account with workflow scope) must add the file
manually using the contents documented in the PR description.

Verification:
  yarn biome:verify:all -> 411 files checked, no errors
  yarn test             -> 4 files, 83 tests passed
  tsc --noEmit on tests-playwright/wallet-flows.e2e.ts -> clean
Refs: GoodDollar#40, GoodDollar#39, GoodDollar#38
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

@jdjioe5-cpu is attempting to deploy a commit to the GoodDollarTeam Team on Vercel.

A member of the Team first needs to authorize it.

@L03TJ3 L03TJ3 closed this Jul 23, 2026
@L03TJ3 L03TJ3 changed the title test(playwright): finalize automated screenshot flow per issue #40 test(playwright): finalize automated screenshot flow per issue Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants