itemengine-cypress-automation 1.0.157-error-message-fix-944b14e.0 → 1.0.158-migrationScripts-2432c9a.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,19 @@ export const iePage = {
|
|
25
25
|
steps: {
|
26
26
|
verifyQuestionInstructions: (expectedQuestionData) => {
|
27
27
|
if (expectedQuestionData.previewQuestionInstructions) {
|
28
|
-
utilities.verifyInnerText(singleSelectionPage.questionInstructionsText(), expectedQuestionData.previewQuestionInstructions);
|
28
|
+
//utilities.verifyInnerText(singleSelectionPage.questionInstructionsText(), expectedQuestionData.previewQuestionInstructions);
|
29
|
+
// singleSelectionPage.questionInstructionsText().should(($element) => {
|
30
|
+
// let questionInstructions = $element.get(0).innerText;
|
31
|
+
// questionInstructions = questionInstructions.replace(/00:00\n\/\n00:00\n/g, '');
|
32
|
+
// console.log('questionInstructions', questionInstructions);
|
33
|
+
// expect(questionInstructions).to.deep.eq(expectedQuestionData.previewQuestionInstructions);
|
34
|
+
// });
|
35
|
+
singleSelectionPage.questionInstructionsText()
|
36
|
+
.then(($questionInstructions) => {
|
37
|
+
let questionInstructions = $questionInstructions.get(0).innerText
|
38
|
+
questionInstructions = questionInstructions.replace(/00:00\n\/\n00:00\n/g, '');
|
39
|
+
expect(questionInstructions).to.be.eq(expectedQuestionData.previewQuestionInstructions)
|
40
|
+
});
|
29
41
|
} else {
|
30
42
|
utilities.verifyInnerText(singleSelectionPage.questionInstructionsText(), '');
|
31
43
|
}
|
@@ -91,52 +103,80 @@ export const verifyIeQuestionData = {
|
|
91
103
|
},
|
92
104
|
|
93
105
|
textEntryMath: (expectedQuestionData, index) => {
|
106
|
+
const textEntryMathQuestionsArr = [];
|
94
107
|
cy.get('.cloze-math-preview-wrapper')
|
95
|
-
.
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
108
|
+
.each(($question) => {
|
109
|
+
console.log('$question', $question)
|
110
|
+
if (!$question[0].innerHTML.includes('label-image-with-text-preview')) {
|
111
|
+
textEntryMathQuestionsArr.push($question);
|
112
|
+
}
|
113
|
+
})
|
114
|
+
.then(() => {
|
115
|
+
cy.wrap(textEntryMathQuestionsArr[index])
|
116
|
+
.within(() => {
|
117
|
+
iePage.steps.verifyQuestionInstructions(expectedQuestionData);
|
118
|
+
utilities.verifyInnerText(iePage.previewQuestionTextWrapper(), expectedQuestionData.previewQuestion);
|
119
|
+
textEntryMathPage.answersInputField()
|
120
|
+
.then(($resposneWrapper) => {
|
121
|
+
expect($resposneWrapper.length).to.be.eq(expectedQuestionData.previewResponseCount);
|
122
|
+
});
|
102
123
|
});
|
103
124
|
});
|
125
|
+
// cy.get('.cloze-math-preview-wrapper')
|
126
|
+
// .eq(index)
|
127
|
+
// .within(() => {
|
128
|
+
// iePage.steps.verifyQuestionInstructions(expectedQuestionData);
|
129
|
+
// utilities.verifyInnerText(iePage.previewQuestionTextWrapper(), expectedQuestionData.previewQuestion);
|
130
|
+
// textEntryMathPage.answersInputField()
|
131
|
+
// .then(($resposneWrapper) => {
|
132
|
+
// expect($resposneWrapper.length).to.be.eq(expectedQuestionData.previewResponseCount);
|
133
|
+
// });
|
134
|
+
// });
|
104
135
|
},
|
105
136
|
|
106
137
|
textEntryMathGrading: (expectedQuestionData, index) => {
|
138
|
+
const textEntryMathQuestionsArr = [];
|
107
139
|
cy.get('.cloze-math-preview-wrapper')
|
108
|
-
.
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
.
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
.eq(
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
140
|
+
.each(($question) => {
|
141
|
+
console.log('$question', $question)
|
142
|
+
if (!$question[0].innerHTML.includes('label-image-with-text-preview')) {
|
143
|
+
textEntryMathQuestionsArr.push($question);
|
144
|
+
}
|
145
|
+
})
|
146
|
+
.then(() => {
|
147
|
+
cy.wrap(textEntryMathQuestionsArr[index])
|
148
|
+
.parents('.ngie-question-wrapper')
|
149
|
+
.within(() => {
|
150
|
+
iePage.steps.verifyQuestionInstructions(expectedQuestionData);
|
151
|
+
iePage.previewQuestionTextWrapper()
|
152
|
+
.should('exist');
|
153
|
+
//Not working due to numeration being displayed above responses in IE
|
154
|
+
// utilities.verifyInnerText(iePage.previewQuestionTextWrapper(), expectedQuestionData.gradingQuestion);
|
155
|
+
textEntryMathPage.answersInputField()
|
156
|
+
.then(($resposneWrapper) => {
|
157
|
+
expect($resposneWrapper.length).to.be.eq(expectedQuestionData.gradingResponseCount);
|
158
|
+
});
|
159
|
+
iePage.answerBlock()
|
160
|
+
.then(($answerBlock) => {
|
161
|
+
expect($answerBlock.length).to.be.eq(expectedQuestionData.gradingResponseCount);
|
162
|
+
});
|
163
|
+
iePage.answerBlock()
|
164
|
+
.each(($element, index) => {
|
165
|
+
//checking if there is any answer text, excluding the numeration
|
166
|
+
if (expectedQuestionData.correctAnswersText[index].length > 2) {
|
167
|
+
iePage.textEntryMathCorrectAnswerMathMl()
|
168
|
+
.eq(index)
|
169
|
+
.then(($element) => {
|
170
|
+
expect($element.get(0).outerHTML).to.deep.eq(expectedQuestionData.correctAnswersMathMl[index]);
|
171
|
+
});
|
172
|
+
}
|
173
|
+
});
|
174
|
+
iePage.answerBlock()
|
175
|
+
.each(($element, index) => {
|
176
|
+
utilities.verifyInnerText(cy.wrap($element), expectedQuestionData.correctAnswersText[index]);
|
177
|
+
});
|
138
178
|
});
|
139
|
-
})
|
179
|
+
})
|
140
180
|
},
|
141
181
|
|
142
182
|
textEntryMathImage: (expectedQuestionData, index) => {
|