Skip to content

[Playwright] Backport playwright qa structure and introduce E2E testing to the website - #144

Merged
AnnaSevelova merged 11 commits into
stagingfrom
chore/backport-playwright-qa-structure
Oct 19, 2026
Merged

AnnaSevelova merged 11 commits into
stagingfrom
chore/backport-playwright-qa-structure

Conversation

@AnnaSevelova

@AnnaSevelova AnnaSevelova commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Replaces the old Playwright template setup with the current QA structure from the strapi-next-monorepo-starter (dev), adapted to this repo, and adds tests for the main parts of the website. The QA pipeline now runs automatically every night against strapi.io.

Why: the old setup was a leftover from the template — one example test, SEO and Axe on the homepage only, and visual tests that could never fail in CI. Nothing covered the blog, pricing or legal pages.

What the tests cover

Suite What it checks
Page smoke 15 main pages + one example per page template (blog post/category, user story, feature, solution) load, render their content and throw no browser errors
Homepage main navbar and footer
Blog category navigation, featured post, post list (title + publish date), "Load More Articles", opening a post
Cloud pricing plan sign-up links, comparison table, monthly/yearly billing switch
CMS pricing Growth checkout dialog — seats, totals, SSO add-on, cancel
Legal pages 6 legal pages: title, full text (word count, sections), no placeholders, valid effective date
Mocks Chargebee checkout stubbed (plan, seats and SSO sent correctly, no real checkout session) · failing Strapi images (page still renders) · Strapi live preview (handshake, refresh only from the Strapi origin)
SEO + Axe 10 key pages
Visual 6 stable pages, Chromium + Firefox, compared with committed prod baselines
Lighthouse scores per page, with a committed history file

How the tests are written

  • No assertions on CMS-managed content (copy, prices, blog posts, legal texts). CMS-labelled elements are found by role or link target, so content updates don't break tests.
  • Pages wait for hydration, not networkidle — deployed pages never go idle. A blocked or broken page fails right away with its HTTP status instead of a timeout.
  • SEO and legal checks load each page once per suite, but every check is still its own test in the report.
  • Known non-breaking browser errors (React hydration #418) are reported as warnings, not failures.
  • The cookie banner is closed up front with a consent cookie (necessary cookies only); visual screenshots also hide the announcement bar, images and scripts, so content changes don't cause diffs.
  • Browsers: Chromium runs every E2E spec; Firefox and WebKit run only the page-load and homepage-layout specs, where browser differences show up. E2E_ALL_BROWSERS=true runs everything everywhere.
  • BASE_URL works with or without https:// (e.g. strapi.io).

QA pipeline (.github/workflows/qa.yml)

  • Nightly at 00:00 UTC (02:00 Prague in summer): E2E, Axe, SEO, Visual against https://strapi.io (or the BASE_URL repo variable). Starts once the workflow is on main. Lighthouse stays manual.
  • Manual runs as before: Actions → QA → Run workflow, pick suites and base_url.
  • E2E runs as one job per browser (separate runners and IPs) to stay under the strapi.io CDN bot-protection limit.
  • Axe and SEO soft-fail: findings show as annotations, a job summary warning and a report artifact, but don't fail the run.
  • CI runs gently (1 worker, 1 retry) for the same CDN reason.
  • Visual Docker scripts pin the Playwright version that matches the Docker image.

Other changes

  • turbo.json: BASE_URL, MOBILE_VIEWPORTS_TESTING_ENABLED and E2E_ALL_BROWSERS in globalEnv — without them Turbo's strict env mode hides them from the tests.
  • write-tests agent skill (.agents/skills), QA README (qa/tests/README.md) and docs/commands.md updated.
  • Includes fetchPage-5xx.test.ts (Vitest).

TL;DR

New Playwright QA setup with tests for pages, blog, pricing (incl. stubbed checkout), legal pages, SEO, Axe and visuals, running nightly against strapi.io. SEO/Axe findings are real app issues (tickets created) and don't fail the pipeline.

Test results (against prod)

  • E2E: passing, except pages blocked by the CDN (HTTP 403) — see "Known limitations".
  • Visual: 12/12 passing against the committed baselines.
  • SEO / Axe: failing on real app issues, already filed as tickets: no <h1> on several pages, skipped heading levels, announcement bar contrast/landmark, unnamed navigation landmarks, empty headings, short page titles.

Known limitations / follow-ups

  • CDN bot protection: strapi.io blocks bursts of automated requests (~70–80 page loads per IP, then HTTP 403). The per-browser jobs and gentle CI settings are workarounds; the real fix is the WAF bypass rule (dev ticket). TODOs in playwright.config.ts and qa.yml mark what to revert afterwards.
  • Node 20 GitHub Actions (actions/setup-node@v4, pnpm/action-setup@v4, …): dev ticket.
  • Preview mock tests are skipped until STRAPI_URL is configured.

New environmental variables

QA only, not app env vars — all optional:

  • STRAPI_URL (qa/tests/playwright/.env): Strapi URL of the app under test; the preview mock tests are skipped without it.
  • E2E_ALL_BROWSERS (qa/tests/playwright/.env): run every E2E spec in every browser.
  • BASE_URL repository variable: target for nightly/manual runs; defaults to https://strapi.io.

The Lighthouse job opens a PR with the score history, which needs Settings → Actions → Allow GitHub Actions to create pull requests.

Checklist - author

  • Assignee is set (the active developer of this PR).
  • Reviewers are set (team members who will review the code).
  • PR is linked I have linked the PR to an issue in Jira.
  • Description I have described the changes proposed in the PR clearly and concisely (more important than what is why).
  • Screenshots/Videos I have added screenshots/videos or they were not needed.
  • Environmental variables are listed or they were not needed.
  • Unit/Integration tests are added for all utilities and business important logic
  • Labels I have added labels to the PR.
  • [OPTIONAL] Conversation/documentation is started in places where the code is not self-explanatory

Before merging

  • PR is approved
  • All conversations are resolved
  • Pipelines are not failing

Checklist - reviewer

  • I understand all proposed changes.

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
website-ui Ready Ready Preview Oct 16, 2026 8:58am UTC

Request Review

@AnnaSevelova
AnnaSevelova changed the base branch from main to staging October 13, 2026 14:16
@AnnaSevelova AnnaSevelova changed the title [Playwright] Backport playwright qa structure and introduce E2E testing to the website WIP [Playwright] Backport playwright qa structure and introduce E2E testing to the website Oct 13, 2026
@AnnaSevelova
AnnaSevelova marked this pull request as draft October 13, 2026 14:20
@AnnaSevelova
AnnaSevelova marked this pull request as ready for review October 16, 2026 08:54
@AnnaSevelova AnnaSevelova changed the title WIP [Playwright] Backport playwright qa structure and introduce E2E testing to the website [Playwright] Backport playwright qa structure and introduce E2E testing to the website Oct 16, 2026
@AnnaSevelova AnnaSevelova self-assigned this Oct 16, 2026
@AnnaSevelova
AnnaSevelova merged commit 09b6c6d into staging Oct 19, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 94526c69 Deployed Oct 16, 2026 by vercel[bot]
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.

2 participants