Skip to content

Commit e3b9c7d

Browse files
authored
Update README.md
1 parent 7c3ac63 commit e3b9c7d

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ Check out the configuration this adds [in the `config.ts` file](./src/config.ts)
7373

7474
### Web Content Navigation
7575

76-
In addition to the Guidepup APIs the `voiceOver` and `nvda` instances provided by the Guidepup Playwright setup have an additional utility method `.navigateToWebContent()`.
76+
In addition to the Guidepup APIs the `screenReader`, `voiceOver`, and `nvda` instances provided by the Guidepup Playwright setup have an additional utility method `.navigateToWebContent()`.
7777

7878
This method will navigate the screen reader to the first element of the document body in the browser.
7979

80-
Use this method after you navigate to a page and have made any necessary checks that the page has loaded as expected. For example, this is how you might use the method with NVDA:
80+
Use this method after you navigate to a page and have made any necessary checks that the page has loaded as expected. For example, this is how you might use the method:
8181

8282
```ts
8383
// Navigate to the desired page
@@ -89,7 +89,7 @@ await page.goto("https://github.com/guidepup/guidepup", {
8989
await page.locator('header[role="banner"]').waitFor();
9090
9191
// Navigate to the web content
92-
await nvda.navigateToWebContent();
92+
await screenReader.navigateToWebContent();
9393
9494
// ... some commands
9595
```
@@ -100,15 +100,15 @@ await nvda.navigateToWebContent();
100100
// ... some commands
101101
102102
// Store spoken phrases
103-
const spokenPhrases = await nvda.spokenPhraseLog();
103+
const spokenPhrases = await screenReader.spokenPhraseLog();
104104
105105
// Navigate to the web content
106-
await nvda.navigateToWebContent();
106+
await screenReader.navigateToWebContent();
107107
108108
// ... some commands
109109
110110
// Collect all spoken phrases
111-
const allSpokenPhrases = [...spokenPhrases, ...(await nvda.spokenPhraseLog())];
111+
const allSpokenPhrases = [...spokenPhrases, ...(await screenReader.spokenPhraseLog())];
112112
113113
// ... do something with spoken phrases
114114
```
@@ -119,14 +119,22 @@ or pass a flag to prevent log clearing:
119119
// ... some commands
120120
121121
// Navigate to the web content
122-
await nvda.navigateToWebContent(false);
122+
await screenReader.navigateToWebContent(false);
123123
124124
// ... some commands
125125
```
126126

127127
### Providing Screen Reader Start Options
128128

129-
The options provided to `nvda.start([options])` or `voiceOver.start([options])` can be configured using `test.use(config)` as follows:
129+
The options provided to `screenReader.start([options])`, `nvda.start([options])`, or `voiceOver.start([options])` can be configured using `test.use(config)` as follows:
130+
131+
```ts
132+
// Screen Reader Example
133+
import { screenReaderTest as test } from "@guidepup/playwright";
134+
135+
// Capture all spoken phrases, including usage hints
136+
test.use({ screenReaderStartOptions: { capture: true } });
137+
```
130138

131139
```ts
132140
// VoiceOver Example

0 commit comments

Comments
 (0)