itemengine-cypress-automation 1.0.117 → 1.0.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/config-files/ilprod.json +3 -1
- package/cypress/config-files/ilqa.json +3 -1
- package/cypress/e2e/migration/migration.js +9 -2
- package/cypress/e2e/migration/migration2.js +7 -0
- package/cypress/e2e/migration/migration3.js +7 -0
- package/cypress/e2e/migration/migration4.js +7 -0
- package/cypress/e2e/migration/migration5.js +7 -0
- package/cypress/support/commands.js +3 -3
- package/cypress/support/migrationHelpers/extractLrnQuestionData.js +108 -1
- package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +2 -1
- package/cypress/support/migrationHelpers/verifyIeQuestionData.js +37 -0
- package/package.json +1 -1
@@ -10,6 +10,8 @@
|
|
10
10
|
"scriptSrc": "https://assets.itemengine-prod.il-apps.com/Author.loader.js",
|
11
11
|
"admin_username": "demouser-ilc",
|
12
12
|
"admin_password": "GzL1Ezjou4wVFL8o",
|
13
|
-
"organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315"
|
13
|
+
"organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315",
|
14
|
+
"migration_usernme": "ilc-prod-content-user",
|
15
|
+
"migration_password": "Oj2kTWQM7ZRmegmS"
|
14
16
|
}
|
15
17
|
}
|
@@ -10,6 +10,8 @@
|
|
10
10
|
"scriptSrc": "https://assets.itemengine-qa.il-apps.com/Author.loader.js",
|
11
11
|
"admin_username": "demouser-ilc",
|
12
12
|
"admin_password": "GtOrLiig9surpeW1",
|
13
|
-
"organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315"
|
13
|
+
"organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315",
|
14
|
+
"migration_usernme": "demo-technical-tester",
|
15
|
+
"migration_password": "SXYeokWOoTuwEg2w"
|
14
16
|
}
|
15
17
|
}
|
@@ -34,14 +34,14 @@ 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');//["textEntryMath"]
|
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
|
|
41
41
|
let lrnQuestionDataArr = [];
|
42
42
|
let lrnGradingDataArr = [];
|
43
43
|
|
44
|
-
let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(0, 100)
|
44
|
+
let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(0, 100);//["eae30254-8637-4b59-a124-1b0caa68bc6e", "5acb0056-3d16-46d7-abbb-7a1ce08686ef", "6bd0f709-86c5-4e52-9510-9af3cd73e224"]
|
45
45
|
|
46
46
|
if (referenceIds.length > 0) {
|
47
47
|
describe('Migration item check for MCQ questions', () => {
|
@@ -76,9 +76,13 @@ if (referenceIds.length > 0) {
|
|
76
76
|
if (lrnMcqTypesRegex.test(currQuestionType)) {
|
77
77
|
currQuestionType = lrnQuestionTypesENUM.mcq
|
78
78
|
}
|
79
|
+
if (currQuestionType.includes(lrnQuestionTypesENUM.textEntryMath)) {
|
80
|
+
currQuestionType = lrnQuestionTypesENUM.textEntryMath
|
81
|
+
}
|
79
82
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
80
83
|
switch (currQuestionType) {
|
81
84
|
case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcq(lrnQuestionDataArr, index);
|
85
|
+
case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMath(lrnQuestionDataArr, index);
|
82
86
|
default: throw new Error('Invalid lrn question type');
|
83
87
|
}
|
84
88
|
}
|
@@ -93,6 +97,7 @@ if (referenceIds.length > 0) {
|
|
93
97
|
cy.log(`Verifying data for ${questionType} ${index}`);
|
94
98
|
switch (questionType) {
|
95
99
|
case 'mcq': return verifyIeQuestionData.mcq(questionData, index);
|
100
|
+
case 'textEntryMath': return verifyIeQuestionData.textEntryMath(questionData, index);
|
96
101
|
default: throw new Error('Invalid ngie question type');
|
97
102
|
}
|
98
103
|
});
|
@@ -110,6 +115,7 @@ if (referenceIds.length > 0) {
|
|
110
115
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
111
116
|
switch (currQuestionType) {
|
112
117
|
case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
118
|
+
case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
113
119
|
default: throw new Error('Invalid lrn question type');
|
114
120
|
}
|
115
121
|
}
|
@@ -126,6 +132,7 @@ if (referenceIds.length > 0) {
|
|
126
132
|
cy.log(`Verifying grading data for ${questionType} ${index}`);
|
127
133
|
switch (questionType) {
|
128
134
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
135
|
+
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
129
136
|
default: throw new Error('Invalid ngie question type');
|
130
137
|
}
|
131
138
|
});
|
@@ -76,9 +76,13 @@ if (referenceIds.length > 0) {
|
|
76
76
|
if (lrnMcqTypesRegex.test(currQuestionType)) {
|
77
77
|
currQuestionType = lrnQuestionTypesENUM.mcq
|
78
78
|
}
|
79
|
+
if (currQuestionType.includes(lrnQuestionTypesENUM.textEntryMath)) {
|
80
|
+
currQuestionType = lrnQuestionTypesENUM.textEntryMath
|
81
|
+
}
|
79
82
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
80
83
|
switch (currQuestionType) {
|
81
84
|
case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcq(lrnQuestionDataArr, index);
|
85
|
+
case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMath(lrnQuestionDataArr, index);
|
82
86
|
default: throw new Error('Invalid lrn question type');
|
83
87
|
}
|
84
88
|
}
|
@@ -93,6 +97,7 @@ if (referenceIds.length > 0) {
|
|
93
97
|
cy.log(`Verifying data for ${questionType} ${index}`);
|
94
98
|
switch (questionType) {
|
95
99
|
case 'mcq': return verifyIeQuestionData.mcq(questionData, index);
|
100
|
+
case 'textEntryMath': return verifyIeQuestionData.textEntryMath(questionData, index);
|
96
101
|
default: throw new Error('Invalid ngie question type');
|
97
102
|
}
|
98
103
|
});
|
@@ -110,6 +115,7 @@ if (referenceIds.length > 0) {
|
|
110
115
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
111
116
|
switch (currQuestionType) {
|
112
117
|
case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
118
|
+
case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
113
119
|
default: throw new Error('Invalid lrn question type');
|
114
120
|
}
|
115
121
|
}
|
@@ -126,6 +132,7 @@ if (referenceIds.length > 0) {
|
|
126
132
|
cy.log(`Verifying grading data for ${questionType} ${index}`);
|
127
133
|
switch (questionType) {
|
128
134
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
135
|
+
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
129
136
|
default: throw new Error('Invalid ngie question type');
|
130
137
|
}
|
131
138
|
});
|
@@ -76,9 +76,13 @@ if (referenceIds.length > 0) {
|
|
76
76
|
if (lrnMcqTypesRegex.test(currQuestionType)) {
|
77
77
|
currQuestionType = lrnQuestionTypesENUM.mcq
|
78
78
|
}
|
79
|
+
if (currQuestionType.includes(lrnQuestionTypesENUM.textEntryMath)) {
|
80
|
+
currQuestionType = lrnQuestionTypesENUM.textEntryMath
|
81
|
+
}
|
79
82
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
80
83
|
switch (currQuestionType) {
|
81
84
|
case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcq(lrnQuestionDataArr, index);
|
85
|
+
case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMath(lrnQuestionDataArr, index);
|
82
86
|
default: throw new Error('Invalid lrn question type');
|
83
87
|
}
|
84
88
|
}
|
@@ -93,6 +97,7 @@ if (referenceIds.length > 0) {
|
|
93
97
|
cy.log(`Verifying data for ${questionType} ${index}`);
|
94
98
|
switch (questionType) {
|
95
99
|
case 'mcq': return verifyIeQuestionData.mcq(questionData, index);
|
100
|
+
case 'textEntryMath': return verifyIeQuestionData.textEntryMath(questionData, index);
|
96
101
|
default: throw new Error('Invalid ngie question type');
|
97
102
|
}
|
98
103
|
});
|
@@ -110,6 +115,7 @@ if (referenceIds.length > 0) {
|
|
110
115
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
111
116
|
switch (currQuestionType) {
|
112
117
|
case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
118
|
+
case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
113
119
|
default: throw new Error('Invalid lrn question type');
|
114
120
|
}
|
115
121
|
}
|
@@ -126,6 +132,7 @@ if (referenceIds.length > 0) {
|
|
126
132
|
cy.log(`Verifying grading data for ${questionType} ${index}`);
|
127
133
|
switch (questionType) {
|
128
134
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
135
|
+
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
129
136
|
default: throw new Error('Invalid ngie question type');
|
130
137
|
}
|
131
138
|
});
|
@@ -76,9 +76,13 @@ if (referenceIds.length > 0) {
|
|
76
76
|
if (lrnMcqTypesRegex.test(currQuestionType)) {
|
77
77
|
currQuestionType = lrnQuestionTypesENUM.mcq
|
78
78
|
}
|
79
|
+
if (currQuestionType.includes(lrnQuestionTypesENUM.textEntryMath)) {
|
80
|
+
currQuestionType = lrnQuestionTypesENUM.textEntryMath
|
81
|
+
}
|
79
82
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
80
83
|
switch (currQuestionType) {
|
81
84
|
case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcq(lrnQuestionDataArr, index);
|
85
|
+
case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMath(lrnQuestionDataArr, index);
|
82
86
|
default: throw new Error('Invalid lrn question type');
|
83
87
|
}
|
84
88
|
}
|
@@ -93,6 +97,7 @@ if (referenceIds.length > 0) {
|
|
93
97
|
cy.log(`Verifying data for ${questionType} ${index}`);
|
94
98
|
switch (questionType) {
|
95
99
|
case 'mcq': return verifyIeQuestionData.mcq(questionData, index);
|
100
|
+
case 'textEntryMath': return verifyIeQuestionData.textEntryMath(questionData, index);
|
96
101
|
default: throw new Error('Invalid ngie question type');
|
97
102
|
}
|
98
103
|
});
|
@@ -110,6 +115,7 @@ if (referenceIds.length > 0) {
|
|
110
115
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
111
116
|
switch (currQuestionType) {
|
112
117
|
case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
118
|
+
case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
113
119
|
default: throw new Error('Invalid lrn question type');
|
114
120
|
}
|
115
121
|
}
|
@@ -126,6 +132,7 @@ if (referenceIds.length > 0) {
|
|
126
132
|
cy.log(`Verifying grading data for ${questionType} ${index}`);
|
127
133
|
switch (questionType) {
|
128
134
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
135
|
+
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
129
136
|
default: throw new Error('Invalid ngie question type');
|
130
137
|
}
|
131
138
|
});
|
@@ -76,9 +76,13 @@ if (referenceIds.length > 0) {
|
|
76
76
|
if (lrnMcqTypesRegex.test(currQuestionType)) {
|
77
77
|
currQuestionType = lrnQuestionTypesENUM.mcq
|
78
78
|
}
|
79
|
+
if (currQuestionType.includes(lrnQuestionTypesENUM.textEntryMath)) {
|
80
|
+
currQuestionType = lrnQuestionTypesENUM.textEntryMath
|
81
|
+
}
|
79
82
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
80
83
|
switch (currQuestionType) {
|
81
84
|
case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcq(lrnQuestionDataArr, index);
|
85
|
+
case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMath(lrnQuestionDataArr, index);
|
82
86
|
default: throw new Error('Invalid lrn question type');
|
83
87
|
}
|
84
88
|
}
|
@@ -93,6 +97,7 @@ if (referenceIds.length > 0) {
|
|
93
97
|
cy.log(`Verifying data for ${questionType} ${index}`);
|
94
98
|
switch (questionType) {
|
95
99
|
case 'mcq': return verifyIeQuestionData.mcq(questionData, index);
|
100
|
+
case 'textEntryMath': return verifyIeQuestionData.textEntryMath(questionData, index);
|
96
101
|
default: throw new Error('Invalid ngie question type');
|
97
102
|
}
|
98
103
|
});
|
@@ -110,6 +115,7 @@ if (referenceIds.length > 0) {
|
|
110
115
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
111
116
|
switch (currQuestionType) {
|
112
117
|
case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
118
|
+
case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
113
119
|
default: throw new Error('Invalid lrn question type');
|
114
120
|
}
|
115
121
|
}
|
@@ -126,6 +132,7 @@ if (referenceIds.length > 0) {
|
|
126
132
|
cy.log(`Verifying grading data for ${questionType} ${index}`);
|
127
133
|
switch (questionType) {
|
128
134
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
135
|
+
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
129
136
|
default: throw new Error('Invalid ngie question type');
|
130
137
|
}
|
131
138
|
});
|
@@ -33,8 +33,8 @@ Cypress.Commands.add('loginAs', (roleName = 'admin') => {
|
|
33
33
|
var username = `${Cypress.env('admin_username')}`;
|
34
34
|
var password = `${Cypress.env('admin_password')}`
|
35
35
|
} else if (roleName === 'technicalTester') {
|
36
|
-
var username =
|
37
|
-
var password = `
|
36
|
+
var username = `${Cypress.env('migration_usernme')}`;
|
37
|
+
var password = `${Cypress.env('migration_password')}`
|
38
38
|
}
|
39
39
|
cy.logout();
|
40
40
|
cy.request({
|
@@ -115,7 +115,7 @@ Cypress.Commands.add('pageLoadWait', (operationName = null) => {
|
|
115
115
|
} else {
|
116
116
|
cy.wait(`@${operationName}`);
|
117
117
|
}
|
118
|
-
cy.get('.MuiCircularProgress-svg'
|
118
|
+
cy.get('.MuiCircularProgress-svg')
|
119
119
|
.should('not.be.visible');
|
120
120
|
});
|
121
121
|
|
@@ -6,6 +6,10 @@ export const lrnPage = {
|
|
6
6
|
mcqOptionContent: () => cy.get('.lrn_contentWrapper'),
|
7
7
|
questionsLoader: () => cy.get('.lrn-spinner'),
|
8
8
|
showAnswersToggle: () => cy.get('.lrn-author-validate-questions-toggle'),
|
9
|
+
clozeMathResponseWrapper: () => cy.get('.lrn_cloze_response_container'),
|
10
|
+
clozeMathResponse: () => cy.get('.lrn_cloze_response'),
|
11
|
+
clozeMathCorrectAnswerMathMl: () => cy.get('.lrn_correctAnswerList math'),
|
12
|
+
correctAnswersResponseText: () => cy.get('.lrn_responseText'),
|
9
13
|
steps: {
|
10
14
|
checkShowAnswersToggle: () => {
|
11
15
|
lrnPage.showAnswersToggle()
|
@@ -82,6 +86,109 @@ export const extractLrnQuestionData = {
|
|
82
86
|
lrnGradingDataArr.push(obj);
|
83
87
|
},
|
84
88
|
|
89
|
+
singleSelectionGrading: (lrnGradingDataArr, index) => {
|
90
|
+
let obj = {};
|
91
|
+
cy.log(`Extracting the question instructions, options and correct answers from question ${index}`);
|
92
|
+
obj.questionIndex = index;
|
93
|
+
obj.questionType = 'singleSelection'
|
94
|
+
lrnPage.questionWrapper()
|
95
|
+
.eq(index)
|
96
|
+
.within(() => {
|
97
|
+
lrnPage.questionInstructions()
|
98
|
+
.then(($ins) => {
|
99
|
+
let text = $ins[0].innerText;
|
100
|
+
obj.gradingQuestionInstructions = text;
|
101
|
+
});
|
102
|
+
|
103
|
+
let optionsText = [];
|
104
|
+
let correctAnswersIndex = [];
|
105
|
+
lrnPage.mcqOptionWrapper()
|
106
|
+
.each(($optionWrapper, index) => {
|
107
|
+
if ($optionWrapper[0].className.includes('lrn_valid')) {
|
108
|
+
correctAnswersIndex.push(index)
|
109
|
+
}
|
110
|
+
cy.wrap($optionWrapper)
|
111
|
+
.within(() => {
|
112
|
+
lrnPage.mcqOptionContent()
|
113
|
+
.then(($el) => {
|
114
|
+
optionsText.push($el[0].innerText);
|
115
|
+
});
|
116
|
+
});
|
117
|
+
});
|
118
|
+
obj.gradingOptionsText = optionsText;
|
119
|
+
obj.correctAnswersIndex = correctAnswersIndex;
|
120
|
+
});
|
121
|
+
lrnGradingDataArr.push(obj);
|
122
|
+
},
|
123
|
+
|
124
|
+
textEntryMath: (lrnQuestionDataArr, index) => {
|
125
|
+
let obj = {};
|
126
|
+
cy.log(`Extracting the question instructions, question and response count from question ${index}`);
|
127
|
+
obj.questionIndex = index;
|
128
|
+
obj.questionType = 'textEntryMath';
|
129
|
+
lrnPage.questionWrapper()
|
130
|
+
.eq(index)
|
131
|
+
.within(() => {
|
132
|
+
lrnPage.questionInstructions()
|
133
|
+
.then(($ins) => {
|
134
|
+
let text = $ins[0].innerText;
|
135
|
+
obj.previewQuestionInstructions = text;
|
136
|
+
});
|
137
|
+
lrnPage.clozeMathResponseWrapper()
|
138
|
+
.then(($question) => {
|
139
|
+
let innerText = $question[0].innerText;
|
140
|
+
obj.previewQuestion = innerText;
|
141
|
+
});
|
142
|
+
lrnPage.clozeMathResponse()
|
143
|
+
.then(($responseFields) => {
|
144
|
+
obj.previewResponseCount = $responseFields.length;
|
145
|
+
});
|
146
|
+
});
|
147
|
+
lrnQuestionDataArr.push(obj);
|
148
|
+
},
|
149
|
+
|
150
|
+
textEntryMathGrading: (lrnGradingDataArr, index) => {
|
151
|
+
let obj = {};
|
152
|
+
cy.log(`Extracting the question instructions, question, response count and correct responses from question ${index}`);
|
153
|
+
obj.questionIndex = index;
|
154
|
+
obj.questionType = 'textEntryMath';
|
155
|
+
lrnPage.questionWrapper()
|
156
|
+
.eq(index)
|
157
|
+
.within(() => {
|
158
|
+
lrnPage.questionInstructions()
|
159
|
+
.then(($ins) => {
|
160
|
+
let text = $ins[0].innerText;
|
161
|
+
obj.gradingQuestionInstructions = text;
|
162
|
+
});
|
163
|
+
lrnPage.clozeMathResponseWrapper()
|
164
|
+
.then(($question) => {
|
165
|
+
let innerText = $question[0].innerText;
|
166
|
+
obj.gradingQuestion = innerText;
|
167
|
+
});
|
168
|
+
lrnPage.clozeMathResponse()
|
169
|
+
.then(($responseFields) => {
|
170
|
+
obj.gradingResponseCount = $responseFields.length;
|
171
|
+
});
|
172
|
+
const correctAnswersMathMl = [];
|
173
|
+
const correctAnswersText = [];
|
174
|
+
lrnPage.clozeMathCorrectAnswerMathMl()
|
175
|
+
.each(($element) => {
|
176
|
+
let outerHtml = $element[0].outerHTML;
|
177
|
+
correctAnswersMathMl.push(outerHtml);
|
178
|
+
});
|
179
|
+
lrnPage.correctAnswersResponseText()
|
180
|
+
.each(($element) => {
|
181
|
+
let innerText = $element[0].innerText;
|
182
|
+
correctAnswersText.push(innerText);
|
183
|
+
});
|
184
|
+
obj.correctAnswersMathMl = correctAnswersMathMl;
|
185
|
+
obj.correctAnswersText = correctAnswersText;
|
186
|
+
//extract math outerhtml
|
187
|
+
//extract response text and outer html, verify it with the other one
|
188
|
+
});
|
189
|
+
lrnGradingDataArr.push(obj);
|
190
|
+
},
|
191
|
+
|
85
192
|
essayResponseMath: (lrnQuestionDataArr, index) => {
|
86
193
|
let obj = {};
|
87
194
|
cy.log(`Extracting the question instructions and options from question ${index}`);
|
@@ -95,7 +202,7 @@ export const extractLrnQuestionData = {
|
|
95
202
|
let text = $ins[0].innerText;
|
96
203
|
obj.previewQuestionInstructions = text;
|
97
204
|
});
|
98
|
-
})
|
205
|
+
});
|
99
206
|
lrnQuestionDataArr.push(obj);
|
100
207
|
},
|
101
208
|
|
@@ -1,9 +1,10 @@
|
|
1
1
|
const lrnQuestionTypesENUM = {
|
2
2
|
mcq: 'mcq',
|
3
|
+
textEntryMath: 'Cloze math',
|
4
|
+
essayResponseMath: 'Math essay with rich text',
|
3
5
|
singleSelection: 'Multiple choice – standard',
|
4
6
|
multipleSelection: 'Multiple choice – multiple response',
|
5
7
|
trueOrFalse: 'True or false',
|
6
|
-
essayResponseMath: 'Math essay with rich text',
|
7
8
|
}
|
8
9
|
|
9
10
|
export default lrnQuestionTypesENUM;
|
@@ -7,6 +7,10 @@ export const iePage = {
|
|
7
7
|
mcqOptionWrapper: () => cy.get('div[class*="option-wrapper"]'),
|
8
8
|
questionWrapper: () => cy.get('.ngie-question-wrapper'),
|
9
9
|
barsPreloader: () => cy.get('[id="question-item-instruction-loader"]'),
|
10
|
+
previewQuestionTextWrapper: () => cy.get('.preview-question-text-wrapper'),
|
11
|
+
textEntryMathResponseWrapper: () => cy.get('.preview-question-text-wrapper .cloze-response-wrapper '),
|
12
|
+
textEntryMathCorrectAnswerMathMl: () => cy.get('.ngie_latex math'),
|
13
|
+
textEntryMathCorrectAnswersResponseText: () => cy.get('.ngie_latex'),
|
10
14
|
};
|
11
15
|
|
12
16
|
export const verifyIeQuestionData = {
|
@@ -68,7 +72,40 @@ export const verifyIeQuestionData = {
|
|
68
72
|
|
69
73
|
|
70
74
|
textEntryMath: (expectedQuestionData, index) => {
|
75
|
+
cy.get('.cloze-math-preview-wrapper')
|
76
|
+
.eq(index)
|
77
|
+
.within(() => {
|
78
|
+
utilities.verifyInnerText(singleSelectionPage.questionInstructionsText(), expectedQuestionData.previewQuestionInstructions);
|
79
|
+
utilities.verifyInnerText(iePage.previewQuestionTextWrapper(), expectedQuestionData.previewQuestion);
|
80
|
+
iePage.textEntryMathResponseWrapper()
|
81
|
+
.then(($resposneWrapper) => {
|
82
|
+
expect($resposneWrapper.length).to.be.eq(expectedQuestionData.previewResponseCount);
|
83
|
+
});
|
84
|
+
});
|
85
|
+
},
|
71
86
|
|
87
|
+
textEntryMathGrading: (expectedQuestionData, index) => {
|
88
|
+
cy.get('.cloze-math-preview-wrapper')
|
89
|
+
.eq(index)
|
90
|
+
.parents('.ngie-question-wrapper')
|
91
|
+
.within(() => {
|
92
|
+
utilities.verifyInnerText(singleSelectionPage.questionInstructionsText(), expectedQuestionData.gradingQuestionInstructions);
|
93
|
+
iePage.previewQuestionTextWrapper()
|
94
|
+
.should('exist');
|
95
|
+
// utilities.verifyInnerText(iePage.previewQuestionTextWrapper(), expectedQuestionData.gradingQuestion);
|
96
|
+
iePage.textEntryMathResponseWrapper()
|
97
|
+
.then(($resposneWrapper) => {
|
98
|
+
expect($resposneWrapper.length).to.be.eq(expectedQuestionData.gradingResponseCount);
|
99
|
+
});
|
100
|
+
iePage.textEntryMathCorrectAnswerMathMl()
|
101
|
+
.each(($element, index) => {
|
102
|
+
expect($element.get(0).outerHTML).to.deep.eq(expectedQuestionData.correctAnswersMathMl[index]);
|
103
|
+
});
|
104
|
+
iePage.textEntryMathCorrectAnswersResponseText()
|
105
|
+
.each(($element, index) => {
|
106
|
+
utilities.verifyInnerText(cy.wrap($element), expectedQuestionData.correctAnswersText[index]);
|
107
|
+
});
|
108
|
+
});
|
72
109
|
},
|
73
110
|
|
74
111
|
essayResponseMath: (expectedQuestionData, index) => {
|