itemengine-cypress-automation 1.0.573-IEI-7065-Improve-test-coverage-for-essay-response-c25d1ee.0 → 1.0.573
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/e2e/ILC/EssayResponse/additionalSettings.js +2 -8
- package/cypress/e2e/ILC/EssayResponse/additionalSettingsBasic.js +0 -15
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +1 -14
- package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +5 -155
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +4 -116
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +0 -93
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +0 -114
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -11
- package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +2 -29
- package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +1 -11
- package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +0 -75
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +0 -13
- package/cypress/e2e/ILC/EssayResponse/studentViewSettings.js +0 -71
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +108 -7
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +108 -7
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +108 -7
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +123 -8
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +123 -8
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +123 -8
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +108 -7
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +93 -6
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +108 -7
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +23 -2
- package/cypress/pages/components/equationEditorSectionCommonComponent.js +0 -21
- package/cypress/pages/components/essayResponseCommonComponents.js +1 -20
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +36 -0
- package/cypress/pages/essayResponsePage.js +0 -2
- package/package.json +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { fillInTheGapsTextPage } from "../../../../pages";
|
|
2
|
+
import { showAlternativeAnswersComponent } from "../../../../pages/components";
|
|
2
3
|
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
|
3
4
|
|
|
5
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
6
|
+
|
|
4
7
|
describe('Create item page - Fill in the gaps with text: Partial equal with alternative answers', () => {
|
|
5
8
|
before(() => {
|
|
6
9
|
cy.loginAs('admin');
|
|
@@ -25,7 +28,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal with alte
|
|
|
25
28
|
it('When the user selects \'Grading\' view without attempting the question, response area numeration should be displayed, correct answers section should be displayed with correct answers from the correct accordion and respective response area numeration', () => {
|
|
26
29
|
fillInTheGapsTextPage.steps.switchToGradingView();
|
|
27
30
|
fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
|
|
28
|
-
|
|
31
|
+
if (alternativeAnswerCheck) {
|
|
32
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
33
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
34
|
+
{
|
|
35
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
36
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
40
|
+
points: ['(15 points)', '(5 points)', '(5 point)', '(5 points)'],
|
|
41
|
+
}
|
|
42
|
+
]);
|
|
43
|
+
} else {
|
|
44
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
45
|
+
}
|
|
29
46
|
});
|
|
30
47
|
|
|
31
48
|
it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, correct/incorrect status message and correct answer section should not be displayed', () => {
|
|
@@ -77,7 +94,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal with alte
|
|
|
77
94
|
fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
|
|
78
95
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
|
|
79
96
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
80
|
-
|
|
97
|
+
if (alternativeAnswerCheck) {
|
|
98
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
99
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
100
|
+
{
|
|
101
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
102
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
106
|
+
points: ['(15 points)', '(5 points)', '(5 point)', '(5 points)'],
|
|
107
|
+
}
|
|
108
|
+
]);
|
|
109
|
+
} else {
|
|
110
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
111
|
+
}
|
|
81
112
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
82
113
|
/*cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message and correct answer section should not be displayed')
|
|
83
114
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -97,7 +128,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal with alte
|
|
|
97
128
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
|
|
98
129
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
|
|
99
130
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
100
|
-
|
|
131
|
+
if (alternativeAnswerCheck) {
|
|
132
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
133
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
134
|
+
{
|
|
135
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
136
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
140
|
+
points: ['(15 points)', '(5 points)', '(5 point)', '(5 points)'],
|
|
141
|
+
}
|
|
142
|
+
]);
|
|
143
|
+
} else {
|
|
144
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
145
|
+
}
|
|
101
146
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
102
147
|
/*cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section should not be displayed')
|
|
103
148
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -116,7 +161,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal with alte
|
|
|
116
161
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
|
|
117
162
|
fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
|
|
118
163
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
119
|
-
|
|
164
|
+
if (alternativeAnswerCheck) {
|
|
165
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
166
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
167
|
+
{
|
|
168
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
169
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
173
|
+
points: ['(15 points)', '(5 points)', '(5 point)', '(5 points)'],
|
|
174
|
+
}
|
|
175
|
+
]);
|
|
176
|
+
} else {
|
|
177
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
178
|
+
}
|
|
120
179
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
121
180
|
/*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses, correct/incorrect status message and correct answer section should not be displayed')
|
|
122
181
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -135,7 +194,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal with alte
|
|
|
135
194
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
|
|
136
195
|
fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
|
|
137
196
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
138
|
-
|
|
197
|
+
if (alternativeAnswerCheck) {
|
|
198
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
199
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
200
|
+
{
|
|
201
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
202
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
206
|
+
points: ['(15 points)', '(5 points)', '(5 point)', '(5 points)'],
|
|
207
|
+
}
|
|
208
|
+
]);
|
|
209
|
+
} else {
|
|
210
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
211
|
+
}
|
|
139
212
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
140
213
|
/*cy.log('When the user has attempted the question with the common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section should not be displayed')
|
|
141
214
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -155,7 +228,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal with alte
|
|
|
155
228
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
|
|
156
229
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
|
|
157
230
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
158
|
-
|
|
231
|
+
if (alternativeAnswerCheck) {
|
|
232
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
233
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
234
|
+
{
|
|
235
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
236
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
240
|
+
points: ['(15 points)', '(5 points)', '(5 point)', '(5 points)'],
|
|
241
|
+
}
|
|
242
|
+
]);
|
|
243
|
+
} else {
|
|
244
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
245
|
+
}
|
|
159
246
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
160
247
|
/*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section should not be displayed')
|
|
161
248
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { fillInTheGapsTextPage } from "../../../../pages";
|
|
2
|
+
import { showAlternativeAnswersComponent } from "../../../../pages/components";
|
|
2
3
|
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
|
3
4
|
|
|
5
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
6
|
+
|
|
4
7
|
describe('Create item page - Fill in the gaps with text: Partial equal weights with alternative answers', () => {
|
|
5
8
|
before(() => {
|
|
6
9
|
cy.loginAs('admin');
|
|
@@ -25,7 +28,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal weights w
|
|
|
25
28
|
it('When the user selects \'Grading\' view without attempting the question, correct answers section should be displayed with correct answers from the correct accordion and respective response area numeration', () => {
|
|
26
29
|
fillInTheGapsTextPage.steps.switchToGradingView();
|
|
27
30
|
fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
|
|
28
|
-
|
|
31
|
+
if (alternativeAnswerCheck) {
|
|
32
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
33
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
34
|
+
{
|
|
35
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
36
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
40
|
+
points: ['(9 points)', '(3 points)', '(3 point)', '(3 points)'],
|
|
41
|
+
}
|
|
42
|
+
]);
|
|
43
|
+
} else {
|
|
44
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
45
|
+
}
|
|
29
46
|
});
|
|
30
47
|
|
|
31
48
|
it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, correct/incorrect and correct answer section should not be displayed', () => {
|
|
@@ -77,7 +94,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal weights w
|
|
|
77
94
|
fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
|
|
78
95
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
|
|
79
96
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
80
|
-
|
|
97
|
+
if (alternativeAnswerCheck) {
|
|
98
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
99
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
100
|
+
{
|
|
101
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
102
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
106
|
+
points: ['(9 points)', '(3 points)', '(3 point)', '(3 points)'],
|
|
107
|
+
}
|
|
108
|
+
]);
|
|
109
|
+
} else {
|
|
110
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
111
|
+
}
|
|
81
112
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
82
113
|
/*cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
|
83
114
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -97,7 +128,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal weights w
|
|
|
97
128
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
|
|
98
129
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
|
|
99
130
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
100
|
-
|
|
131
|
+
if (alternativeAnswerCheck) {
|
|
132
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
133
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
134
|
+
{
|
|
135
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
136
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
140
|
+
points: ['(9 points)', '(3 points)', '(3 point)', '(3 points)'],
|
|
141
|
+
}
|
|
142
|
+
]);
|
|
143
|
+
} else {
|
|
144
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
145
|
+
}
|
|
101
146
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
102
147
|
/*cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
|
103
148
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -117,7 +162,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal weights w
|
|
|
117
162
|
fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
|
|
118
163
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
|
|
119
164
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
120
|
-
|
|
165
|
+
if (alternativeAnswerCheck) {
|
|
166
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
167
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
168
|
+
{
|
|
169
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
170
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
174
|
+
points: ['(9 points)', '(3 points)', '(3 point)', '(3 points)'],
|
|
175
|
+
}
|
|
176
|
+
]);
|
|
177
|
+
} else {
|
|
178
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
179
|
+
}
|
|
121
180
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
122
181
|
/*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
|
123
182
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -137,7 +196,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal weights w
|
|
|
137
196
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
|
|
138
197
|
fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
|
|
139
198
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
140
|
-
|
|
199
|
+
if (alternativeAnswerCheck) {
|
|
200
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
201
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
202
|
+
{
|
|
203
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
204
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
208
|
+
points: ['(9 points)', '(3 points)', '(3 point)', '(3 points)'],
|
|
209
|
+
}
|
|
210
|
+
]);
|
|
211
|
+
} else {
|
|
212
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
213
|
+
}
|
|
141
214
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
142
215
|
/*cy.log('When the user has attempted the question with common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
|
143
216
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -157,7 +230,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal weights w
|
|
|
157
230
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
|
|
158
231
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
|
|
159
232
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
160
|
-
|
|
233
|
+
if (alternativeAnswerCheck) {
|
|
234
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
235
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
236
|
+
{
|
|
237
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
238
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
correctAnswers: [['Petals'],['Leaves'],['Stem']],
|
|
242
|
+
points: ['(9 points)', '(3 points)', '(3 point)', '(3 points)'],
|
|
243
|
+
}
|
|
244
|
+
]);
|
|
245
|
+
} else {
|
|
246
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
247
|
+
}
|
|
161
248
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
162
249
|
/*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
|
163
250
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -183,7 +270,21 @@ describe('Create item page - Fill in the gaps with text: Partial equal weights w
|
|
|
183
270
|
fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
|
|
184
271
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
|
|
185
272
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
186
|
-
|
|
273
|
+
if (alternativeAnswerCheck) {
|
|
274
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
275
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
276
|
+
{
|
|
277
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
278
|
+
points: ['(23 points)', '(7.67 points)', '(7.67 points)', '(7.67 points)'],
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
correctAnswers: [['Petals'],['Leaves'],['Branch']],
|
|
282
|
+
points: ['(5 points)', '(1.67 points)', '(1.67 point)', '(1.67 points)'],
|
|
283
|
+
}
|
|
284
|
+
]);
|
|
285
|
+
} else {
|
|
286
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
287
|
+
}
|
|
187
288
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
188
289
|
/*cy.log('When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response from the correct accordion overpowers the combined score of the alternative accordion answers and clicks on the \'Check answer\' button, correct icons should be displayed beside correct accordion responses, incorrect icons should be displayed for the alternative accordion responses, correct/incorrect answer status message and correct answer section should not be displayed')
|
|
189
290
|
fillInTheGapsTextPage.steps.checkAnswer();
|
package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { fillInTheGapsTextPage } from "../../../../pages";
|
|
2
|
+
import { showAlternativeAnswersComponent } from "../../../../pages/components";
|
|
2
3
|
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
|
3
4
|
import utilities from "../../../../support/helpers/utilities";
|
|
4
5
|
|
|
6
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
7
|
+
|
|
5
8
|
describe('Create item page - Fill in the gaps with text: Response level alternate answer basic scoring', () => {
|
|
6
9
|
before(() => {
|
|
7
10
|
cy.loginAs('admin');
|
|
@@ -27,7 +30,16 @@ describe('Create item page - Fill in the gaps with text: Response level alternat
|
|
|
27
30
|
fillInTheGapsTextPage.steps.switchToGradingView();
|
|
28
31
|
fillInTheGapsTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
29
32
|
fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
|
|
30
|
-
|
|
33
|
+
if (alternativeAnswerCheck) {
|
|
34
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
35
|
+
{
|
|
36
|
+
correctAnswers: [['Flower', 'Fruit']],
|
|
37
|
+
points: ['(15 points)'],
|
|
38
|
+
},
|
|
39
|
+
]);
|
|
40
|
+
} else {
|
|
41
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower']);
|
|
42
|
+
}
|
|
31
43
|
});
|
|
32
44
|
|
|
33
45
|
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed besides the incorrect response, a status message with text \'Your answer is incorrect\' and correct answer section with the first correct answer set in the response accordion should be displayed', () => {
|
|
@@ -36,7 +48,16 @@ describe('Create item page - Fill in the gaps with text: Response level alternat
|
|
|
36
48
|
fillInTheGapsTextPage.steps.switchToGradingView();
|
|
37
49
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
|
|
38
50
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
39
|
-
|
|
51
|
+
if (alternativeAnswerCheck) {
|
|
52
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
53
|
+
{
|
|
54
|
+
correctAnswers: [['Flower', 'Fruit']],
|
|
55
|
+
points: ['(15 points)'],
|
|
56
|
+
},
|
|
57
|
+
]);
|
|
58
|
+
} else {
|
|
59
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower']);
|
|
60
|
+
}
|
|
40
61
|
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
41
62
|
/*cy.log('When the user attempts the question incorrectly and clicks on \'Check answer\' button, incorrect icon should be displayed besides the incorrect response, a status message with text \'Your answer is incorrect\' should be displayed and correct answer section should not be displayed')
|
|
42
63
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import utilities from "../../support/helpers/utilities";
|
|
2
2
|
import { equationEditorCategoriesAndSymbols } from "../../fixtures/equationEditorCategoriesAndSymbols ";
|
|
3
3
|
import { equationEditorFlyout, commonComponents, essayResponseCommonComponents, createQuestionBasePage, autoScoredScoringPreviewTab } from "../components";
|
|
4
|
-
//import { essayResponsePage } from "../essayResponsePage";
|
|
5
4
|
const css = Cypress.env('css');
|
|
6
5
|
const allCategories = Object.values(equationEditorCategoriesAndSymbols)
|
|
7
6
|
const defaultSelectedCategories = ['Numpad', 'Keypad', 'Intermediate', 'Primary', 'General', 'Common', 'Algebra', 'Geo', 'Compare', 'Matrices'];
|
|
@@ -334,26 +333,6 @@ const tests = {
|
|
|
334
333
|
equationEditorSectionCommonComponent.steps.verifyResponseFieldEquationTextNew(0, 'x+5×0');
|
|
335
334
|
}
|
|
336
335
|
});
|
|
337
|
-
|
|
338
|
-
it('When user edits the added equation and clicks on Ok button, the edited equation should be displayed in the preview input field in item preview', () => {
|
|
339
|
-
if (questionType === 'essay response') {
|
|
340
|
-
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
341
|
-
essayResponsePage.steps.switchToPreviewTab();
|
|
342
|
-
equationEditorSectionCommonComponent.steps.openResponseFieldEquationContainerEquationEditor(0);
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
equationEditorSectionCommonComponent.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
|
346
|
-
}
|
|
347
|
-
equationEditorFlyout.steps.enterTextInPreviewInputField('{backspace}{backspace}');
|
|
348
|
-
equationEditorFlyout.steps.enterEquation([{ categoryName: 'numPad', symbolName: ['multiply', 'zero'] }]);
|
|
349
|
-
equationEditorFlyout.steps.clickOnOkButton();
|
|
350
|
-
if (questionType === 'essay response') {
|
|
351
|
-
equationEditorSectionCommonComponent.steps.verifyResponseFieldEquationText(0, 'x+5×0');
|
|
352
|
-
}
|
|
353
|
-
else {
|
|
354
|
-
equationEditorSectionCommonComponent.steps.verifyResponseFieldEquationTextNew(0, 'x+5×0');
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
336
|
},
|
|
358
337
|
|
|
359
338
|
/**
|
|
@@ -96,8 +96,7 @@ const selectors = {
|
|
|
96
96
|
customSpecialCharacterLabel: () => cy.get('[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]').eq(1),
|
|
97
97
|
customSpecialCharacterInputField: () => cy.get('input[aria-label="Custom Special Characters"]'),
|
|
98
98
|
limitReachedWarningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
|
|
99
|
-
limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]')
|
|
100
|
-
wordCharacterLimitWrapper: () => cy.get('.essay-character-view-wrapper')
|
|
99
|
+
limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]')
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
const steps = {
|
|
@@ -203,24 +202,6 @@ const steps = {
|
|
|
203
202
|
.should('be.checked');
|
|
204
203
|
},
|
|
205
204
|
|
|
206
|
-
unCheckAlwaysShowMinimumLimitCheckbox: () => {
|
|
207
|
-
essayResponseCommonComponents.alwaysShowMinLimitCheckBox()
|
|
208
|
-
.click()
|
|
209
|
-
.should('not.be.checked');
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
checkAlwaysShowMaximumLimitCheckbox: () => {
|
|
213
|
-
essayResponseCommonComponents.alwaysShowMaxLimitCheckbox()
|
|
214
|
-
.click()
|
|
215
|
-
.should('be.checked');
|
|
216
|
-
},
|
|
217
|
-
|
|
218
|
-
uncheckAlwaysShowMaximumLimitCheckbox: () => {
|
|
219
|
-
essayResponseCommonComponents.alwaysShowMaxLimitCheckbox()
|
|
220
|
-
.click()
|
|
221
|
-
.should('not.be.checked');
|
|
222
|
-
},
|
|
223
|
-
|
|
224
205
|
verifyListItemLengthInResponseField: (length) => {
|
|
225
206
|
essayResponseCommonComponents.responseField()
|
|
226
207
|
.find('li')
|
|
@@ -21,6 +21,7 @@ const selectors = {
|
|
|
21
21
|
responseStatusWrapper: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper:visible'),
|
|
22
22
|
correctAnswerResponseNumeration: () => cy.get('.answer-numeration-number-box'),
|
|
23
23
|
correctAnswerResponseWrapper: () => cy.get('[class*="ClozeWithTextResponsestyles__AnswerCell"]'),
|
|
24
|
+
correctAnswerPointsLabel: () => cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"] p'),
|
|
24
25
|
correctAnswerResponse: () => cy.get('[class*="AnswerWrapperForLabel"]'),
|
|
25
26
|
correctAnswerResponseWrapperWithoutEnumeration: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper [class*="ResponseInputWrapper"] input'),
|
|
26
27
|
|
|
@@ -185,6 +186,41 @@ const steps = {
|
|
|
185
186
|
});
|
|
186
187
|
},
|
|
187
188
|
|
|
189
|
+
/**
|
|
190
|
+
* Verify correct answer section with alternate answers.
|
|
191
|
+
*
|
|
192
|
+
* @param {Object[]} correctAnswerArray - An array of objects representing the expected correct answers and their corresponding points.
|
|
193
|
+
* @param {string[][]} correctAnswerArray[].correctAnswers - A nested array of correct answer text values.
|
|
194
|
+
* Each inner array represents a group of alternate correct answers for a particular text container.
|
|
195
|
+
* @param {string[]} correctAnswerArray[].points - An array of point label strings associated with each correct answer group.
|
|
196
|
+
*
|
|
197
|
+
*/
|
|
198
|
+
|
|
199
|
+
verifyCorrectAnswerSectionWithAlternateAnswer: (correctAnswerArray) => {
|
|
200
|
+
let responseIndex = 0;
|
|
201
|
+
let pointsLabelIndex = 0;
|
|
202
|
+
correctAnswerArray.forEach(({correctAnswers, points}) => {
|
|
203
|
+
correctAnswers.forEach((textContainers, index) => {
|
|
204
|
+
textContainers.forEach((correctAnswer) => {
|
|
205
|
+
fillInTheGapsTextCommonComponent.correctAnswerResponseWrapper()
|
|
206
|
+
.eq(responseIndex)
|
|
207
|
+
.within(() => {
|
|
208
|
+
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.correctAnswerResponseNumeration(), `${index + 1}`);
|
|
209
|
+
fillInTheGapsTextCommonComponent.correctAnswerResponse()
|
|
210
|
+
.should('have.text', correctAnswer);
|
|
211
|
+
});
|
|
212
|
+
responseIndex += 1;
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
points.forEach((pointsText) => {
|
|
216
|
+
fillInTheGapsTextCommonComponent.correctAnswerPointsLabel()
|
|
217
|
+
.eq(pointsLabelIndex)
|
|
218
|
+
.should('have.text', pointsText);
|
|
219
|
+
pointsLabelIndex += 1;
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
|
|
188
224
|
verifyCorrectAnswerSectionNotExists: () => {
|
|
189
225
|
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.correctAnswerSectionWrapper(), 'notExist');
|
|
190
226
|
},
|
|
@@ -19,7 +19,6 @@ const selectors = {
|
|
|
19
19
|
...customizeSpecialCharacterComponent,
|
|
20
20
|
...dialogBoxBase,
|
|
21
21
|
...equationEditorSectionCommonComponent,
|
|
22
|
-
...autoScoredScoringPreviewTab,
|
|
23
22
|
//Basic section
|
|
24
23
|
displayWordLimitLabel: () => cy.get('#Display-word-limit-dropdown-label'),
|
|
25
24
|
displayWordLimitDropdown: () => cy.get('#Display-word-limit-select'),
|
|
@@ -143,7 +142,6 @@ const steps = {
|
|
|
143
142
|
...dialogBoxBase.steps,
|
|
144
143
|
...equationEditorSectionCommonComponent.steps,
|
|
145
144
|
...createItemPage.steps,
|
|
146
|
-
...autoScoredScoringPreviewTab.steps,
|
|
147
145
|
|
|
148
146
|
clickOnSpecialCharactersPopupCloseButton: () => {
|
|
149
147
|
essayResponsePage.specialCharactersPopupCloseButton()
|