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: Enable automation support for VoiceOver/Safari/MacOS #1101

Merged
merged 10 commits into from
May 22, 2024
12 changes: 10 additions & 2 deletions client/components/AddTestToQueueWithConfirmation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,16 @@ function AddTestToQueueWithConfirmation({

AddTestToQueueWithConfirmation.propTypes = {
testPlanVersion: PropTypes.object,
browser: PropTypes.object,
at: PropTypes.object,
browser: PropTypes.shape({
id: PropTypes.string.isRequired,
key: PropTypes.string.isRequired,
name: PropTypes.string.isRequired
}),
at: PropTypes.shape({
id: PropTypes.string.isRequired,
key: PropTypes.string.isRequired,
name: PropTypes.string.isRequired
}),
buttonRef: PropTypes.object,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
Expand Down
8 changes: 8 additions & 0 deletions client/components/DataManagement/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ export const DATA_MANAGEMENT_PAGE_QUERY = gql`
}
ats {
id
key
name
browsers {
id
key
name
}
atVersions {
Expand Down Expand Up @@ -66,10 +68,12 @@ export const DATA_MANAGEMENT_PAGE_QUERY = gql`
markedFinalAt
at {
id
key
name
}
browser {
id
key
name
}
issues {
Expand Down Expand Up @@ -135,10 +139,12 @@ export const UPDATE_TEST_PLAN_VERSION_PHASE = gql`
id
at {
id
key
name
}
browser {
id
key
name
}
issues {
Expand Down Expand Up @@ -182,10 +188,12 @@ export const UPDATE_TEST_PLAN_VERSION_RECOMMENDED_TARGET_DATE = gql`
id
at {
id
key
name
}
browser {
id
key
name
}
issues {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ StopRunningCollectionButton.propTypes = {
'CANCELLED',
'COMPLETED',
'ERROR'
])
]).isRequired
}),
onClick: PropTypes.func
};
Expand Down
15 changes: 14 additions & 1 deletion client/components/ManageTestQueue/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,20 @@ const ManageTestQueue = ({
};

ManageTestQueue.propTypes = {
ats: PropTypes.array,
ats: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
key: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
browsers: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
key: PropTypes.string.isRequired,
name: PropTypes.string.isRequired
})
).isRequired
})
).isRequired,
testPlanVersions: PropTypes.array,
triggerUpdate: PropTypes.func
};
Expand Down
32 changes: 28 additions & 4 deletions client/components/TestQueue/AssignTesterDropdown/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,28 @@ const AssignTesterDropdown = ({
<Dropdown.Menu role="menu" className="assign-menu">
{possibleTesters?.length ? (
possibleTesters.map(tester => {
const { username } = tester;
const { username, isBot, ats } = tester;
const testerIsAssigned = isTesterAssigned(username);
const classname = [
testerIsAssigned ? 'assigned' : 'not-assigned',
tester.isBot ? 'bot' : 'human'
isBot ? 'bot' : 'human'
].join(' ');
let icon;
if (testerIsAssigned) {
icon = faCheck;
} else if (tester.isBot) {
} else if (isBot) {
// if our bot doesn't have a link to the at - hide it from the list
if (
!ats.find(
({ id }) =>
id ===
testPlanReportAtBrowserQuery
?.testPlanReport.at.id
)
) {
return null;
}

const supportedByBot =
isSupportedByResponseCollector(
testPlanReportAtBrowserQuery?.testPlanReport
Expand Down Expand Up @@ -192,7 +204,19 @@ const AssignTesterDropdown = ({

AssignTesterDropdown.propTypes = {
testPlanReportId: PropTypes.string.isRequired,
possibleTesters: PropTypes.array.isRequired,
possibleTesters: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
username: PropTypes.string.isRequired,
isBot: PropTypes.bool.isRequired,
ats: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
key: PropTypes.string.isRequired
})
)
})
).isRequired,
onChange: PropTypes.func.isRequired,
testPlanRun: PropTypes.object,
label: PropTypes.string,
Expand Down
12 changes: 12 additions & 0 deletions client/components/TestQueue/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ export const TEST_QUEUE_PAGE_QUERY = gql`
username
roles
isBot
ats {
id
key
}
}
ats {
id
name
key
atVersions {
id
name
releasedAt
}
browsers {
id
key
name
}
candidateBrowsers {
Expand Down Expand Up @@ -55,10 +61,12 @@ export const TEST_QUEUE_PAGE_QUERY = gql`
markedFinalAt
at {
id
key
name
}
browser {
id
key
name
}
testPlanVersion {
Expand Down Expand Up @@ -106,10 +114,12 @@ export const TEST_PLAN_REPORT_QUERY = gql`
runnableTestsLength
at {
id
key
name
}
browser {
id
key
name
}
testPlanVersion {
Expand Down Expand Up @@ -151,10 +161,12 @@ export const TEST_PLAN_REPORT_AT_BROWSER_QUERY = gql`
id
at {
id
key
name
}
browser {
id
key
name
}
}
Expand Down
10 changes: 6 additions & 4 deletions client/tests/AddTestToQueueWithConfirmation.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ const mockTestPlanReportsQueryResult = {
},
isFinal: false,
at: {
id: '1'
id: '1',
key: 'jaws'
},
browser: {
id: '2'
id: '2',
key: 'firefox'
}
}
]
Expand All @@ -64,8 +66,8 @@ const setup = (props, mockMutation) => {

const commonSetup = mockMutation => {
mockTestPlanVersion = { id: 5 };
mockBrowser = { id: 2 };
mockAt = { id: 3 };
mockBrowser = { id: '2', key: 'firefox', name: 'Firefox' };
mockAt = { id: '3', key: 'voiceover_macos', name: 'VoiceOver' };
mockButtonText = 'Add to Test Queue';

const renderResult = setup(
Expand Down
Loading
Loading