Skip to content

Commit

Permalink
Fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
stalgiag committed Dec 14, 2023
1 parent 8ff6e6b commit d63609d
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 93 deletions.
18 changes: 8 additions & 10 deletions client/components/common/BasicThemedModal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,14 @@ const BasicThemedModal = ({
</Button>
)}
{actionButtons.map(({ action, text }) => (
<Button
key={text}
variant={
theme === 'danger' ? 'danger' : 'primary'
}
onClick={action}
>
{text}
</Button>
))}
<Button
key={text}
variant={theme === 'danger' ? 'danger' : 'primary'}
onClick={action}
>
{text}
</Button>
))}
</Modal.Footer>
</Modal>
</>
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/AutomationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const throwNoJobFoundError = jobId => {
);
};

const throwNoTestFoundError = (testCsvRow) => {
const throwNoTestFoundError = testCsvRow => {
throw new HttpQueryError(
404,
`Could not find test at CSV row number ${testCsvRow}`,
Expand Down
2 changes: 1 addition & 1 deletion server/models/services/CollectionJobService.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const { runnableTests } = require('../../resolvers/TestPlanReport');
const { default: axios } = require('axios');
const {
default: createGithubWorkflow,
isEnabled: isGithubWorkflowEnabled,
isEnabled: isGithubWorkflowEnabled
} = require('../../services/GithubWorkflowService');

const includeBrowserVersion = {
Expand Down
6 changes: 4 additions & 2 deletions server/resolvers/Test/renderableContentsResolver.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const renderableContents = async (test, _, context) => {
const ats = await context.atLoader.getAll();
const AtLoader = require('../../models/loaders/AtLoader');

const renderableContents = async test => {
const ats = await AtLoader().getAll();

return Object.entries(test.renderableContent).map(
([atId, renderableContent]) => {
Expand Down
6 changes: 4 additions & 2 deletions server/resolvers/Test/renderedUrlsResolver.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const renderedUrls = async (test, _, context) => {
const ats = await context.atLoader.getAll();
const AtLoader = require('../../models/loaders/AtLoader');

const renderedUrls = async test => {
const ats = await AtLoader().getAll();

return Object.entries(test.renderedUrls).map(([atId, renderedUrl]) => {
const at = ats.find(at => at.id == atId);
Expand Down
67 changes: 3 additions & 64 deletions server/resources/ats.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,16 @@
{
"id": 1,
"name": "JAWS",
"key": "jaws",
"defaultConfigurationInstructionsHTML": "Configure JAWS with default settings. For help, read &lt;a href=&quot;https://github.com/w3c/aria-at/wiki/Configuring-Screen-Readers-for-Testing&quot;&gt;Configuring Screen Readers for Testing&lt;/a&gt;.",
"assertionTokens": {
"screenReader": "JAWS",
"readingMode": "virtual cursor active",
"interactionMode": "PC cursor active"
},
"settings": {
"virtualCursor": {
"screenText": "virtual cursor active",
"instructions": [
"Press &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;Delete&lt;/kbd&gt; to determine which cursor is active.",
"If the PC cursor is active, press &lt;kbd&gt;Escape&lt;/kbd&gt; to activate the virtual cursor."
]
},
"pcCursor": {
"screenText": "PC cursor active",
"instructions": [
"Press &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;Delete&lt;/kbd&gt; to determine which cursor is active.",
"If the virtual cursor is active, press &lt;kbd&gt;Insert&lt;/kbd&gt;+&lt;kbd&gt;z&lt;/kbd&gt; to disable the virtual cursor."
]
}
}
"key": "jaws"
},
{
"id": 2,
"name": "NVDA",
"key": "nvda",
"defaultConfigurationInstructionsHTML": "Configure NVDA with default settings. For help, read &lt;a href=&quot;https://github.com/w3c/aria-at/wiki/Configuring-Screen-Readers-for-Testing&quot;&gt;Configuring Screen Readers for Testing&lt;/a&gt;.",
"assertionTokens": {
"screenReader": "NVDA",
"readingMode": "browse mode",
"interactionMode": "focus mode"
},
"settings": {
"browseMode": {
"screenText": "browse mode on",
"instructions": [
"Press &lt;kbd&gt;Insert&lt;/kbd&gt;+&lt;kbd&gt;Space&lt;/kbd&gt;.",
"If NVDA made the focus mode sound, press &lt;kbd&gt;Insert&lt;/kbd&gt;+&lt;kbd&gt;Space&lt;/kbd&gt; again to turn browse mode back on."
]
},
"focusMode": {
"screenText": "focus mode on",
"instructions": [
"Press &lt;kbd&gt;Insert&lt;/kbd&gt;+&lt;kbd&gt;Space&lt;/kbd&gt;.",
"If NVDA made the browse mode sound, press &lt;kbd&gt;Insert&lt;/kbd&gt;+&lt;kbd&gt;Space&lt;/kbd&gt; again to turn focus mode back on."
]
}
}
"key": "nvda"
},
{
"id": 3,
"name": "VoiceOver for macOS",
"key": "voiceover_macos",
"defaultConfigurationInstructionsHTML": "Configure VoiceOver with default settings. For help, read &lt;a href=&quot;https://github.com/w3c/aria-at/wiki/Configuring-Screen-Readers-for-Testing&quot;&gt;Configuring Screen Readers for Testing&lt;/a&gt;.",
"settings": {
"quickNavOn": {
"screenText": "quick nav on",
"instructions": [
"Simultaneously press &lt;kbd&gt;Left Arrow&lt;/kbd&gt; and &lt;kbd&gt;Right Arrow&lt;/kbd&gt;.",
"If VoiceOver said 'quick nav off', press &lt;kbd&gt;Left Arrow&lt;/kbd&gt; and &lt;kbd&gt;Right Arrow&lt;/kbd&gt; again to turn it back on."
]
},
"quickNavOff": {
"screenText": "quick nav off",
"instructions": [
"Simultaneously press &lt;kbd&gt;Left Arrow&lt;/kbd&gt; and &lt;kbd&gt;Right Arrow&lt;/kbd&gt;.",
"If VoiceOver said 'quick nav on', press &lt;kbd&gt;Left Arrow&lt;/kbd&gt; and &lt;kbd&gt;Right Arrow&lt;/kbd&gt; again to turn it back off."
]
}
}
"key": "voiceover_macos"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ INSERT INTO "TestPlanReport" (id, "testPlanVersionId", "createdAt", "atId", "bro
INSERT INTO "TestPlanReport" (id, "testPlanVersionId", "createdAt", "atId", "browserId", "vendorReviewStatus") VALUES (11, get_test_plan_version_id(text 'Modal Dialog Example', null), '2021-05-14 14:18:23.602-05', 3, 2, 'READY');
INSERT INTO "TestPlanReport" (id, "testPlanVersionId", "createdAt", "markedFinalAt", "atId", "browserId", "vendorReviewStatus") VALUES (12, get_test_plan_version_id(text 'Checkbox Example (Mixed-State)', null), '2021-05-14 14:18:23.602-05', '2022-07-06', 1, 2, 'READY');
INSERT INTO "TestPlanReport" (id, "testPlanVersionId", "createdAt", "markedFinalAt", "atId", "browserId", "vendorReviewStatus") VALUES (13, get_test_plan_version_id(text 'Checkbox Example (Mixed-State)', null), '2021-05-14 14:18:23.602-05', '2022-07-07', 2, 2, 'READY');
INSERT INTO "TestPlanReport" (id, "testPlanVersionId", "createdAt", "markedFinalAt", "atId", "browserId", "vendorReviewStatus") VALUES (14, get_test_plan_version_id(text 'Toggle Button'), '2021-05-14 14:18:23.602-05', '2022-07-07', 2, 2, 'READY');
INSERT INTO "TestPlanReport" (id, "testPlanVersionId", "createdAt", "markedFinalAt", "atId", "browserId", "vendorReviewStatus") VALUES (15, get_test_plan_version_id(text 'Toggle Button'), '2021-05-14 14:18:23.602-05', '2022-07-07', 3, 3, 'READY');
INSERT INTO "TestPlanReport" (id, "testPlanVersionId", "createdAt", "markedFinalAt", "atId", "browserId", "vendorReviewStatus") VALUES (14, get_test_plan_version_id(text 'Toggle Button', null), '2021-05-14 14:18:23.602-05', '2022-07-07', 2, 2, 'READY');
INSERT INTO "TestPlanReport" (id, "testPlanVersionId", "createdAt", "markedFinalAt", "atId", "browserId", "vendorReviewStatus") VALUES (15, get_test_plan_version_id(text 'Toggle Button', null), '2021-05-14 14:18:23.602-05', '2022-07-07', 3, 3, 'READY');

--
-- Data for Name: TestPlanVersion; Type: TABLE DATA; Schema: public; Owner: atr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const populateFakeTestResults = async (testPlanRunId, fakeTestResultTypes) => {
break;
case 'passingHistoricalResultsForMockAutomation':
await getFake({
testPlanReport,
testPlanRunId,
index,
fakeTestResultType:
Expand Down
27 changes: 16 additions & 11 deletions server/tests/integration/automation-scheduler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const { default: axios } = require('axios');
const {
getCollectionJobById
} = require('../../models/services/CollectionJobService');
const {
getTestPlanReportById
} = require('../../models/services/TestPlanReportService');

let mockAutomationSchedulerServer;
let apiServer;
Expand Down Expand Up @@ -496,17 +499,7 @@ describe('Automation controller', () => {

it('should copy assertion results when updating with results that match historical results', async () => {
await dbCleaner(async () => {
const { scheduleCollectionJob: job } =
await scheduleCollectionJobByMutation();
const collectionJob = await getCollectionJobById(job.id);
await sessionAgent
.post(`/api/jobs/${jobId}/update`)
.send({ status: 'RUNNING' })
.set(
'x-automation-secret',
process.env.AUTOMATION_SCHEDULER_SECRET
);

// Start by getting historical results for comparing later
// Test plan report used for test is in Draft so it
// must be markedAsFinal to have historical results
const finalizedTestPlanVersion = await markAsFinal(
Expand Down Expand Up @@ -535,6 +528,18 @@ describe('Automation controller', () => {
scenarioResult => scenarioResult.output
);
const { atVersion, browserVersion } = historicalTestResult;

const { scheduleCollectionJob: job } =
await scheduleCollectionJobByMutation();
const collectionJob = await getCollectionJobById(job.id);
await sessionAgent
.post(`/api/jobs/${jobId}/update`)
.send({ status: 'RUNNING' })
.set(
'x-automation-secret',
process.env.AUTOMATION_SCHEDULER_SECRET
);

const response = await sessionAgent
.post(`/api/jobs/${jobId}/result`)
.send({
Expand Down

0 comments on commit d63609d

Please sign in to comment.