feat: Test priority: "important" notifications in NVDA using Guidepup#7
feat: Test priority: "important" notifications in NVDA using Guidepup#7
priority: "important" notifications in NVDA using Guidepup#7Conversation
… in Windows in Git, GitHub Desktop, Explorer, VS Code, etc.—even so, they won’t work in file:// urls in Edge.
| // - Install the NVDA Remote Access addon (https://nvdaremote.com/download/) | ||
| // - In NVDA Tools > Remote > Options…: | ||
| // - Check "Auto-connect to control server on startup" | ||
| // - Select "Host control server" | ||
| // - Set "Port" to "6837" | ||
| // - Set "Key" to "guidepup" | ||
| // (settings are from https://github.com/guidepup/nvda/blob/main/nvda/userConfig/remote.ini) |
There was a problem hiding this comment.
guidepup/nvda is a portable NVDA install with this add-on preinstalled and preconfigured. guidepup/setup installs that version: https://github.com/guidepup/setup/blob/82179ec8915680344d0db320422dd18e29593eb9/src/windows/installNvda.ts#L11.
However, I wanted to use upstream NVDA and NVDA Remote Access, so I worked out this manual alternative. If you don’t do these steps, Guidepup can open NVDA, but it can’t connect to it (for control and logging).
|
👋 Hello and thanks for pinging us! You've entered our first responder queue. An accessibility first responder will review this soon.
|
| // - In Windows Settings, turn on “Developer Mode” (this allows symbolic links) | ||
| // - In an PowerShell (Administrator session): | ||
| // - Run `mkdir "C:\Program Files (x86)\NVDA\userConfig"` | ||
| // - Run `cmd /c mklink /d "C:\Program Files (x86)\NVDA\userConfig\addons" "%APPDATA%\nvda\addons"` |
There was a problem hiding this comment.
guidepup looks for a cert file at a very specific path: https://github.com/guidepup/guidepup/blob/fadd8faa97222bc716d717063f7cfb9ea541cb83/src/windows/NVDA/NVDAClient.ts#L113-L129.
If you install upstream NVDA and NVDA Remote Access—instead of guidepup/nvda—the cert file won’t be where guidepup expects, and guidepup will throw a misleading “NVDA not installed” error.
These steps create a symbolic link at the necessary path, so guidepup can find the cert file.
| // - In cmd: | ||
| // - Run `REG ADD HKCU\Software\Guidepup\Nvda` | ||
| // - Run `REG ADD HKCU\Software\Guidepup\Nvda /v guidepup_nvda_0.1.1-2021.3.1 /t REG_SZ /d "C:\Program Files (x86)\NVDA\\"` | ||
| // (version is from https://github.com/guidepup/setup/blob/82179ec8915680344d0db320422dd18e29593eb9/package.json#L60C27-L60C41) |
There was a problem hiding this comment.
guidepup checks the Windows Registry to find where NVDA is installed: https://github.com/guidepup/guidepup/blob/fadd8faa97222bc716d717063f7cfb9ea541cb83/src/windows/NVDA/getNVDAInstallationPath.ts#L13, because guidepup/setup writes to a key there: https://github.com/guidepup/setup/blob/82179ec8915680344d0db320422dd18e29593eb9/src/windows/updateNvdaRegistryData.ts#L7-L13.
These steps are a manual alternative to running guidepup/setup.
| import { test, expect } from "@playwright/test"; | ||
| import { nvda, WindowsKeyCodes, WindowsModifiers } from "@guidepup/guidepup"; | ||
|
|
||
| // Pre-requisites: |
There was a problem hiding this comment.
The purpose of these manual “pre-requisites” is twofold:
- To avoid running scripts off the Internet (specifically,
guidepup/setup). - To avoid installing/using a non-official NVDA distribution (specifically,
guidepup/nvda).
| // Assert that the spoken phrases are as expected | ||
| const spokenPhraseLog = JSON.stringify(await nvda.spokenPhraseLog()); | ||
| expect(spokenPhraseLog.includes("Suggestion: acceptable")).toBe(true); | ||
| // expect(spokenPhraseLog.includes("Press right arrow to commit suggestion")).toBe(true); // FIXME: Commenting because this fails, though it _should_ pass. |
There was a problem hiding this comment.
The screen recording attached to this issue body demonstrates that this notification is indeed sent, but for some reason guidepup isn’t retrieving it. I checked both spokenPhraseLog and lastSpokenPhrase.
| registry-url: https://registry.npmjs.org/ | ||
| cache: npm | ||
| - run: npm ci | ||
| - run: npm ci --legacy-peer-deps |
There was a problem hiding this comment.
The latest version of guidepup/playwright has a peer dep on @guidepup/guidepup@0.22.1: https://github.com/guidepup/guidepup-playwright/blob/34c3973dd98e19c81f468352e13bac5b8434b28f/package.json#L59. That version has a transient dependency on ffmpeg-static, which is uninstallable on Windows 64-bit ARM.
The latest version of @guidepup/guidepup (0.24.0) dropped the transient dependency on ffmpeg-static (in guidepup/guidepup#90); using --legacy-peer-deps allows that version to satisfy @guidepup/playwright’s peer deps.
examples/suggested-text/index.html
Outdated
| trieRoot.insert("world"); | ||
| </script> | ||
| <script src="./ariaNotify-polyfill.js"></script> | ||
| <script src="../../ariaNotify-polyfill.js"></script> |
There was a problem hiding this comment.
Even after configuring symlink support in Git, GitHub Desktop, Explorer, VS Code, etc., Edge would not follow symlinks to load JS. So, I’ve removed the symlinks and updated these paths accordingly. We should double-check that this doesn’t break the examples on https://github.github.com/ariaNotify-polyfill/.
There was a problem hiding this comment.
This will break GitHub pages. We should perhaps instead copy the polyfill, or now it's public this can link to the unpkg cdn?
There was a problem hiding this comment.
Darn. Thanks for confirming it’d be a problem!
I found a solution:
- In 11df7c6, I restored the symbolic links. Now GitHub Pages should keep working.
- In 0f87504, I switched to a different approach for loading static files in Playwright tests. Now, instead of using
file://urls, it intercepts requests tohttp://. This makes symbolic links to the script work in Edge.
I tested this solution in both macOS and Windows, and it works in both. I prefer this approach (vs linking to unpkg), since it allows testing a local, unpublished version.
examples/suggested-text/index.html
Outdated
| trieRoot.insert("world"); | ||
| </script> | ||
| <script src="./ariaNotify-polyfill.js"></script> | ||
| <script src="../../ariaNotify-polyfill.js"></script> |
There was a problem hiding this comment.
This will break GitHub pages. We should perhaps instead copy the polyfill, or now it's public this can link to the unpkg cdn?
…does_ work with symbolic links, in Edge. Kudos ruifigueira for the suggestion, in microsoft/playwright#13968 (comment).
Overview
Part of https://github.com/github/core-ux/issues/346 (requires Hubber login).
Fixes https://github.com/github/core-ux/issues/374 (requires Hubber login).
Follow-up to #4, which added a similar test for VoiceOver.
This PR adds a test for
priority: "important"notifications in NVDA. The test is written using Guidepup and Playwright. It can be run withnpm test.Below is a screen recording, with audio, of the test running (and passing). The “Suggested Text” example page is opened, and NVDA is started. The textarea is focused, and “a” is typed. The word “acceptable” is suggested as a completion, and the explanatory message “Press right arrow to commit suggestion” is conveyed too. The test validates the suggestion is conveyed.
Screen.Recording.2024-10-21.at.10.16.39.PM.mov
Next steps
Run tests in CI; this is tracked by https://github.com/github/core-ux/issues/375 (requires Hubber login).