Quality Assurance
Executive Summary
Every change to RHEA's shared block library is verified by 204 automated tests, covering all 27 blocks across functionality, accessibility, keyboard operability, visual appearance, security and mobile rendering. The suite runs on every pull request in about 35 seconds and tests the code in the change under review, not the deployed site. Its result is reported for review; making it a merge-blocking check is a deliberate next step (see Scope and limits). Brand sites built from RHEA inherit it and can extend it with their own checks.
What this gives a consuming brand
| Question a brand needs answered | How the suite answers it |
|---|---|
| Will a platform update break a block on my site? | Every block is exercised on every change, and its rendered output compared against a known-good baseline |
| Is the component library accessible? | Each block is scanned against WCAG 2.1 A/AA, and keyboard operation is verified by simulated input rather than inspection |
| Could a styling change silently affect a block nobody edited? | Visual regression compares rendered pixels, so an unintended repaint fails the build |
| Are the XSS protections still in place? | 25 tests pin every content-sanitisation guard individually |
| Does it work on mobile? | The entire block suite runs a second time at a mobile viewport |
The practical effect: a platform change that breaks a block fails before it reaches a brand site, rather than being found in a brand's own QA cycle.
Coverage
| Area | Tests | What is asserted |
|---|---|---|
| Block rendering | 56 | Each of the 27 blocks builds its expected structure, throws no error, logs no console error, and raises no uncaught page error |
| Accessibility | 58 | axe scan of every block; fails on serious or critical WCAG 2.1 A/AA violations |
| Security | 50 | Every HTML-sanitisation sink, including specific attack vectors that were found and closed |
| Interaction | 14 | Blocks are operated, not just rendered: accordions toggle, modals open and close, collapsible text swaps its control |
| Keyboard and focus | 10 | Enter and Space on ARIA buttons, Escape to dismiss, focus containment inside dialogs |
| Visual regression | 5 | Pixel comparison of header, footer, teaser, body text and the above-the-fold layout |
| Live environment | 7 | The published site responds, renders, and exposes its navigation landmarks |
| Configuration | 4 | Guards that no test file is silently excluded from the run, and that the viewport is what it claims |
204 tests total. Coverage is enumerated from the filesystem, so a newly added block is picked up automatically and fails the suite until it is given a real assertion.
How it runs
Two tiers
| Tier | Tests | Target | Why |
|---|---|---|---|
| Block tier | 192 | The source in the change under review, served from an isolated origin | Fails when this change breaks a block. Needs no published content and cannot be disrupted by an unrelated outage |
| Site tier | 12 | A live EDS preview of the branch | Confirms the published pipeline and authored content render correctly — the part that only a real environment can prove |
The block tier is the larger and faster half by design: it makes no network request to a shared host, so it parallelises freely and its results depend on nothing but the code.
Mobile and desktop
The block tier runs twice — once at desktop width and once at 390×844, below the 1024px layout breakpoint. Every functional, accessibility and keyboard assertion is therefore checked at both, with no duplicated test code. A configuration guard asserts each run really is on the side of the breakpoint it claims, so the mobile pass cannot silently degrade into a second desktop run.
Environment synchronisation
Site-tier tests target the branch's own preview. Because AEM indexes a push asynchronously, the suite first confirms the preview is serving the exact commit under test — comparing the files the branch changed, byte for byte, against what the environment returns. A run that started too early would otherwise test the previous commit and pass for the wrong reason.
Visual regression
Its value is mostly in blocks a change did not touch. A change to a design token, a global stylesheet rule, or a shared SCSS mixin can repaint a block nobody edited: the markup is unchanged, so structural and behavioural tests still pass, and only the pixels move.
Baselines are committed per platform and generated on the CI runner, never on a developer machine — font rendering differs enough between operating systems that a locally-produced baseline would not match. Regeneration is a deliberate, manually triggered action rather than something a pull request can do to itself, so a change cannot quietly approve its own new appearance.
A small pixel tolerance is applied. Antialiasing drift is not a regression, and a check that fails on noise is one people learn to ignore.
Design principles
These are the rules the suite is held to, and they are the reason its results are worth acting on.
A test must be able to fail. Every assertion is validated by deliberately breaking the thing it covers and confirming the test goes red. Coverage that cannot fail is worse than no coverage, because it reads as assurance.
Test the change, not the environment. Block-tier tests load the source under review. A suite pointed at a deployed site reports on that site's health, which is a different question from whether the change is safe.
Prefer offline. 192 of 204 tests need no network. They are fast, deterministic, and unaffected by rate limits or an environment being briefly unavailable — so a red result means something is broken, not that something was busy.
Document the exceptions. Some blocks cannot reach a meaningful state in isolation, and each is exempted in writing rather than given a test that passes without exercising anything. There are two such lists, for two different reasons:
| Exempt from | Blocks | Why |
|---|---|---|
| Structural assertions | cta-group, header, recaptcha | cta-group has no rows of its own and groups sibling CTAs; header fetches its navigation fragment; recaptcha renders via an external provider script |
| Interaction testing | tab-panel, isi, pagination | Each needs something the block alone does not have: a parent tab section, an authored fragment, or a content index |
All six are still covered for errors — they must decorate without throwing, logging a console error, or raising an uncaught page error. The suite caps how many structural exemptions may exist, so the list cannot quietly grow.
Scope and limits
Stated plainly, because knowing what is not covered is part of trusting what is.
- Not every variant. The suite asserts each block renders, behaves and looks correct in a representative configuration. It does not enumerate every combination of authored fields.
- One browser engine. Chromium. WebKit and Firefox are configured but not enabled.
- Dark theme is untested. The theme exists and is documented; it has no automated coverage yet.
- Performance is measured separately. Lighthouse and Core Web Vitals are tracked by a separate check, not by this suite.
- Reports, does not yet block. The suite runs on every pull request and its result is visible, but it is not currently a required check. Making it blocking is a deliberate next step, taken once its behaviour is settled across the estate.
For brand repositories
Brands inheriting RHEA get the whole suite with no configuration:
- Inherit unchanged — the configuration, the block tier, the shared harness and the workflow all arrive with the periodic sync.
- Point the site tier at your environment — one variable. The block tier needs no change, because it tests source and is brand-agnostic.
- Add brand tests under tests/brand/. They are collected automatically; a configuration guard fails the suite if they ever stop being.
What belongs to a brand: journeys tied to brand content, brand-specific regulatory copy, locale routing, gated content. What stays with the platform: block rendering, accessibility, behaviour and appearance for anything in the shared library.
Reference
| Detail | Value |
|---|---|
| Framework | Playwright |
| Tests | 204 |
| Runtime | ~35 seconds |
| Triggers | Pull requests into develop, stage, main; pushes to those branches; manual dispatch |
| Location in repo | tests/, playwright.config.js, .github/workflows/playwright.yml |
| Run locally | npm run test:e2e — or npx playwright test --project=blocks for the offline tier only |