Skip to content

Commit 841cfda

Browse files
committed
fix: update to keyboard commands interface
1 parent b60d3b3 commit 841cfda

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ npm run test
1212
1313
## Test flow
1414

15-
1. The test launches Safari using Playwright
15+
1. The test launches the browser using Playwright
1616
2. Navigates to the GitHub website
1717
3. Moves through the website using VoiceOver controlled by Guidepup
1818
4. Traverses headings until the Guidepup heading in the README.md is found

example/tests/headerNavigation.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { expect } from "@playwright/test";
1+
import type { VoiceOver } from "@guidepup/guidepup";
2+
import { expect, Page } from "@playwright/test";
23

34
async function delay(ms: number) {
45
return new Promise(resolve => setTimeout(resolve, ms));
56
}
67

7-
export async function headerNavigation({ page, voiceOver }) {
8+
export async function headerNavigation({ page, voiceOver }: { page: Page, voiceOver: VoiceOver}) {
89
// Navigate to Guidepup GitHub page 🎉
910
await page.goto("https://github.com/guidepup/guidepup", {
1011
waitUntil: "domcontentloaded",
@@ -18,6 +19,6 @@ export async function headerNavigation({ page, voiceOver }) {
1819

1920
// Move across the page menu to the Guidepup heading using VoiceOver 🔎
2021
while ((await voiceOver.itemText()) !== "Guidepup heading level 1") {
21-
await voiceOver.perform(voiceOver.keyboard.commands.findNextHeading);
22+
await voiceOver.perform(voiceOver.keyboardCommands.findNextHeading);
2223
}
2324
}

src/voTest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { test } from "@playwright/test";
22
import { voiceOver, macOSActivate } from "@guidepup/guidepup";
3+
import type { VoiceOver } from "@guidepup/guidepup";
34

45
const applicationNameMap = {
56
chromium: "Chromium",
@@ -18,7 +19,7 @@ const applicationNameMap = {
1819
*
1920
* A fresh started VoiceOver instance `vo` is provided to each test.
2021
*/
21-
const voTest = test.extend<{ voiceOver: typeof voiceOver }>({
22+
const voTest = test.extend<{ voiceOver: VoiceOver }>({
2223
voiceOver: async ({ browserName }, use) => {
2324
try {
2425
await voiceOver.start();

0 commit comments

Comments
 (0)