diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b7085d..fc6b4f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,8 +8,8 @@ permissions: contents: read jobs: - test: - name: Test + web-test-runner: + name: Web Test Runner runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -35,3 +35,17 @@ jobs: - run: npm ci - uses: guidepup/setup-action@eefb29916eda6dfda810adc0ac72faea006dbba6 - run: npm run test:guidepup + guidepup-windows: + name: Guidepup (Windows) + runs-on: windows-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: 24 + registry-url: https://registry.npmjs.org/ + cache: npm + - run: npm install -g npm@^11.0.0 + - run: npm ci + - uses: guidepup/setup-action@eefb29916eda6dfda810adc0ac72faea006dbba6 + - run: npm run test:guidepup diff --git a/package.json b/package.json index 769d7af..97d98cd 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "files": [], "scripts": { "test": "npx playwright install firefox && web-test-runner", - "test:guidepup": "npx playwright test" + "test:guidepup": "npx playwright install firefox && npx playwright test" }, "devDependencies": { "@esm-bundle/chai": "^4.3.4-fix.0", diff --git a/playwright.config.mjs b/playwright.config.mjs index 283d636..506e134 100644 --- a/playwright.config.mjs +++ b/playwright.config.mjs @@ -9,11 +9,8 @@ const config = { retries: 0, projects: [ { - name: "Microsoft Edge", - use: { - ...devices["Desktop Edge"], - channel: "msedge", - }, + name: 'firefox', // Use Firefox because Firefox doesn’t have a native implementation of 'ariaNotify' (as of 2026-01-15), so we can test the polyfill in it. + use: devices['Desktop Firefox'], }, ], quiet: false, diff --git a/tests/guidepup/nvda.spec.mjs b/tests/guidepup/nvda.spec.mjs index aa0b051..f5b7954 100644 --- a/tests/guidepup/nvda.spec.mjs +++ b/tests/guidepup/nvda.spec.mjs @@ -29,7 +29,7 @@ const test = baseTest.extend({ route.fulfill({ path: path.join( import.meta.dirname, - "..", + "../..", new URL(request.url()).pathname ), }) @@ -84,6 +84,13 @@ if (process.platform === "win32") { }); test("SuggestedText", async ({ page }) => { + // Wait for page to load + await page.waitForTimeout(500); + + // Focus the textarea and wait for NVDA virtual cursor to move there + await page.getByRole("textbox", { name: "Add a comment" }).click(); + await page.waitForTimeout(500); + // Type a completable string in the textarea await nvda.type("a"); diff --git a/tests/guidepup/voiceover.spec.mjs b/tests/guidepup/voiceover.spec.mjs index dedc460..854181b 100644 --- a/tests/guidepup/voiceover.spec.mjs +++ b/tests/guidepup/voiceover.spec.mjs @@ -13,7 +13,7 @@ const test = baseTest.extend({ route.fulfill({ path: path.join( import.meta.dirname, - "..", + "../..", new URL(request.url()).pathname ), }) @@ -44,10 +44,6 @@ if (process.platform === "darwin") { await page.locator("body").waitFor(); await page.locator("body").focus(); - // Navigate to the beginning of the web content. - await voiceOver.interact(); - await voiceOver.perform(voiceOver.keyboardCommands.jumpToLeftEdge); - // Clear out logs. await voiceOver.clearItemTextLog(); await voiceOver.clearSpokenPhraseLog(); @@ -59,6 +55,13 @@ if (process.platform === "darwin") { }); test("SuggestedText", async ({ page }) => { + // Wait for page to load + await page.waitForTimeout(500); + + // Focus the textarea and wait for VoiceOver cursor to move there + await page.getByRole("textbox", { name: "Add a comment" }).click(); + await page.waitForTimeout(500); + // Type a completable string in the textarea await voiceOver.type("a");