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

permit automated testing for firefox and chrome with voiceover #1170

Merged
merged 3 commits into from
Jul 25, 2024
Merged
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
6 changes: 4 additions & 2 deletions client/components/AddTestToQueueWithConfirmation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ function AddTestToQueueWithConfirmation({
} catch (e) {
console.error(e);
}
}
},
testId: 'add-run-later'
});

if (!alreadyHasBotInTestPlanReport) {
Expand All @@ -186,7 +187,8 @@ function AddTestToQueueWithConfirmation({
} catch (e) {
console.error(e);
}
}
},
testId: 'add-run-bot'
});
}
}
Expand Down
2 changes: 2 additions & 0 deletions client/components/common/BasicModal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const BasicModal = ({
variant={action.variant ?? 'primary'}
onClick={action.onClick}
className={action.className ?? ''}
data-testid={action.testId ?? ''}
>
{action.label ?? 'Continue'}
</Button>
Expand Down Expand Up @@ -138,6 +139,7 @@ BasicModal.propTypes = {
onClick: PropTypes.func,
variant: PropTypes.string,
className: PropTypes.string,
testId: PropTypes.string,
component: PropTypes.elementType,
props: PropTypes.object
})
Expand Down
1 change: 1 addition & 0 deletions client/tests/AddTestToQueueWithConfirmation.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ describe('AddTestToQueueWithConfirmation', () => {

test('calls mutation on button click with correct variables', async () => {
fireEvent.click(getByTestId('add-button'));
fireEvent.click(await getByTestId('add-run-later'));

await waitFor(() => {
expect(mutationMock).toHaveBeenCalled();
Expand Down
16 changes: 12 additions & 4 deletions client/utils/automation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ export const isSupportedByResponseCollector = ctx => {
// Check if the AT and browser are supported by the automation
const isNvdaWithSupportedBrowser =
atKey === 'nvda' && (browserKey === 'chrome' || browserKey === 'firefox');
const isVoiceOverMacWithSafari =
atKey === 'voiceover_macos' && browserKey === 'safari_macos';
const isVoiceOverMacWithSupportedBrowser =
atKey === 'voiceover_macos' &&
(browserKey === 'safari_macos' ||
browserKey === 'chrome' ||
browserKey === 'firefox');

if (!isNvdaWithSupportedBrowser && !isVoiceOverMacWithSafari) {
if (!isNvdaWithSupportedBrowser && !isVoiceOverMacWithSupportedBrowser) {
return false;
}

Expand Down Expand Up @@ -89,7 +92,12 @@ export const getBotUsernameFromAtBrowser = (at, browser) => {
) {
return 'NVDA Bot';
}
if (at?.key === 'voiceover_macos' && browser?.key === 'safari_macos') {
if (
at?.key === 'voiceover_macos' &&
(browser?.key === 'safari_macos' ||
browser?.key === 'chrome' ||
browser?.key === 'firefox')
) {
return 'VoiceOver Bot';
}
};
1 change: 1 addition & 0 deletions server/services/GithubWorkflowService.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const createGithubWorkflow = async ({ job, directory, gitSha, atVersion }) => {
// due to limitations on Github workflow runners
// See https://github.com/w3c/aria-at-app/issues/1143 for more info
inputs.macos_version = atVersion?.name?.split('.')[0];
inputs.browser = browser;
}
const axiosConfig = {
method: 'POST',
Expand Down
Loading