Getting Started
Guidepup is a screen reader driver for test automation.
It aims to provide a reliable set of APIs to automate your screen reader a11y workflows through JavaScript. Specifically to accommodate the needs of a11y testing and alleviate the overhead of manual testing with real screen readers.
Contents
Environment Setup
Setup your environment for screen reader automation with @guidepup/setup
:
npx @guidepup/setup
For some operating systems, enabling automation of screen readers is tightly controlled. This CLI handles the setup for your OS.
For further information checkout this guide to set up your environment.
Installation
Install Guidepup to your project:
yarn add @guidepup/guidepup
- Yarn
- NPM
yarn add @guidepup/guidepup
npm install @guidepup/guidepup
First Screen Reader Code
Let's automate a screen reader!
Create example.js
(or example.ts
for TypeScript) to define your screen reader code.
- Typescript
- JavaScript
If you're using MacOS:
import { voiceOver } from "@guidepup/guidepup";
(async () => {
// Start VoiceOver.
await voiceOver.start();
// Move to the next item.
await voiceOver.next();
// Stop VoiceOver.
await voiceOver.stop();
})();
Or if you're using Windows:
import { nvda } from "@guidepup/guidepup";
(async () => {
// Start NVDA.
await nvda.start();
// Move to the next item.
await nvda.next();
// Stop NVDA.
await nvda.stop();
})();
If you're using MacOS:
const { voiceOver } = require("@guidepup/guidepup");
(async () => {
// Start VoiceOver.
await voiceOver.start();
// Move to the next item.
await voiceOver.next();
// Stop VoiceOver.
await voiceOver.stop();
})();
Or if you're using Windows:
const { nvda } = require("@guidepup/guidepup");
(async () => {
// Start NVDA.
await nvda.start();
// Move to the next item.
await nvda.next();
// Stop NVDA.
await nvda.stop();
})();
Now run your code to see an automated screen reader!
- TypeScript
- JavaScript
npx ts-node example.ts
node example.js