Skip to content

test: add Pest browser tests (Playwright) - #43

Merged
StanBarrows merged 2 commits into
mainfrom
test/pest-browser
Oct 23, 2026
Merged

StanBarrows merged 2 commits into
mainfrom
test/pest-browser

Conversation

@StanBarrows

Copy link
Copy Markdown
Contributor

Adds Pest browser tests (pestphp/pest-plugin-browser, Playwright Chromium) for the feedback page behind signed links, the only HTML the API serves, plus a CI lane pull-request | ci pest browser on ubuntu-latest with PostgreSQL 17.

The existing Playwright suites in widget/ and e2e/ are unchanged; they keep covering the widget.

Tests (tests/Browser/FeedbackPageTest.php)

  • message, sender and screenshot render and the image loads, without JavaScript errors under the page's CSP
  • technical tab: console errors, failed requests, environment; #technical opens it directly
  • message card hides and shows; copy buttons announce "Copied to clipboard"
  • a team link completes and reopens the entry and logs by; the sender's read-only link has no status buttons
  • expired and tampered links and typed API URLs get an empty page

Other changes

  • phpunit.xml: new Browser testsuite. The pest, coverage and database matrix lanes now run pest --exclude-testsuite=Browser, and so do composer test and composer test:coverage. Coverage comes from the same tests as before.
  • New dev dependencies: pestphp/pest-plugin-browser ^5.1, playwright 1.64.1 (pinned like the widget's @playwright/test).
  • Failure screenshots (tests/Browser/Screenshots) are gitignored. README and CHANGELOG updated.

Run locally

composer install && npm ci && npm run build
npx playwright install chromium
composer test:browser            # SQLite in memory by default
# or against Postgres like CI:
DB_CONNECTION=pgsql DB_HOST=127.0.0.1 DB_PORT=5432 DB_DATABASE=laravel_test DB_USERNAME=postgres DB_PASSWORD=postgres ./vendor/bin/pest tests/Browser

🤖 Generated with Claude Code

Sebastian BURGIN-FIX (ext) and others added 2 commits October 23, 2026 14:36
Company rule since 2026-10-23: every repository has Pest browser tests
(pestphp/pest-plugin-browser with Playwright). The existing Playwright
suites in widget/ and e2e/ cover the widget; the feedback page behind
signed links, the only HTML the API serves, was only checked as HTML
strings. These tests drive it in Chromium, under its real CSP:

- message, sender and screenshot render, the image actually loads
- the technical tab shows console errors, failed requests and the
  environment, #technical opens it directly
- the message card hides and shows, copy announces itself
- a team link completes and reopens the entry and logs who did it,
  the sender's link has no status buttons
- expired and tampered links and typed API URLs get an empty page

The suite lives in tests/Browser with its own Browser testsuite and
RefreshDatabase. `composer test` and `test:coverage` exclude it,
`composer test:browser` runs it. playwright is pinned like the widget's
@playwright/test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New lane "pull-request | ci pest browser" on ubuntu-latest (public
repository, so no self-hosted runners) with the PHP and Node setup of the
pest lane and a PostgreSQL 17 service on a Docker-assigned port. It builds
the widget, installs Playwright's Chromium and runs tests/Browser; on
failure it uploads the logs and the failure screenshots.

The pest, coverage and database matrix lanes run plain `pest`, which would
now also pick up the Browser testsuite without a browser, so they exclude
it. Their coverage comes from the same tests as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StanBarrows
StanBarrows merged commit 5f61fe8 into main Oct 23, 2026
12 checks passed
@StanBarrows
StanBarrows deleted the test/pest-browser branch October 23, 2026 13:01
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.

1 participant