Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add placeholder support for new at additionalSettings #73

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions src/data/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* @property {string} commands[].keypresses[].keystroke single human-readable key or key chord press
* @property {string} [commands[].extraInstruction] human-readable additional instruction to follow
* @property {string} [commands[].settings] this property only exists on v2 tests
* @property {string[]} [commands[].additionalSettings] this property only exists on v2 tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change isn't present in Howard's patch. Since the file needs to match the corresponding file in the aria-at repository, we'll need to resolve the discrepancy before merging.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, i noticed that too! i have a PR open to Howard's patch here: w3c/aria-at#1128

* @property {object[]} assertions[]
* @property {1 | 2} assertions[].priority
* @property {string} [assertions[].expectation] assertion statement string, this property only exists on v1 tests
Expand Down
19 changes: 16 additions & 3 deletions src/runner/driver-test-runner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { startJob } from '../shared/job.js';

import { ATDriver, ATKey, webDriverCodePoints } from './at-driver.js';

Check warning on line 3 in src/runner/driver-test-runner.js

View workflow job for this annotation

GitHub Actions / test (18.x, ubuntu-latest)

'ATDriver' is defined but never used

Check warning on line 3 in src/runner/driver-test-runner.js

View workflow job for this annotation

GitHub Actions / test (18.x, windows-latest)

'ATDriver' is defined but never used

Check warning on line 3 in src/runner/driver-test-runner.js

View workflow job for this annotation

GitHub Actions / test (20.x, ubuntu-latest)

'ATDriver' is defined but never used

Check warning on line 3 in src/runner/driver-test-runner.js

View workflow job for this annotation

GitHub Actions / test (20.x, windows-latest)

'ATDriver' is defined but never used
import { RunnerMessage } from './messages.js';

/**
Expand Down Expand Up @@ -92,8 +92,9 @@
*
* @param {string} settings - "browseMode" "focusMode" for NVDA, "pcCursor" "virtualCursor"
* for JAWS., "defaultMode" for others.
* @param {string[]} additionalSettings - e.g. "speechRateIncrease" and "commentAnnouncementOn" for JAWS
*/
async ensureSettings(settings) {
async ensureSettings(settings, additionalSettings) {
const { atName } = await this.collectedCapabilities;
if (atName == 'NVDA') {
const desiredResponse = { browsemode: 'Browse mode', focusmode: 'Focus mode' }[
Expand Down Expand Up @@ -123,6 +124,12 @@
},
});
}
for (const additionalSetting of additionalSettings) {
switch (additionalSetting) {
default:
throw new Error(`Unrecognized addditional setting for NVDA: ${additionalSetting}`);
}
}
} else if (atName == 'VoiceOver') {
if (settings === 'quickNavOn' || settings === 'arrowQuickKeyNavOn') {
await this.pressKeysToToggleSetting(
Expand All @@ -147,6 +154,12 @@
} else if (settings !== 'defaultMode') {
throw new Error(`Unrecognized setting for VoiceOver: ${settings}`);
}
for (const additionalSetting of additionalSettings) {
switch (additionalSetting) {
default:
throw new Error(`Unrecognized addditional setting for VoiceOver: ${additionalSetting}`);
}
}
return;
} else if (!atName) {
return;
Expand All @@ -162,7 +175,7 @@
async ensureMode(mode) {
const { atName } = await this.collectedCapabilities;
if (atName === 'NVDA') {
await this.ensureSettings(mode.toLowerCase() === 'reading' ? 'browseMode' : 'focusMode');
await this.ensureSettings(mode.toLowerCase() === 'reading' ? 'browseMode' : 'focusMode', []);
return;
} else if (atName === 'VoiceOver') {
return;
Expand Down Expand Up @@ -204,7 +217,7 @@

if (command.settings) {
// Ensure AT is in proper mode for tests. V2 tests define "settings" per command.
await this.ensureSettings(command.settings);
await this.ensureSettings(command.settings, command.additionalSettings);
} else if (test.target?.mode) {
// V1 tests define a "mode" of "reading" or "interaction" on the test.target
await this.ensureMode(test.target.mode);
Expand Down
Loading