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

feat: Support multiple settings #1314

Draft
wants to merge 1 commit into
base: development
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,14 @@ const InstructionsRenderer = ({
{renderableContent.commands.map(
({ id, settings, assertionExceptions = [] }, i) => {
const settingsScreenText = isV2
? renderableContent.target.at.raw.settings[settings]?.screenText ??
''
? settings
.split(' ')
.map(
setting =>
renderableContent.target.at.raw.settings[setting]
?.screenText
)
.join(' and ')
: null;

let mustCount = 0;
Expand Down
5 changes: 4 additions & 1 deletion server/models/services/TestsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ const getTests = parentRecord => {
at,
commands: scenario.commandIds.map(commandId => {
if (isV2) {
const screenText = at?.settings[scenario.settings]?.screenText;
const screenText = scenario.settings
.split(' ')
.map(setting => at?.settings[setting]?.screenText)
.join(' and ');
const commandKVs = getCommandV2(commandId);
if (commandKVs.length) {
// `scenario` has an identifier to the settings being displayed.
Expand Down
240 changes: 129 additions & 111 deletions server/resources/ats.json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Warning

The settings introduced here are fake (included through w3c/aria-at#1126) and should be removed before merging

Original file line number Diff line number Diff line change
@@ -1,115 +1,133 @@
[
{
"id": 1,
"name": "JAWS",
"key": "jaws",
"vendorId": 1,
"defaultConfigurationInstructionsHTML": "Configure JAWS with default settings. For help, read <a href="https://github.com/w3c/aria-at/wiki/Configuring-Screen-Readers-for-Testing">Configuring Screen Readers for Testing</a>.",
"assertionTokens": {
"screenReader": "JAWS",
"interactionMode": "PC cursor active",
"readingMode": "virtual cursor active",
"readingCursor": "virtual cursor"
},
"settings": {
"virtualCursor": {
"screenText": "virtual cursor active",
"instructions": [
"Press <kbd>Alt</kbd>+<kbd>Delete</kbd> to determine which cursor is active.",
"If the PC cursor is active, press <kbd>Escape</kbd> to activate the virtual cursor."
]
},
"pcCursor": {
"screenText": "PC cursor active",
"instructions": [
"Press <kbd>Alt</kbd>+<kbd>Delete</kbd> to determine which cursor is active.",
"If the virtual cursor is active, press <kbd>Insert</kbd>+<kbd>z</kbd> to disable the virtual cursor."
]
}
}
{
"id": 1,
"name": "JAWS",
"key": "jaws",
"vendorId": 1,
"defaultConfigurationInstructionsHTML": "Configure JAWS with default settings. For help, read <a href="https://github.com/w3c/aria-at/wiki/Configuring-Screen-Readers-for-Testing">Configuring Screen Readers for Testing</a>.",
"assertionTokens": {
"screenReader": "JAWS",
"interactionMode": "PC cursor active",
"readingMode": "virtual cursor active",
"readingCursor": "virtual cursor"
},
{
"id": 2,
"name": "NVDA",
"key": "nvda",
"vendorId": 6,
"defaultConfigurationInstructionsHTML": "Configure NVDA with default settings. For help, read <a href="https://github.com/w3c/aria-at/wiki/Configuring-Screen-Readers-for-Testing">Configuring Screen Readers for Testing</a>.",
"assertionTokens": {
"screenReader": "NVDA",
"interactionMode": "focus mode",
"readingMode": "browse mode",
"readingCursor": "browse mode caret"
},
"settings": {
"browseMode": {
"screenText": "browse mode on",
"instructions": [
"Press <kbd>Insert</kbd>+<kbd>Space</kbd>.",
"If NVDA made the focus mode sound, press <kbd>Insert</kbd>+<kbd>Space</kbd> again to turn browse mode back on."
]
},
"focusMode": {
"screenText": "focus mode on",
"instructions": [
"Press <kbd>Insert</kbd>+<kbd>Space</kbd>.",
"If NVDA made the browse mode sound, press <kbd>Insert</kbd>+<kbd>Space</kbd> again to turn focus mode back on."
]
}
}
"settings": {
"virtualCursor": {
"screenText": "virtual cursor active",
"instructions": [
"Press <kbd>Alt</kbd>+<kbd>Delete</kbd> to determine which cursor is active.",
"If the PC cursor is active, press <kbd>Escape</kbd> to activate the virtual cursor."
]
},
"pcCursor": {
"screenText": "PC cursor active",
"instructions": [
"Press <kbd>Alt</kbd>+<kbd>Delete</kbd> to determine which cursor is active.",
"If the virtual cursor is active, press <kbd>Insert</kbd>+<kbd>z</kbd> to disable the virtual cursor."
]
},
"speechRateIncrease": {
"screenText": "Speech Rate Increase",
"instructions": [
"Ensure you are in JAWS mode. Press <kbd>Insert</kbd>+<kbd>j</kbd> if you are unsure.",
"Press <kbd>Insert</kbd>+<kbd>Ctrl</kbd>+<kbd>Page Up</kbd> to increase the speech rate."
]
},
"commentAnnouncementOn": {
"screenText": "Comment Announcement On",
"instructions": [
"Ensure you are in JAWS mode. Press <kbd>Insert</kbd>+<kbd>j</kbd> if you are unsure.",
"Use the arrow keys to select 'Speech & Sounds' from the categories list.",
"Find and choose the option related to comment announcements. This might be listed under 'Speech Settings' or a similar category.",
"Look for a checkbox or toggle to enable comment announcements and check or activate it.",
"Click 'Apply' to save your changes.",
"Press <kbd>Enter</kbd> to confirm and exit the Settings Center."
]
}
}
},
{
"id": 2,
"name": "NVDA",
"key": "nvda",
"vendorId": 6,
"defaultConfigurationInstructionsHTML": "Configure NVDA with default settings. For help, read <a href="https://github.com/w3c/aria-at/wiki/Configuring-Screen-Readers-for-Testing">Configuring Screen Readers for Testing</a>.",
"assertionTokens": {
"screenReader": "NVDA",
"interactionMode": "focus mode",
"readingMode": "browse mode",
"readingCursor": "browse mode caret"
},
"settings": {
"browseMode": {
"screenText": "browse mode on",
"instructions": [
"Press <kbd>Insert</kbd>+<kbd>Space</kbd>.",
"If NVDA made the focus mode sound, press <kbd>Insert</kbd>+<kbd>Space</kbd> again to turn browse mode back on."
]
},
"focusMode": {
"screenText": "focus mode on",
"instructions": [
"Press <kbd>Insert</kbd>+<kbd>Space</kbd>.",
"If NVDA made the browse mode sound, press <kbd>Insert</kbd>+<kbd>Space</kbd> again to turn focus mode back on."
]
}
}
},
{
"id": 3,
"name": "VoiceOver for macOS",
"key": "voiceover_macos",
"vendorId": 4,
"defaultConfigurationInstructionsHTML": "Configure VoiceOver with default settings. For help, read <a href="https://github.com/w3c/aria-at/wiki/Configuring-Screen-Readers-for-Testing">Configuring Screen Readers for Testing</a>.",
"assertionTokens": {
"screenReader": "VoiceOver",
"readingCursor": "VoiceOver cursor"
},
{
"id": 3,
"name": "VoiceOver for macOS",
"key": "voiceover_macos",
"vendorId": 4,
"defaultConfigurationInstructionsHTML": "Configure VoiceOver with default settings. For help, read <a href="https://github.com/w3c/aria-at/wiki/Configuring-Screen-Readers-for-Testing">Configuring Screen Readers for Testing</a>.",
"assertionTokens": {
"screenReader": "VoiceOver",
"readingCursor": "VoiceOver cursor"
},
"settings": {
"quickNavOn": {
"screenText": "quick nav on",
"instructions": [
"Simultaneously press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd>.",
"If VoiceOver said 'quick nav off', press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd> again to turn it back on."
]
},
"quickNavOff": {
"screenText": "quick nav off",
"instructions": [
"Simultaneously press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd>.",
"If VoiceOver said 'quick nav on', press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd> again to turn it back off."
]
},
"arrowQuickKeyNavOn": {
"screenText": "arrow quick key nav on",
"instructions": [
"Simultaneously press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd>.",
"If VoiceOver said 'arrow quick key nav off', press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd> again to turn it back on."
]
},
"arrowQuickKeyNavOff": {
"screenText": "arrow quick key nav off",
"instructions": [
"Simultaneously press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd>.",
"If VoiceOver said 'arrow quick key nav on', press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd> again to turn it back off."
]
},
"singleQuickKeyNavOn": {
"screenText": "single quick key nav on",
"instructions": [
"Press <kbd>Control</kbd>+<kbd>Option</kbd>+<kbd>q</kbd>.",
"If VoiceOver said 'single quick key nav off', press <kbd>Control</kbd>+<kbd>Option</kbd>+<kbd>q</kbd> again to turn it back on."
]
},
"singleQuickKeyNavOff": {
"screenText": "single quick key nav off",
"instructions": [
"Press <kbd>Control</kbd>+<kbd>Option</kbd>+<kbd>q</kbd>.",
"If VoiceOver said 'single quick key nav on', press <kbd>Control</kbd>+<kbd>Option</kbd>+<kbd>q</kbd> again to turn it back off."
]
}
}
"settings": {
"quickNavOn": {
"screenText": "quick nav on",
"instructions": [
"Simultaneously press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd>.",
"If VoiceOver said 'quick nav off', press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd> again to turn it back on."
]
},
"quickNavOff": {
"screenText": "quick nav off",
"instructions": [
"Simultaneously press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd>.",
"If VoiceOver said 'quick nav on', press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd> again to turn it back off."
]
},
"arrowQuickKeyNavOn": {
"screenText": "arrow quick key nav on",
"instructions": [
"Simultaneously press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd>.",
"If VoiceOver said 'arrow quick key nav off', press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd> again to turn it back on."
]
},
"arrowQuickKeyNavOff": {
"screenText": "arrow quick key nav off",
"instructions": [
"Simultaneously press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd>.",
"If VoiceOver said 'arrow quick key nav on', press <kbd>Left Arrow</kbd> and <kbd>Right Arrow</kbd> again to turn it back off."
]
},
"singleQuickKeyNavOn": {
"screenText": "single quick key nav on",
"instructions": [
"Press <kbd>Control</kbd>+<kbd>Option</kbd>+<kbd>q</kbd>.",
"If VoiceOver said 'single quick key nav off', press <kbd>Control</kbd>+<kbd>Option</kbd>+<kbd>q</kbd> again to turn it back on."
]
},
"singleQuickKeyNavOff": {
"screenText": "single quick key nav off",
"instructions": [
"Press <kbd>Control</kbd>+<kbd>Option</kbd>+<kbd>q</kbd>.",
"If VoiceOver said 'single quick key nav on', press <kbd>Control</kbd>+<kbd>Option</kbd>+<kbd>q</kbd> again to turn it back off."
]
}
}
]
}
]
2 changes: 1 addition & 1 deletion server/scripts/import-tests/gitOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const spawn = require('cross-spawn');

const ariaAtRepo = 'https://github.com/w3c/aria-at.git';
const ariaAtDefaultBranch = 'master';
const ariaAtDefaultBranch = 'fix-1002-test'; // TODO: Revert to master before merging; based on test PR https://github.com/w3c/aria-at/pull/1126
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Warning

This branch was set to test an example scenario with the "Alert" plan and should be reverted before merging


/**
* Executes a git command and returns its output.
Expand Down
Loading