A passing component test establishes what worked under the conditions it tested. It does not establish that the same control remains usable inside every page layout.
Consider a notification settings page. Its “Save preferences” control is a native button with a clear name, working keyboard activation, and a visible focus outline. After a shared layout update, a persistent help-and-status strip covers the button at a short, narrow viewport. Tab still reaches Save. Enter can still submit. But the person using the keyboard cannot see where focus has gone.
The button’s tested behavior has survived. The surrounding layout has broken part of the task. The useful question is not which green check was wrong, but what each check could observe—and where to put a check that can detect this particular regression.
This article follows a hypothetical, reproducible test case, not an observed incident. The viewport sizes and browser configuration below are proposed test conditions; no browser execution or measured results are being reported.
What the passing checks establish
The settings form contains an email-notification checkbox and a Save button:
<button type="submit">Save preferences</button>
A markup check accepts the button’s structure. An isolated component test finds its button role and accessible name, moves focus to it, and verifies that pressing Enter invokes its action. A separate style check may confirm that the component defines a focus indicator.
These are useful findings. None requires the test to load the page’s persistent strip.
| Check | Evidence it provides | What remains outside its scope |
|---|---|---|
| Markup linting | The checked markup satisfies the configured structural rules. | Whether another element covers the rendered button. |
| Isolated component test | The button has the expected role and name, receives focus, and responds to Enter in its fixture. | Interaction with a persistent strip absent from that fixture. |
| Composed-page browser regression | The keyboard route reaches Save without the specified strip overlapping it at the tested viewport. | Every other overlay, viewport, browser, or accessibility condition. |
| Human keyboard walkthrough | A reviewer can assess focus visibility, orientation, and understandable confirmation in the tested task. | Universal usability or complete accessibility conformance. |
The isolated test did not overlook an element it was examining. It never contained the relationship that failed. This is the distinction between component accessibility and accessibility in a composed interface.
Keep the fast checks. Add evidence at the level where the new behavior appears.
Reproduce the keyboard task
The task begins when someone opens notification settings and ends when they can recognize that their changed preference was saved. Stopping when the button’s handler runs would leave out both the obscured focus target and the confirmation.
Define a stable test fixture
Use a dedicated page containing the real settings layout, rather than the isolated button demonstration. For a small, deterministic fixture, document these conditions:
- Browser: Playwright’s bundled Chromium, with the Playwright package and browser revision pinned in the project.
- Narrow viewport: 390 × 600 CSS pixels, without mobile-device emulation.
- Comparison viewport: 1280 × 900 CSS pixels.
- Initial state: Email notifications are unchecked; no control receives focus automatically.
- Tab order: The email checkbox is the first tab stop and Save preferences is the second.
- Strip state: The help-and-status strip is present, expanded, opaque, and not dismissible for this test.
- Save behavior: A controlled test endpoint records the preference and returns success before the page displays confirmation.
These dimensions are starting conditions, not proof of overlap. Inspect the rendered page to establish whether the strip actually covers the entire button at the narrow size. A different font, strip height, or content length can change the geometry.
Follow the ordinary keyboard route
- Load the page from its initial state.
- Press Tab to reach the email preference.
- Press Space to change it.
- Press Tab to reach Save preferences.
- Observe the focus indicator and the button’s position relative to the strip.
- Press Enter and inspect the resulting confirmation.
Do not begin by clicking Save or calling its focus method. Those shortcuts bypass the route being investigated.
At the failure point, browser inspection can identify document.activeElement. If that element is Save while an opaque strip covers its complete rendered area, the evidence distinguishes keyboard reachability from visual availability: focus arrived, but the person cannot see the focused control.
Repeat the route at the larger viewport. If Save remains unobscured there, record that result too. It would explain how a desktop-sized review could miss the regression without implying that the narrow layout had ever been checked.
If screenshots are captured, take the before-and-after images at the same viewport, with the same strip state and Save focused in both. A static screenshot alone cannot establish which element holds focus; preserve that fact in the test record and caption.
Fix the layout that creates the overlap
The button does not need another role, a positive tabindex, or a replacement keyboard handler. None would remove the strip covering it.
The correction belongs where the page creates the overlap.
First consider returning the strip to document flow
If persistent positioning is not necessary at short viewport heights, a straightforward candidate is to let the strip follow the settings content in normal flow:
/* Candidate adjustment; verify against the actual layout. */
@media (max-height: 650px) {
.help-status-strip {
position: static;
inset: auto;
}
}
This assumes the strip’s DOM position is sensible after the form and that no other positioning or sizing rule continues to create interference. The breakpoint is a local design choice, not an accessibility threshold.
Moving the strip into flow lets it occupy space instead of painting over the form. It may also reduce the need to synchronize reserved space with a strip whose height changes as text wraps.
In both views, pressing Tab moved focus to Save. In the before view, the fixed strip covers the button and its outline. In the after view, the strip follows the settings in normal flow, leaving Save and its focus outline visible. This is an illustration of the proposed fixture.
If the strip must remain fixed, account for its occupied space
A fixed strip does not reserve room in normal document flow. The scrolling content may need sufficient end spacing to move Save above it. Scroll padding on the actual scrolling container can also help keep targets away from the covered region during scrolling operations.
These are related but different responsibilities: reserved space provides room to scroll; scroll padding describes a preferred unobscured viewing area. Neither should be treated as a guarantee without testing the resulting keyboard behavior.
Check which element actually scrolls. Styling the document will not necessarily solve an overlap inside a separately scrolling settings panel. Account for the strip’s rendered height, including wrapping and text resizing, rather than assuming it stays at a convenient fixed value.
After either correction, repeat the original route. Save should receive focus, remain identifiable with its focus cue, and produce visible confirmation after the save succeeds. Also inspect any new blank space, nested scrolling, or content displacement introduced by the fix.
Add a regression check that can catch it
The next release needs a check containing the page relationship that failed: the focused Save button and the persistent strip at the narrow viewport.
A plain visibility assertion is insufficient. In common browser-testing tools, an element can count as visible because it has a rendered box and is not hidden by its own styles, even when another element covers it. Check the specific obstruction separately.
The following Playwright example assumes the fixture contract described above. Its route and test ID are illustrative. Adapt them to the project; the example has not been executed here.
import { test, expect } from '@playwright/test';
for (const viewport of [
{ width: 390, height: 600 },
{ width: 1280, height: 900 }
]) {
test(`keyboard save at ${viewport.width}x${viewport.height}`,
async ({ page }) => {
await page.setViewportSize(viewport);
await page.goto('/test-fixtures/notification-settings');
const preference = page.getByRole('checkbox', {
name: 'Email notifications',
exact: true
});
const save = page.getByRole('button', {
name: 'Save preferences',
exact: true
});
const strip = page.getByTestId('help-status-strip');
await expect(strip).toBeVisible();
await expect(preference).not.toBeChecked();
await page.keyboard.press('Tab');
await expect(preference).toBeFocused();
await page.keyboard.press('Space');
await expect(preference).toBeChecked();
await page.keyboard.press('Tab');
await expect(save).toBeFocused();
await expect(save).toBeVisible();
// Recheck geometry while any focus-triggered scrolling settles.
await expect.poll(async () => {
return save.evaluate((button) => {
const strip = document.querySelector(
'[data-testid="help-status-strip"]'
);
if (!strip) return false;
const b = button.getBoundingClientRect();
const s = strip.getBoundingClientRect();
const fullyInViewport =
b.width > 0 && b.height > 0 &&
b.left >= 0 && b.top >= 0 &&
b.right <= window.innerWidth &&
b.bottom <= window.innerHeight;
const overlapsStrip =
b.left < s.right && b.right > s.left &&
b.top < s.bottom && b.bottom > s.top;
return document.activeElement === button &&
fullyInViewport && !overlapsStrip;
});
}).toBe(true);
await page.keyboard.press('Enter');
// The fixture exposes this only after its save succeeds.
const result = page.getByRole('status');
await expect(result).toHaveText('Preferences saved.');
await expect(result).toBeInViewport();
});
}
The rectangle comparison is deliberately specific. For this opaque, rectangular strip, it rejects overlap with the button rather than trying to infer every possible cause of obscuration. It does not detect all clipping, stacking, or overlay problems elsewhere on the page. Its button bounds also do not include a focus outline extending beyond the button’s box.
The confirmation assertion establishes that the expected message appears in the viewport. It does not independently prove that another element cannot cover that message or that its wording is understandable. Those remain review questions; a known confirmation-overlap risk could justify another targeted assertion.
Prove that the regression check is sensitive to the defect
Before relying on this test, run it against the old layout and the proposed correction. For the reproduced defect, the old layout should fail at the overlap check while still reaching Save. The corrected layout should pass the same route without weakening the assertion.
If both versions pass, investigate the fixture, viewport, strip state, or measurement. If both fail, investigate the correction or test assumptions. Until those runs occur, this is a proposed regression check—not demonstrated protection.
Keep the human walkthrough
The browser regression can preserve a measurable layout condition. A person still needs to assess whether the task makes sense.
Repeat the keyboard walkthrough in the rendered page at the recorded sizes. Ask:
- Can I follow focus from the preference to Save without guessing?
- Can I distinguish the focus indicator from the button’s ordinary appearance?
- Does the strip leave enough room to understand the current action?
- After activation, is the confirmation visible and clear about what was saved?
- Does focus remain somewhere useful after completion?
Record the browser version, viewport, strip state, build, route, and outcome. Note any manual scrolling or workaround needed to continue rather than silently treating it as normal task behavior.
A visual keyboard walkthrough does not establish screen-reader behavior. If the save confirmation is intended to be announced through a status region, test that behavior with the relevant browser and assistive technology combinations as well.
The responsibilities can remain small and concrete. The component owner preserves the button’s native behavior. The layout owner corrects the overlap. The release reviewer checks that the regression test and walkthrough address the original failure. This is accessibility engineering at a proportionate scale: preserving an important behavior as the website changes.
State the result within its evidence boundary
WCAG 2.2 Success Criterion 2.4.11, Focus Not Obscured (Minimum), at Level AA, addresses a component receiving keyboard focus being entirely hidden by author-created content. A persistent page strip completely covering the focused Save button is the kind of condition this requirement addresses.
The proposed regression assertion is stricter in one respect: it rejects any overlap between this strip and the button. That is a useful local guard for this layout, not the wording of the minimum criterion. Passing it does not establish that the whole page conforms to WCAG.
After actual verification, a useful result would name the conditions: the tested browser, viewport, strip state, keyboard route, lack of overlap, and observed save confirmation. It should not expand into “the settings page is accessible” on the strength of this one task.
The component checks remain valuable because they protect the button’s behavior. The composed-page regression adds the relationship they could not observe. The human walkthrough assesses whether the person can find the action and recognize its outcome.
Put the next check where the failure became possible. In this example, that place is not inside the Save button. It is where the button, scrolling page, and persistent strip meet.