Many people use a website without a mouse: with the keyboard, a switch, or a screen reader that moves through the page the way the Tab key does. A shop can pass every automated check and still be impossible to buy from for them, because the size picker opens only on mouse hover or the cart drawer never gets the keyboard focus. A keyboard run answers the question a checker cannot: can a keyboard user get from the home page to checkout? The examples use the made-up site example.com, and the values in them are invented to show the shape of an answer.

What a keyboard run is

A keyboard run takes a journey you already have, the same script your agent wrote for load tests or accessibility checks, and does it again with the keyboard only. Where the script clicks, the browser presses Tab (or Shift+Tab) until the focus is on that element, then Enter or Space. Where it fills a field, it tabs there and types. Where it picks an option, it uses the arrow keys. The page is also checked after each step, as in any journey check.

For each step it reports one of these:

  • works: a keyboard user can do it.
  • harder: it can be done, but it takes more than 50 key presses, the focus is lost (it jumps back to the top of the page), or something opens, such as a cart drawer, and the focus does not go into it.
  • blocked: a keyboard user cannot do it. The focus never reaches the element, it opens only when the mouse is over it, or Enter and Space do nothing where a click works.
  • unknown: the step fails with the mouse too, so the run cannot tell. Fix the journey and run it again.
  • skipped: the script went to an address directly in the middle of the journey, so what a keyboard user would have had to do to get there was not tried.

After a blocked step the mouse does that step, and the run goes on with the keyboard. So one problem early in the journey does not hide the ones after it.

How Supervisor moves like a keyboard user

The run moves the way a person who knows the keyboard would.

  • It takes the skip link (“Skip to content”) when the element it is going to is in the part the link skips to.
  • It uses Shift+Tab when the element is behind the focus.
  • It opens a closed menu or a “More” section with Enter when the element is inside it, as a person looks through the menus.
  • In a list, a menu or a set of tabs it uses the arrow keys.
  • On a native select it moves to the option with the arrow keys.

The number of presses it reports is the presses on this route.

The keys are real key presses in a real browser (Chromium), so the page’s own keyboard handling takes part, the same as when a person presses them.

Start a keyboard run

Your agent starts one with start_accessibility_check, giving journey_id and keyboard: true. A keyboard run is on desktop only.

“Can a keyboard user get to checkout on example.com? Use the checkout journey.”

{
  "run_id": "99999999-aaaa-4bbb-8ccc-dddddddddddd",
  "domain": "example.com",
  "status": "running",
  "settings": { "journey": "home to checkout", "journey_version": 3, "devices": ["desktop"], "keyboard": true },
  "included_keyboard_runs_left_this_month": 0,
  "next": "One browser runs the journey \"home to checkout\" once with the keyboard only (Tab, Enter, Space, arrow keys) and checks the page after each step on desktop. get_accessibility_check shows progress and results."
}

Before it starts: the journey’s last dry run of the same version must have passed in the last 7 days. That shows the journey itself works with the mouse, so a broken script is never reported as a keyboard problem. If there is no such dry run, the agent runs dry_run_journey first.

Read the result

get_accessibility_check has a keyboard part with the result of the whole journey (the worst step), one sentence that says it in plain words, and each step.

“What did the keyboard run find?”

{
  "keyboard": {
    "verdict": "blocked",
    "summary": "A keyboard user could not do \"Choose size\" (it opens only for the mouse). The mouse did that step, and the rest of the journey was tried with the keyboard again.",
    "presses": 74,
    "steps": [
      { "name": "Accept cookies", "ok": true, "status": "harder", "reason": "many_presses", "presses": 61 },
      { "name": "Open product", "ok": true, "status": "works", "presses": 4 },
      { "name": "Choose size", "ok": true, "status": "blocked", "reason": "hover_only", "presses": 0 },
      { "name": "Add to cart", "ok": true, "status": "harder", "presses": 3 },
      { "name": "Go to checkout", "ok": true, "status": "works", "presses": 6 }
    ]
  }
}

In this example a keyboard user has to press Tab 61 times to accept the cookie banner, because it is at the end of the page. They cannot choose a size at all. And when they add to cart, the cart opens but the focus stays behind it.

Where the findings go

