Skip to content

Instantly share code, notes, and snippets.

@adamliptrot-oc
Created July 29, 2024 08:48
Show Gist options
  • Select an option

  • Save adamliptrot-oc/ce9a4e60d4a8984fc0de4aba90dc62af to your computer and use it in GitHub Desktop.

Select an option

Save adamliptrot-oc/ce9a4e60d4a8984fc0de4aba90dc62af to your computer and use it in GitHub Desktop.
Automating screenreaders with Guidepup and Playwright
test("I can navigate the tables page", async ({ page, voiceOver }) => {
await page.goto("http://liptrot.org/guides/vo-macos/tables/", {
waitUntil: "domcontentloaded",
});
const header = await page.locator('header');
await expect(header).toBeVisible();
await voiceOver.interact();
await voiceOver.perform(voiceOver.keyboardCommands.findNextTable);
await delay(1000);
await voiceOver.perform(voiceOver.keyboardCommands.findNextTable);
const tableAnnouncement = await voiceOver.lastSpokenPhrase();
expect(tableAnnouncement).toContain('Dates and amounts')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment