diff --git a/.github/workflows/test-voiceover.yml b/.github/workflows/test-voiceover.yml index 9f5a5a7..fff8990 100644 --- a/.github/workflows/test-voiceover.yml +++ b/.github/workflows/test-voiceover.yml @@ -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 diff --git a/src/voiceOverTest.ts b/src/voiceOverTest.ts index dbee32b..9ba9b3d 100644 --- a/src/voiceOverTest.ts +++ b/src/voiceOverTest.ts @@ -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"; @@ -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(); @@ -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 {