Add - Themegrill QA Setup for E2E Testing - #26
Conversation
QA suite — passed ✅All 64 checks passed. 64 passed · 0 failed · 0 skipped · 1 flaky · 480s
|
| Test | Spec | Retries |
|---|---|---|
| a subscriber logged into wp-admin cannot reach the AllFeedback screen @fresh @permissions | tests/e2e/specs/permissions/role-boundaries.spec.ts:142 |
1 |
See it for yourself
Download the full report (qa-suite-allfeedback-26.zip). Unzip it and open qa-report.html in any browser — it shows each failure with screenshots of the page at the moment it broke, and what the run did and did not check.
Replaying a failure step by step (developers)
The archive also carries a Playwright trace — every click, the page at each step, network and console. From the unzipped folder:
npx playwright show-report playwright-report
It needs that command rather than opening the file directly: a trace viewer cannot start from a file:// page.
Automated check — no AI involved. It runs the tests in this branch.
There was a problem hiding this comment.
🟡 Changes recommended
.themegrill-qa/.env.local is referenced as a local credential source but is not actually gitignored, risking accidental commit of secrets.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds a ThemeGrill QA (claudegrill) Playwright end-to-end test suite for the AllFeedback WordPress plugin, including fixtures/helpers, a “gate/@fresh” spec tier covering key product contracts, and CI wiring to run the suite on pull requests.
Changes:
- Added Playwright config plus a reusable support layer (env resolution, auth setup, REST client, WP fixtures, widget driver).
- Added a comprehensive
@freshe2e spec set covering admin surfaces, survey lifecycle, widget visibility/targeting, submissions/response management, analytics, settings, and permission boundaries. - Added ThemeGrill QA suite metadata/docs (
.themegrill-qa/*) and a GitHub Actions workflow to run the suite on PRs, plus repo ignore/distignore updates.
File summaries
| File | Description |
|---|---|
tests/e2e/support/wp.ts |
WordPress REST fixtures for pages/users (incl. app-password users for role boundary tests). |
tests/e2e/support/widget.ts |
Widget-driving helper (openWidget) and shared selectors. |
tests/e2e/support/env.ts |
Resolves base URL + admin creds from env or .themegrill-qa/.env.local. |
tests/e2e/support/auth.setup.ts |
One-time admin login project that writes Playwright storage state. |
tests/e2e/support/api.ts |
Nonce-aware AllFeedback REST client + survey lifecycle helpers. |
tests/e2e/specs/settings/settings-contract.spec.ts |
Pins settings tree shape + enum validation + partial-write behavior. |
tests/e2e/specs/permissions/role-boundaries.spec.ts |
Verifies non-admin roles are refused using app-password auth. |
tests/e2e/specs/permissions/rest-permissions.spec.ts |
Verifies anonymous callers cannot access admin-only REST surfaces. |
tests/e2e/specs/managing-responses/submit-response.spec.ts |
Verifies submit nonce requirement + end-to-end widget submission flow. |
tests/e2e/specs/managing-responses/response-management.spec.ts |
Verifies read/unread, deletion, unread counter, and NPS analytics surfacing. |
tests/e2e/specs/getting-started/admin-surfaces.spec.ts |
Verifies admin menu/routes, mount point, and localized nonce. |
tests/e2e/specs/building-forms/widget-visibility.spec.ts |
Verifies draft/published widget behavior, panel toggle, shortcode draft behavior. |
tests/e2e/specs/building-forms/targeting.spec.ts |
Verifies targeting modes, empty selection behavior, and one-widget rule. |
tests/e2e/specs/building-forms/survey-lifecycle.spec.ts |
Verifies draft creation, publish, trash/delete contracts (incl. 409 guards). |
tests/e2e/specs/building-forms/duplicate-and-restore.spec.ts |
Verifies duplicate creates a draft copy and restore-to-draft path. |
tests/e2e/specs/building-forms/block-embed.spec.ts |
Pins known block-render fatal via test.fail() markers + control cases. |
tests/e2e/specs/analytics-reporting/analytics.spec.ts |
Verifies analytics payloads (finite stats), per-form session metrics presence, and UI renders. |
playwright.config.ts |
Adds Playwright test runner configuration and project setup dependency. |
package.json |
Adds @playwright/test dev dependency. |
CLAUDE.md |
Updates repo docs with Playwright/e2e usage and QA gotchas. |
.themegrill-qa/suite.json |
Declares suite runner/tiers/area-to-path mapping for claudegrill. |
.themegrill-qa/knowledge.md |
Adds QA knowledge base and known-bug notes to guide future QA/spec authoring. |
.themegrill-qa/docs/settings.md |
Ingested docs snapshot for QA intent (settings). |
.themegrill-qa/docs/getting-started.md |
Ingested docs snapshot for QA intent (getting started). |
.themegrill-qa/docs/building-forms.md |
Ingested docs snapshot for QA intent (building forms). |
.themegrill-qa/docs/analytics-reporting.md |
Ingested docs snapshot for QA intent (analytics). |
.themegrill-qa/docs-index.json |
Index of docs sections + suggested areas for QA mapping. |
.gitignore |
Ignores Playwright outputs and various dev artifacts. |
.github/workflows/qa-suite.yml |
Adds PR workflow calling the shared claudegrill suite runner. |
.distignore |
Excludes tests/QA/build tooling from distributed plugin archives. |
.phpunit.result.cache |
Removed from repo and added to .gitignore. |
Review details
- Files reviewed: 30/31 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The suite passed locally and failed three checks in CI (run 34095509973). Neither failure was a product regression; both were the suite assuming state that only a developer's machine has. Build the compiled assets in CI. resources/build/ is gitignored, and suite.json's install command was `pnpm install --frozen-lockfile` alone, so a CI checkout had no compiled admin SPA and no compiled widget. The resulting failure is quietly misleading rather than obvious: every REST-only and server-rendered spec passes while every spec needing JavaScript fails, which reads exactly like a UI regression. That is what the run showed — 16 passed, and the only failures were the forms list and the two targeting specs, all waiting on markup React never rendered. Complete the setup wizard in auth.setup.ts. While allfeedback_wizard_status is `not_started`, maybeRedirectToWizard() sends the first admin page load to #/wizard and exits. The redirect flips the status to `initiated`, so it fires exactly once and lands on whichever spec reaches wp-admin first — an order-dependent failure that moves between runs. Completing it after login gives every spec the same starting point. Verified by resetting the wizard to not_started and re-running: 73/73. Both findings are recorded in .themegrill-qa/knowledge.md and CLAUDE.md, including the trap that deleting resources/build/ locally is not a faithful simulation of the CI state — it breaks the site earlier and harder, and sends you after the wrong cause.
Add claudegrill QA setup and a Playwright suite
Sets this plugin up for claudegrill and ports the gate tier of our existing
Running it
pnpm install && pnpm test:e2e:install
.themegrill-qa/.env.local: TGQA_BASE_URL, TGQA_ADMIN_USER, TGQA_ADMIN_PASS
pnpm test:e2e