Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-voiceover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-15, macos-15-intel, macos-26, macos-26-intel]
os: [macos-14, macos-15, macos-26]
browser: [chromium, firefox, webkit]
steps:
- uses: actions/checkout@v6
Expand Down
42 changes: 26 additions & 16 deletions src/voiceOverTest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test } from "@playwright/test";
import { voiceOver, macOSActivate } from "@guidepup/guidepup";
import { voiceOver, macOSActivate, MacOSKeyCodes } from "@guidepup/guidepup";
import type { CommandOptions, VoiceOver } from "@guidepup/guidepup";
import { applicationNameMap } from "./applicationNameMap";

Expand Down Expand Up @@ -96,33 +96,36 @@ export const voiceOverTest = test.extend<{
// Ensure application is brought to front and focused.
await macOSActivate(applicationName);

// Cancel auto navigation
await voiceOverPlaywright.perform({ keyCode: MacOSKeyCodes.Control });

// Ensure the document is ready and focused.
await page.bringToFront();
await page.locator("body").waitFor();
await page.locator("body").focus();
await page.locator("body").click();
await page.locator("body").blur();

// Try to navigate into web content.
await voiceOverPlaywright.interact();

// Series of find previous commands to escape accidental interaction
// with sub-content of web content area.
await voiceOverPlaywright.perform(
voiceOverPlaywright.keyboardCommands.findPreviousHeading,
);
await voiceOverPlaywright.perform(
voiceOverPlaywright.keyboardCommands.findPreviousGraphic,
);
// Open the web item rotor defaulting to window spots.
await voiceOverPlaywright.perform(
voiceOverPlaywright.keyboardCommands.findPreviousPlainText,
voiceOverPlaywright.keyboardCommands.openWebItemRotor,
);

// Filter by "content" - currently web content spots for all browsers
// are prefixed by "Content -".
await voiceOverPlaywright.type("content");

// Select the web content window spot.
await voiceOverPlaywright.perform({ keyCode: MacOSKeyCodes.Enter });

// Navigate into web content.
await voiceOverPlaywright.interact();

// Navigate to the beginning of the web content.
await voiceOverPlaywright.perform(
voiceOverPlaywright.keyboardCommands.moveToBeginningOfText,
);

// Cancel auto navigation
await voiceOverPlaywright.perform({ keyCode: MacOSKeyCodes.Control });

if (clearLogs) {
// Clear out logs.
await voiceOverPlaywright.clearItemTextLog();
Expand All @@ -132,6 +135,13 @@ export const voiceOverTest = test.extend<{

await voiceOverPlaywright.start(voiceOverStartOptions);
await macOSActivate(applicationName);

// Cancel auto navigation
await voiceOverPlaywright.perform(
{ keyCode: MacOSKeyCodes.Control },
{ capture: false },
);

await use(voiceOverPlaywright);
} finally {
try {
Expand Down
Loading