itemengine-cypress-automation 1.0.127 → 1.0.128
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/migration/migration.js +5 -2
- package/cypress/e2e/migration/migration10.js +3 -0
- package/cypress/e2e/migration/migration2.js +3 -0
- package/cypress/e2e/migration/migration3.js +3 -0
- package/cypress/e2e/migration/migration4.js +3 -0
- package/cypress/e2e/migration/migration5.js +3 -0
- package/cypress/e2e/migration/migration6.js +3 -0
- package/cypress/e2e/migration/migration7.js +3 -0
- package/cypress/e2e/migration/migration8.js +3 -0
- package/cypress/e2e/migration/migration9.js +3 -0
- package/cypress/support/migrationHelpers/drawingToolbarOptionsENUM.js +12 -0
- package/cypress/support/migrationHelpers/extractLrnQuestionData.js +38 -0
- package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -0
- package/cypress/support/migrationHelpers/verifyIeQuestionData.js +32 -0
- package/package.json +1 -1
@@ -34,7 +34,7 @@ Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
|
|
34
34
|
cy.learnosityLoaderWait();
|
35
35
|
})
|
36
36
|
|
37
|
-
const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["
|
37
|
+
const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
|
38
38
|
const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
|
39
39
|
let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
|
40
40
|
let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
|
@@ -43,7 +43,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
|
|
43
43
|
let lrnQuestionDataArr = [];
|
44
44
|
let lrnGradingDataArr = [];
|
45
45
|
|
46
|
-
let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(0, 100);//["
|
46
|
+
let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(0, 100);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
|
47
47
|
|
48
48
|
if (referenceIds.length > 0) {
|
49
49
|
describe('Migration item check for MCQ questions', () => {
|
@@ -89,6 +89,7 @@ if (referenceIds.length > 0) {
|
|
89
89
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
|
90
90
|
case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
|
91
91
|
case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
|
92
|
+
case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
|
92
93
|
default: throw new Error('Invalid lrn question type');
|
93
94
|
}
|
94
95
|
}
|
@@ -107,6 +108,7 @@ if (referenceIds.length > 0) {
|
|
107
108
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
|
108
109
|
case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
|
109
110
|
case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
|
111
|
+
case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
|
110
112
|
default: throw new Error('Invalid ngie question type');
|
111
113
|
}
|
112
114
|
});
|
@@ -131,6 +133,7 @@ if (referenceIds.length > 0) {
|
|
131
133
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
132
134
|
case lrnQuestionTypesENUM.essayResponse:
|
133
135
|
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
+
case lrnQuestionTypesENUM.drawingResponse:
|
134
137
|
return;
|
135
138
|
default: throw new Error('Invalid lrn question type');
|
136
139
|
}
|
@@ -89,6 +89,7 @@ if (referenceIds.length > 0) {
|
|
89
89
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
|
90
90
|
case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
|
91
91
|
case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
|
92
|
+
case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
|
92
93
|
default: throw new Error('Invalid lrn question type');
|
93
94
|
}
|
94
95
|
}
|
@@ -107,6 +108,7 @@ if (referenceIds.length > 0) {
|
|
107
108
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
|
108
109
|
case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
|
109
110
|
case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
|
111
|
+
case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
|
110
112
|
default: throw new Error('Invalid ngie question type');
|
111
113
|
}
|
112
114
|
});
|
@@ -131,6 +133,7 @@ if (referenceIds.length > 0) {
|
|
131
133
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
132
134
|
case lrnQuestionTypesENUM.essayResponse:
|
133
135
|
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
+
case lrnQuestionTypesENUM.drawingResponse:
|
134
137
|
return;
|
135
138
|
default: throw new Error('Invalid lrn question type');
|
136
139
|
}
|
@@ -89,6 +89,7 @@ if (referenceIds.length > 0) {
|
|
89
89
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
|
90
90
|
case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
|
91
91
|
case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
|
92
|
+
case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
|
92
93
|
default: throw new Error('Invalid lrn question type');
|
93
94
|
}
|
94
95
|
}
|
@@ -107,6 +108,7 @@ if (referenceIds.length > 0) {
|
|
107
108
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
|
108
109
|
case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
|
109
110
|
case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
|
111
|
+
case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
|
110
112
|
default: throw new Error('Invalid ngie question type');
|
111
113
|
}
|
112
114
|
});
|
@@ -131,6 +133,7 @@ if (referenceIds.length > 0) {
|
|
131
133
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
132
134
|
case lrnQuestionTypesENUM.essayResponse:
|
133
135
|
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
+
case lrnQuestionTypesENUM.drawingResponse:
|
134
137
|
return;
|
135
138
|
default: throw new Error('Invalid lrn question type');
|
136
139
|
}
|
@@ -89,6 +89,7 @@ if (referenceIds.length > 0) {
|
|
89
89
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
|
90
90
|
case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
|
91
91
|
case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
|
92
|
+
case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
|
92
93
|
default: throw new Error('Invalid lrn question type');
|
93
94
|
}
|
94
95
|
}
|
@@ -107,6 +108,7 @@ if (referenceIds.length > 0) {
|
|
107
108
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
|
108
109
|
case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
|
109
110
|
case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
|
111
|
+
case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
|
110
112
|
default: throw new Error('Invalid ngie question type');
|
111
113
|
}
|
112
114
|
});
|
@@ -131,6 +133,7 @@ if (referenceIds.length > 0) {
|
|
131
133
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
132
134
|
case lrnQuestionTypesENUM.essayResponse:
|
133
135
|
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
+
case lrnQuestionTypesENUM.drawingResponse:
|
134
137
|
return;
|
135
138
|
default: throw new Error('Invalid lrn question type');
|
136
139
|
}
|
@@ -89,6 +89,7 @@ if (referenceIds.length > 0) {
|
|
89
89
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
|
90
90
|
case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
|
91
91
|
case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
|
92
|
+
case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
|
92
93
|
default: throw new Error('Invalid lrn question type');
|
93
94
|
}
|
94
95
|
}
|
@@ -107,6 +108,7 @@ if (referenceIds.length > 0) {
|
|
107
108
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
|
108
109
|
case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
|
109
110
|
case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
|
111
|
+
case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
|
110
112
|
default: throw new Error('Invalid ngie question type');
|
111
113
|
}
|
112
114
|
});
|
@@ -131,6 +133,7 @@ if (referenceIds.length > 0) {
|
|
131
133
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
132
134
|
case lrnQuestionTypesENUM.essayResponse:
|
133
135
|
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
+
case lrnQuestionTypesENUM.drawingResponse:
|
134
137
|
return;
|
135
138
|
default: throw new Error('Invalid lrn question type');
|
136
139
|
}
|
@@ -89,6 +89,7 @@ if (referenceIds.length > 0) {
|
|
89
89
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
|
90
90
|
case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
|
91
91
|
case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
|
92
|
+
case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
|
92
93
|
default: throw new Error('Invalid lrn question type');
|
93
94
|
}
|
94
95
|
}
|
@@ -107,6 +108,7 @@ if (referenceIds.length > 0) {
|
|
107
108
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
|
108
109
|
case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
|
109
110
|
case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
|
111
|
+
case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
|
110
112
|
default: throw new Error('Invalid ngie question type');
|
111
113
|
}
|
112
114
|
});
|
@@ -131,6 +133,7 @@ if (referenceIds.length > 0) {
|
|
131
133
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
132
134
|
case lrnQuestionTypesENUM.essayResponse:
|
133
135
|
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
+
case lrnQuestionTypesENUM.drawingResponse:
|
134
137
|
return;
|
135
138
|
default: throw new Error('Invalid lrn question type');
|
136
139
|
}
|
@@ -89,6 +89,7 @@ if (referenceIds.length > 0) {
|
|
89
89
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
|
90
90
|
case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
|
91
91
|
case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
|
92
|
+
case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
|
92
93
|
default: throw new Error('Invalid lrn question type');
|
93
94
|
}
|
94
95
|
}
|
@@ -107,6 +108,7 @@ if (referenceIds.length > 0) {
|
|
107
108
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
|
108
109
|
case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
|
109
110
|
case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
|
111
|
+
case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
|
110
112
|
default: throw new Error('Invalid ngie question type');
|
111
113
|
}
|
112
114
|
});
|
@@ -131,6 +133,7 @@ if (referenceIds.length > 0) {
|
|
131
133
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
132
134
|
case lrnQuestionTypesENUM.essayResponse:
|
133
135
|
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
+
case lrnQuestionTypesENUM.drawingResponse:
|
134
137
|
return;
|
135
138
|
default: throw new Error('Invalid lrn question type');
|
136
139
|
}
|
@@ -89,6 +89,7 @@ if (referenceIds.length > 0) {
|
|
89
89
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
|
90
90
|
case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
|
91
91
|
case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
|
92
|
+
case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
|
92
93
|
default: throw new Error('Invalid lrn question type');
|
93
94
|
}
|
94
95
|
}
|
@@ -107,6 +108,7 @@ if (referenceIds.length > 0) {
|
|
107
108
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
|
108
109
|
case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
|
109
110
|
case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
|
111
|
+
case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
|
110
112
|
default: throw new Error('Invalid ngie question type');
|
111
113
|
}
|
112
114
|
});
|
@@ -131,6 +133,7 @@ if (referenceIds.length > 0) {
|
|
131
133
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
132
134
|
case lrnQuestionTypesENUM.essayResponse:
|
133
135
|
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
+
case lrnQuestionTypesENUM.drawingResponse:
|
134
137
|
return;
|
135
138
|
default: throw new Error('Invalid lrn question type');
|
136
139
|
}
|
@@ -89,6 +89,7 @@ if (referenceIds.length > 0) {
|
|
89
89
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
|
90
90
|
case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
|
91
91
|
case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
|
92
|
+
case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
|
92
93
|
default: throw new Error('Invalid lrn question type');
|
93
94
|
}
|
94
95
|
}
|
@@ -107,6 +108,7 @@ if (referenceIds.length > 0) {
|
|
107
108
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
|
108
109
|
case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
|
109
110
|
case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
|
111
|
+
case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
|
110
112
|
default: throw new Error('Invalid ngie question type');
|
111
113
|
}
|
112
114
|
});
|
@@ -131,6 +133,7 @@ if (referenceIds.length > 0) {
|
|
131
133
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
132
134
|
case lrnQuestionTypesENUM.essayResponse:
|
133
135
|
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
+
case lrnQuestionTypesENUM.drawingResponse:
|
134
137
|
return;
|
135
138
|
default: throw new Error('Invalid lrn question type');
|
136
139
|
}
|
@@ -89,6 +89,7 @@ if (referenceIds.length > 0) {
|
|
89
89
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
|
90
90
|
case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
|
91
91
|
case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
|
92
|
+
case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
|
92
93
|
default: throw new Error('Invalid lrn question type');
|
93
94
|
}
|
94
95
|
}
|
@@ -107,6 +108,7 @@ if (referenceIds.length > 0) {
|
|
107
108
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
|
108
109
|
case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
|
109
110
|
case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
|
111
|
+
case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
|
110
112
|
default: throw new Error('Invalid ngie question type');
|
111
113
|
}
|
112
114
|
});
|
@@ -131,6 +133,7 @@ if (referenceIds.length > 0) {
|
|
131
133
|
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
132
134
|
case lrnQuestionTypesENUM.essayResponse:
|
133
135
|
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
+
case lrnQuestionTypesENUM.drawingResponse:
|
134
137
|
return;
|
135
138
|
default: throw new Error('Invalid lrn question type');
|
136
139
|
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
const drawingToolbarOptionsENUM = {
|
2
|
+
"Scribble": "Scribble",
|
3
|
+
"Line": "line",
|
4
|
+
"Compass": "compass",
|
5
|
+
"Eraser": "item eraser",
|
6
|
+
"Clear": "clear all",
|
7
|
+
"Undo": "undo",
|
8
|
+
"Redo": "redo",
|
9
|
+
"Text": "text",
|
10
|
+
}
|
11
|
+
|
12
|
+
export default drawingToolbarOptionsENUM;
|
@@ -17,6 +17,9 @@ export const lrnPage = {
|
|
17
17
|
essayResponseFooter: () => cy.get('.lrn-toolbar-footer'),
|
18
18
|
essayResponseToolbarWordCountWrapper: () => cy.get('.lrn_toolbar_right'),
|
19
19
|
essayResponseWordLimit: () => cy.get('.lrn_word_limit'),
|
20
|
+
drawingToolbar: () => cy.get('.lrn_toolbar'),
|
21
|
+
drawingToolbarButton: () => cy.get('.lrn_btn'),
|
22
|
+
drawingCanvasImage: () => cy.get('.lrn-canvas-container .lrn-image-source'),
|
20
23
|
steps: {
|
21
24
|
checkShowAnswersToggle: () => {
|
22
25
|
lrnPage.showAnswersToggle()
|
@@ -328,6 +331,41 @@ export const extractLrnQuestionData = {
|
|
328
331
|
});
|
329
332
|
lrnQuestionDataArr.push(obj);
|
330
333
|
},
|
334
|
+
|
335
|
+
drawingResponse: (lrnQuestionDataArr, index) => {
|
336
|
+
let obj = {};
|
337
|
+
cy.log(`Extracting the question instructions and options from question ${index}`);
|
338
|
+
obj.questionIndex = index;
|
339
|
+
obj.questionType = 'drawingResponse'
|
340
|
+
lrnPage.questionWrapper()
|
341
|
+
.eq(index)
|
342
|
+
.within(() => {
|
343
|
+
lrnPage.questionInstructions()
|
344
|
+
.then(($ins) => {
|
345
|
+
let text = $ins[0].innerText;
|
346
|
+
obj.previewQuestionInstructions = text;
|
347
|
+
});
|
348
|
+
let toolbarButtons = [];
|
349
|
+
lrnPage.drawingToolbar()
|
350
|
+
.eq(0)
|
351
|
+
.within(() => {
|
352
|
+
lrnPage.drawingToolbarButton()
|
353
|
+
.each(($button) => {
|
354
|
+
let ariaLabel = $button[0].attributes["aria-label"].nodeValue;
|
355
|
+
toolbarButtons.push(ariaLabel);
|
356
|
+
});
|
357
|
+
});
|
358
|
+
obj.toolbarButtons = toolbarButtons;
|
359
|
+
lrnPage.drawingCanvasImage()
|
360
|
+
.then(($img) => {
|
361
|
+
let backgroundCanvasImage = $img[0].alt;
|
362
|
+
obj.backgroundCanvasImage = backgroundCanvasImage;
|
363
|
+
let backgroundImageWidth = $img[0].style.width;
|
364
|
+
obj.backgroundImageWidth = backgroundImageWidth;
|
365
|
+
});
|
366
|
+
});
|
367
|
+
lrnQuestionDataArr.push(obj);
|
368
|
+
},
|
331
369
|
/* singleSelection: (lrnQuestionDataArr, index) => {
|
332
370
|
let obj = {};
|
333
371
|
cy.log(`Extracting the question instructions and options from question ${index}`);
|
@@ -4,6 +4,7 @@ const lrnQuestionTypesENUM = {
|
|
4
4
|
textEntryMathImage: 'Cloze math with image',
|
5
5
|
essayResponse: 'essayResponse',
|
6
6
|
essayResponseBasic: 'Essay with plain text',
|
7
|
+
drawingResponse: 'Drawing',
|
7
8
|
singleSelection: 'Multiple choice – standard',
|
8
9
|
multipleSelection: 'Multiple choice – multiple response',
|
9
10
|
trueOrFalse: 'True or false',
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { essayResponsePage, multipleSelectionPage } from "../../pages";
|
2
2
|
import { singleSelectionPage } from "../../pages/singleSelectionPage"
|
3
3
|
import utilities from "../helpers/utilities";
|
4
|
+
import drawingToolbarOptionsENUM from "./drawingToolbarOptionsENUM";
|
4
5
|
import essayResponseToolbarOptionsENUM from "./essayResponseToolbarOptionsENUM";
|
5
6
|
|
6
7
|
export const iePage = {
|
@@ -16,6 +17,8 @@ export const iePage = {
|
|
16
17
|
essayResponseWordLimit: () => cy.get('.input-limit-label'),
|
17
18
|
essayResponseWordCount: () => cy.get('[class*="indexstyle__WordCharCountWrapper"]'),
|
18
19
|
essayResponseFooter: () => cy.get('.essay-character-view-wrapper'),
|
20
|
+
drawingResponseToolbarButton: () => cy.get('[class*="DrawingToolButtonstyled__Container"] svg'),
|
21
|
+
drawingResponseLowerCanvas: () => cy.get('.lower-canvas'),
|
19
22
|
};
|
20
23
|
|
21
24
|
export const verifyIeQuestionData = {
|
@@ -228,6 +231,35 @@ export const verifyIeQuestionData = {
|
|
228
231
|
});
|
229
232
|
},
|
230
233
|
|
234
|
+
drawingResponse: (expectedQuestionData, index) => {
|
235
|
+
cy.get('[class*="DrawingResponsePreviewstyles__Question"]')
|
236
|
+
.eq(index)
|
237
|
+
.within(() => {
|
238
|
+
utilities.verifyInnerText(singleSelectionPage.questionInstructionsText(), expectedQuestionData.previewQuestionInstructions);
|
239
|
+
let ieButtonsActual = [];
|
240
|
+
let ieButtonsExpected = expectedQuestionData.toolbarButtons.map((button) => {
|
241
|
+
return drawingToolbarOptionsENUM[button];
|
242
|
+
});
|
243
|
+
iePage.drawingResponseToolbarButton()
|
244
|
+
.each(($button) => {
|
245
|
+
let ariaLabel = $button[0].attributes["aria-label"].nodeValue;
|
246
|
+
ieButtonsActual.push(ariaLabel);
|
247
|
+
}).then(() => {
|
248
|
+
expect(ieButtonsActual).to.have.deep.members(ieButtonsExpected);
|
249
|
+
});
|
250
|
+
iePage.drawingResponseLowerCanvas()
|
251
|
+
.then(($canvas) => {
|
252
|
+
let ariaLabel = $canvas[0].attributes["aria-label"].nodeValue;
|
253
|
+
if (expectedQuestionData.backgroundCanvasImage) {
|
254
|
+
expect(ariaLabel).to.be.eq(expectedQuestionData.backgroundCanvasImage);
|
255
|
+
} else {
|
256
|
+
expect(ariaLabel).to.be.eq('Image');
|
257
|
+
}
|
258
|
+
//need to verify backgroundImageWidth currently it is varying in all drawing response migrated items
|
259
|
+
});
|
260
|
+
});
|
261
|
+
},
|
262
|
+
|
231
263
|
/* singleSelection: (expectedQuestionData, index) => {
|
232
264
|
cy.get('.ngie-single-select')
|
233
265
|
.eq(index)
|