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

Additional checks for AtVersion automation run support #1227

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
59 changes: 31 additions & 28 deletions server/resources/ats.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,9 @@
[
{
"id": 1,
"name": "JAWS",
"key": "jaws",
"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": 2,
"name": "NVDA",
"key": "nvda",
"vendorId": null,
"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",
Expand All @@ -55,10 +28,40 @@
}
}
},
{
"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": 3,
"name": "VoiceOver for macOS",
"key": "voiceover_macos",
"vendorId": 4,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to define the vendorId property for this patch? Would you mind if I moved JAWS back in order to make the diff clearer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Odd, just realized this happened. Looks to be a change included by #1208 that wasn't pushed. That can definitely be done separately

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed that change

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome! I'll merge once CI passes

"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",
Expand Down
16 changes: 11 additions & 5 deletions server/util/getAtVersionWithRequirements.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { Op } = require('sequelize');
const { getAtVersions } = require('../models/services/AtService');
const { AT_VERSIONS_SUPPORTED_BY_COLLECTION_JOBS } = require('./constants');

const getAtVersionWithRequirements = async (
atId,
Expand Down Expand Up @@ -33,11 +34,16 @@ const getAtVersionWithRequirements = async (
transaction
});

const latestSupportedAtVersion = matchingAtVersions.find(async atv => {
// supportedByAutomation is a computed graphql field,
// so we need to compute directly here
return atv.supportedByAutomation;
});
const supportedVersions =
AT_VERSIONS_SUPPORTED_BY_COLLECTION_JOBS[
matchingAtVersions[0]?.at?.name
] || [];

const latestSupportedAtVersion = matchingAtVersions.find(
atv =>
supportedVersions.includes(atv.name) &&
new Date(atv.releasedAt) >= new Date(minimumAtVersion.releasedAt)
);

if (!latestSupportedAtVersion) {
throw new Error(
Expand Down
Loading