Each blocked step becomes an issue in the site’s issue list, with the step’s name as its state and WCAG 2.1.1 (keyboard) as its criterion. The rule ids start with kb::

  • kb:unreachable: the focus never gets there.
  • kb:hover-only: it opens only when the mouse is over it.
  • kb:keys-do-nothing: Enter or Space (or the arrow keys) do nothing where a click works.
  • kb:needs-mouse: the step can only be done by dragging or pointing.

They wait for a person as “needs review” before they count in the accessibility statement. Only another keyboard run closes them: an ordinary check of the same journey does not use the keyboard, so not finding them there says nothing. When the step works in a later keyboard run, the issue is marked fixed.

Harder steps are not issues. They are in the result for you and your agent to fix.

Write journeys that work for keyboard runs

A keyboard run reads what the script asks for and does it with the keyboard. A script that says which element to use, rather than where to click, works best.

  • Use role and label locators: page.getByRole('button', { name: 'Add to cart' }), page.getByLabel('Email'). They name the element the way a person sees it, and the keyboard run can find it in the Tab order.
  • Don’t use page.mouse or dragTo. A step that uses the mouse is reported as blocked, because a keyboard user cannot do it.
  • Go to an address only at the start. A page.goto in the middle of the journey is reported as skipped: it jumps over what a keyboard user would have to do to get there.
  • Keep the clicks a person makes. If the size list opens with a click on “Choose size”, keep that click in the script: then the run tests whether “Choose size” works with the keyboard.
  • Name steps after what the person does: “Choose size”, “Add to cart”, “Go to checkout”. The names become the issues’ states and the lines of the result.
  • Clicks from page JavaScript are not tested. page.evaluate(() => button.click()) runs as it is.

Example

“Write a journey from the home page to checkout that also works for a keyboard run.”

export default async ({ page, step, base }) => {
  await step('Open home page', async () => {
    await page.goto(base + '/');
  });
  await step('Accept cookies', async () => {
    await page.getByRole('button', { name: 'Accept all' }).click();
  });
  await step('Open product', async () => {
    await page.getByRole('link', { name: 'Running shoe' }).click();
    await page.waitForLoadState('load');
  });
  await step('Choose size', async () => {
    await page.getByRole('button', { name: 'Choose size' }).click();
    await page.getByRole('option', { name: '42' }).click();
  });
  await step('Add to cart', async () => {
    await page.getByRole('button', { name: 'Add to cart' }).click();
  });
  await step('Go to checkout', async () => {
    await page.getByRole('link', { name: 'Checkout' }).click();
    await page.waitForLoadState('load');
  });
};

The journey stops at the checkout page. A keyboard run does only what the script does, so a journey that stops before payment never pays for anything.

Good practice

  • Start with the journeys that matter most: to the cart and checkout, sign-in, the contact or booking form. A blocked step there means some people cannot buy or contact you at all.
  • Fix blocked steps first, then harder ones. A blocked step stops a person. A harder one wears them out.
  • Look at the first few presses. If accepting cookies takes dozens of presses, the banner is late in the page. Putting it first in the page’s code, or moving the focus to it when it opens, helps every keyboard user on every page.
  • Use native elements where you can. A <button> or a <select> works with the keyboard on its own. A <div> that only listens for clicks does not.
  • Move the focus into what opens. A cart drawer, a dialog or a menu that opens should take the focus, and Escape should close it and bring the focus back.
  • Run it again after a fix. The issue is marked fixed only when a keyboard run sees the step work.

What it costs

A keyboard run costs 1 credit for each journey. Supervisor Accessibility Compliance includes one keyboard run a month for each site. The dry run it needs first is free. Pricing has the details.

Limits

  • A keyboard run is not an audit and does not show that a site meets the requirements. It finds the places where a keyboard user is stopped or slowed down on the journeys you give it.
  • It runs on desktop, in Chromium.
  • It does what the journey does. Pages and steps the journey does not include are not tried. A crawl’s own keyboard checks, the Tab walk, cover the pages one at a time.
  • Elements inside a frame from another site, such as a payment or CAPTCHA frame, may be reported as unknown.
  • It cannot tell whether the order of the focus makes sense to a person, or whether the focus can always be seen clearly. A person still needs to try the site with a keyboard.