itemengine-cypress-automation 1.0.13 → 1.0.15
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAdditionalSettings.js +830 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAutoScoredScoring.js +990 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridEditTabBasicSection.js +588 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridEditTabScoringSection.js +297 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridHeaderSection.js +98 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridManuallyAndNonScoredScoring.js +206 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialDifferentWeights.js +1152 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialEqualWeights.js +1108 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridRandomizeOptions.js +124 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridSetCorrectAnswerSection.js +175 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAdditionalSettings.js +2 -487
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAdditionalSettingsBasic.js +336 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseConditionalCheckboxes.js +154 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseContainsConditionalRadioButton.js +166 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseCustomSpecialCharacters.js +167 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseExactConditionalRadioButton.js +157 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseManuallyScoredNonScoredScoringSection.js +1 -1
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseSetCorrectAnswerSection.js +137 -0
- package/package.json +1 -1
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseEditTabBasicSections.js +0 -587
- package/cypress/e2e/ILC/sorry-cypress-test/spec1.js +0 -18
- package/cypress/e2e/ILC/sorry-cypress-test/spec2.js +0 -18
- package/cypress/e2e/ILC/sorry-cypress-test/spec3.js +0 -18
@@ -0,0 +1,990 @@
|
|
1
|
+
import { multipleSelectionGridPage } from "../../../pages/multipleSelectionGridPage";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
|
5
|
+
const questionStems = ['Bat', 'Ostrich', 'Platypus', 'Eagle'];
|
6
|
+
const options = ['Is mammal', 'Lays eggs', 'Can fly'];
|
7
|
+
|
8
|
+
describe('Create Item page - Multiple Selection Grid: Preview tab Scoring Section', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Show correct answer', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigating to multiple selection grid question type');
|
17
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
multipleSelectionGridPage.steps.addQuestionInstructions();
|
20
|
+
multipleSelectionGridPage.steps.addOption();
|
21
|
+
multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
22
|
+
multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
23
|
+
});
|
24
|
+
|
25
|
+
multipleSelectionGridPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet()
|
26
|
+
|
27
|
+
it('When the user has set correct answer options and alloted points \'Show correct answer\' checkbox should be displayed and it should be unchecked by default and points for the question should be displayed beside it', () => {
|
28
|
+
multipleSelectionGridPage.steps.switchToEditTab();
|
29
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSetCorrectAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
|
30
|
+
multipleSelectionGridPage.steps.allotPoints('15');
|
31
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
32
|
+
multipleSelectionGridPage.steps.verifyDefaultShowCorrectAnswerCheckboxAndLabel();
|
33
|
+
multipleSelectionGridPage.previewScoreText()
|
34
|
+
.verifyInnerText('0/15');
|
35
|
+
});
|
36
|
+
|
37
|
+
it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab users response should not persist', () => {
|
38
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 1], [1], [1, 2], [0, 2]]);
|
39
|
+
multipleSelectionGridPage.steps.switchToEditTab();
|
40
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
41
|
+
multipleSelectionGridPage.steps.verifyCheckboxesUncheckedInPreviewTabAnswerTable();
|
42
|
+
});
|
43
|
+
|
44
|
+
multipleSelectionGridPage.tests.verifya11yOfCreateItemWrapperContents();
|
45
|
+
});
|
46
|
+
|
47
|
+
describe('Question Preview: AutoScored - All or Nothing', () => {
|
48
|
+
abortEarlySetup();
|
49
|
+
before(() => {
|
50
|
+
cy.log('Navigating to multiple selection grid question type');
|
51
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
52
|
+
cy.log('Adding question instructions, question stems, options, setting correct answer and adding points for Autoscored scoring type and switching to Preview tab');
|
53
|
+
multipleSelectionGridPage.steps.addQuestionInstructions();
|
54
|
+
cy.barsPreLoaderWait();
|
55
|
+
multipleSelectionGridPage.steps.addOption();
|
56
|
+
multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
57
|
+
multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
58
|
+
multipleSelectionGridPage.steps.allotPoints(20);
|
59
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSetCorrectAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
|
60
|
+
multipleSelectionGridPage.steps.expandAdditonalSettings();
|
61
|
+
multipleSelectionGridPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
62
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
63
|
+
});
|
64
|
+
|
65
|
+
multipleSelectionGridPage.tests.verifyCSSOfPreviewAndEditTabAndScoringContents();
|
66
|
+
|
67
|
+
it('When the user selects \'Show correct answer\' checkbox without attempting the question, green check-mark icons should be displayed beside the correct answer options, no incorrect icons or label should be displayed below the table', () => {
|
68
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
69
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
70
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
71
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
72
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
73
|
+
multipleSelectionGridPage.incorrectIcon()
|
74
|
+
.should('not.exist');
|
75
|
+
multipleSelectionGridPage.correctIncorectAnswerLabel()
|
76
|
+
.should('not.exist');
|
77
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotVisible();
|
78
|
+
});
|
79
|
+
|
80
|
+
it('When user selects Check answer button without attempting the question, then then red cross-mark icon or green check-mark should not be displayed anywhere, correct/incorrect answer label and its border should not be displayed', () => {
|
81
|
+
cy.log('Post step: Unchecking the show correct answer checkbox')
|
82
|
+
multipleSelectionGridPage.steps.uncheckShowCorrectAnswerCheckbox()
|
83
|
+
multipleSelectionGridPage.correctIcon()
|
84
|
+
.should('not.exist');
|
85
|
+
multipleSelectionGridPage.incorrectIcon()
|
86
|
+
.should('not.exist');
|
87
|
+
multipleSelectionGridPage.correctIncorectAnswerLabel()
|
88
|
+
.should('not.exist');
|
89
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotVisible();
|
90
|
+
});
|
91
|
+
|
92
|
+
it('Case: When user adds incorrect response', () => {
|
93
|
+
cy.log('User selects incorrect options')
|
94
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [0, 2], [2], [0]]);
|
95
|
+
|
96
|
+
cy.log('User should be awarded 0 points')
|
97
|
+
multipleSelectionGridPage.previewScoreText()
|
98
|
+
.verifyInnerText('0/20');
|
99
|
+
|
100
|
+
cy.log('When the user selects \'Show correct answer\' checkbox, red cross-mark icon should be displayed besides the selected incorrect answer options, green check-mark should be displayed beside correct answer options, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed below the table')
|
101
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
102
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
103
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
104
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
105
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
106
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
|
107
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
|
108
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
|
109
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
|
110
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
111
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
112
|
+
|
113
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
114
|
+
|
115
|
+
cy.log('When the user clicks on \'Check answer\' button,red cross-mark icon should be displayed besides the selected incorrect answer options, incorrect answer border should appear and a label \'Incorrect Answer\' should be displayed below the table')
|
116
|
+
multipleSelectionGridPage.steps.checkAnswer();
|
117
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
|
118
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
|
119
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
|
120
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
|
121
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
122
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
123
|
+
});
|
124
|
+
|
125
|
+
//Use the common function once https://redmine.zeuslearning.com/issues/518498 is resolved
|
126
|
+
it('CSS of incorrect answer state', { tags: 'css' }, () => {
|
127
|
+
cy.log('Pre requisite: The user has attempted the question incorrectly')
|
128
|
+
cy.log('Verifying CSS of incorrect crossmark icon')
|
129
|
+
multipleSelectionGridPage.incorrectIcon()
|
130
|
+
.eq(0)
|
131
|
+
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
132
|
+
multipleSelectionGridPage.correctIncorectAnswerLabel()
|
133
|
+
.verifyCSS(css.color.incorrectAnswer, css.fontSize.normal, css.fontWeight.bold)
|
134
|
+
.parent()
|
135
|
+
.find('.answer-label-icon')
|
136
|
+
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
137
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
138
|
+
});
|
139
|
+
|
140
|
+
it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
|
141
|
+
cy.checkAccessibility(multipleSelectionGridPage.previewTabQuestionWrapper());
|
142
|
+
});
|
143
|
+
|
144
|
+
it('Case: When user enters partially correct response', () => {
|
145
|
+
cy.log('When user attempts the question partially correct with all the stems attempted correctly and one question stem unattempted then correct icon should be displayed beside the correctly attempted options and unattempeted options from the correct tab, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed below the table')
|
146
|
+
multipleSelectionGridPage.steps.resetQuestionPreview();
|
147
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1], [0, 1]]);
|
148
|
+
multipleSelectionGridPage.previewScoreText()
|
149
|
+
.verifyInnerText('0/20');
|
150
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
151
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
152
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
153
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
154
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
155
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
156
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
157
|
+
|
158
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
159
|
+
|
160
|
+
cy.log('When the user clicks on \'Check answer\' button, green checkmark should be displayed beside the correctly attempted options from the correct tab and incorrect answer border should appear and a label \'Incorrect Answer\' should be displayed below the table')
|
161
|
+
multipleSelectionGridPage.steps.checkAnswer();
|
162
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
163
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
164
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
165
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectIconDoesNotExist(3, [1, 2]);
|
166
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
167
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
168
|
+
|
169
|
+
cy.log('When user attempts the question partially correct with all the question stems correct but an extra option selected which is not set as correct answer in the correct tab user should be awarded with 0 points and when the user selects \'Show correct answer\' checkbox, red cross-mark icon should be displayed besides the selected incorrect answer option, green check-mark should be displayed beside correct tab options, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed below the table')
|
170
|
+
multipleSelectionGridPage.steps.resetQuestionPreview();
|
171
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1, 2], [0, 1], [1, 2]]);
|
172
|
+
multipleSelectionGridPage.previewScoreText()
|
173
|
+
.verifyInnerText('0/20');
|
174
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
175
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
176
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
177
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [2]);
|
178
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
179
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
180
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
181
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
182
|
+
|
183
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
184
|
+
|
185
|
+
cy.log('When the user clicks on \'Check answer\' button, red cross-mark icon should be displayed besides the selected incorrect answer option, green check-mark should be displayed beside selected correct tab options, and incorrect answer border should appear and a label \'Incorrect Answer\' should be displayed below the table')
|
186
|
+
multipleSelectionGridPage.steps.checkAnswer();
|
187
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
188
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
189
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [2]);
|
190
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
191
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
192
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
193
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
194
|
+
|
195
|
+
cy.log('When user selects partially correct options with some correct and some incorrect options then user should be awarded 0 points and green check-mark icons should be displayed beside the options set as correct and red cross-mark icons should be displayed beside the selected incorrect options and a label \'Incorrect Answer\' should be displayed below the table')
|
196
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
197
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [0, 2], [0, 1], [1, 2]]);
|
198
|
+
multipleSelectionGridPage.previewScoreText()
|
199
|
+
.verifyInnerText('0/20');
|
200
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
201
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
202
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
|
203
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
204
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
|
205
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
206
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
207
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
208
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
209
|
+
|
210
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
211
|
+
|
212
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icons should be displayed beside the selected options set as correct and red cross-mark icons should be displayed beside the selected incorrect options and incorrect answer border should appear and a label \'Incorrect Answer\' should be displayed below the table')
|
213
|
+
multipleSelectionGridPage.steps.checkAnswer();
|
214
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
|
215
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
|
216
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
217
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
218
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
219
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
220
|
+
});
|
221
|
+
|
222
|
+
it('Case: When user adds correct response', () => {
|
223
|
+
cy.log('Selecting correct options');
|
224
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
225
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
|
226
|
+
|
227
|
+
cy.log('User should be awarded full points')
|
228
|
+
multipleSelectionGridPage.previewScoreText()
|
229
|
+
.verifyInnerText('20/20');
|
230
|
+
|
231
|
+
cy.log('When user selects show correct answer then green check-mark icons should be displayed besides correct answer options and a label \'Correct answer\' should be displayed below the table')
|
232
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
233
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
234
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
235
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
236
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
237
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
238
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
239
|
+
|
240
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
241
|
+
|
242
|
+
cy.log('When the user clicks on the \'Check answer\' button, then green check-mark icons should be displayed besides correct answer options and a label \'Correct answer\' should be displayed below the table');
|
243
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
244
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
245
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
246
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
247
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
248
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
249
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
250
|
+
});
|
251
|
+
|
252
|
+
//Use the common function once https://redmine.zeuslearning.com/issues/518498 is resolved
|
253
|
+
it('CSS of check score text full score state and Correct Answer label', { tags: 'css' }, () => {
|
254
|
+
multipleSelectionGridPage.previewScoreText()
|
255
|
+
.should('have.css', 'color', css.color.primaryBtn)
|
256
|
+
.and('have.css', 'background-color', css.color.correctAnswer)
|
257
|
+
multipleSelectionGridPage.correctIncorectAnswerLabel()
|
258
|
+
.verifyCSS(css.color.correctAnswer, css.fontSize.normal, css.fontWeight.bold)
|
259
|
+
.parent()
|
260
|
+
.find('.answer-label-icon')
|
261
|
+
.verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
|
262
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
263
|
+
});
|
264
|
+
|
265
|
+
it('Accessibility of check score text full score state and Correct Answer label', { tags: 'a11y' }, () => {
|
266
|
+
cy.checkAccessibility(multipleSelectionGridPage.previewTabQuestionWrapper());
|
267
|
+
});
|
268
|
+
|
269
|
+
multipleSelectionGridPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer('20')
|
270
|
+
});
|
271
|
+
|
272
|
+
describe('Question Preview: AutoScored - All or Nothing with alternate answer', () => {
|
273
|
+
abortEarlySetup();
|
274
|
+
before(() => {
|
275
|
+
cy.log('Navigating to multiple selection grid question type');
|
276
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
277
|
+
cy.log('Adding question instructions, question stems, options, setting correct answer and adding points for Autoscored scoring type and switching to Preview tab');
|
278
|
+
multipleSelectionGridPage.steps.addQuestionInstructions();
|
279
|
+
cy.barsPreLoaderWait()
|
280
|
+
multipleSelectionGridPage.steps.addOption();
|
281
|
+
multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
282
|
+
multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
283
|
+
multipleSelectionGridPage.steps.allotPoints(20);
|
284
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSetCorrectAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
|
285
|
+
multipleSelectionGridPage.steps.clickOnAddAlternateAnswerButton();
|
286
|
+
multipleSelectionGridPage.steps.allotPoints(12);
|
287
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSetCorrectAnswerTable([[1], [0, 2], [0, 1], [2]]);
|
288
|
+
multipleSelectionGridPage.steps.expandAdditonalSettings();
|
289
|
+
multipleSelectionGridPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
290
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
291
|
+
});
|
292
|
+
|
293
|
+
it('Case: Alternate answer case: When Correct Answer points are more than Alternate Answer points', () => {
|
294
|
+
cy.log('Total points displayed besides Show correct answer checkbox should be of Correct Answer points')
|
295
|
+
multipleSelectionGridPage.previewScoreText()
|
296
|
+
.verifyInnerText('0/20');
|
297
|
+
|
298
|
+
cy.log('When the user selects the Show correct answer checkbox without attempting the question, green check-mark icons should be displayed besides only correct answer options')
|
299
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
300
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
301
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
302
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
303
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
304
|
+
multipleSelectionGridPage.incorrectIcon()
|
305
|
+
.should('not.exist');
|
306
|
+
multipleSelectionGridPage.correctIncorectAnswerLabel()
|
307
|
+
.should('not.exist');
|
308
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotVisible();
|
309
|
+
|
310
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
311
|
+
|
312
|
+
cy.log('When the user selects correct answer options, points specified for correct answers should be provided and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides options set in the correct tab and label \'Correct answer\' and border should be displayed below the table')
|
313
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
|
314
|
+
multipleSelectionGridPage.previewScoreText()
|
315
|
+
.verifyInnerText('20/20');
|
316
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox();
|
317
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
318
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
319
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
320
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
321
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
322
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
323
|
+
|
324
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
325
|
+
|
326
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides selected options set in the correct tab and label \'Correct answer\' and border should be displayed below the table')
|
327
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
328
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
329
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
330
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
331
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
332
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
333
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
334
|
+
|
335
|
+
cy.log('When the user selects alternate correct answer options, points specified for alternate correct answer (less than overall points) should be provided and on selecting Show correct answer checkbox green check-mark icons should be displayed besides alternate correct answer options and label \'Correct answer\' should be displayed below the table')
|
336
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
337
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [0, 2], [0, 1], [2]]);
|
338
|
+
multipleSelectionGridPage.previewScoreText()
|
339
|
+
.verifyInnerText('12/20');
|
340
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
341
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
342
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
343
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
344
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
345
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
346
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
347
|
+
|
348
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
349
|
+
|
350
|
+
cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed besides selected alternate correct answer options and label \'Correct answer\' should be displayed below the table')
|
351
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
352
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
353
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
354
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
355
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
356
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
357
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
358
|
+
|
359
|
+
cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab and user selects show correct answer checkbox then green check-mark icons should be displayed beside the options set in the correct tab and \'Incorrect Answer\' label should be displayed below the table')
|
360
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
361
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1]]);
|
362
|
+
multipleSelectionGridPage.previewScoreText()
|
363
|
+
.verifyInnerText('0/20');
|
364
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
365
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
366
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
367
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
368
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
369
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
370
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
371
|
+
|
372
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
373
|
+
|
374
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icons should be displayed beside the selected options set in the correct tab and \'Incorrect Answer\' label should be displayed below the table')
|
375
|
+
multipleSelectionGridPage.steps.checkAnswer();
|
376
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
377
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
378
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
379
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
380
|
+
|
381
|
+
cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab and user selects show correct answer checkbox then green check-mark icons should be displayed beside the options set in the correct tab and red cross-mark icon should be displayed beside the selected alternate tab options and \'Incorrect Answer\' label should be displayed below the table')
|
382
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
383
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [0, 2]]);
|
384
|
+
multipleSelectionGridPage.previewScoreText()
|
385
|
+
.verifyInnerText('0/20');
|
386
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
387
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
388
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
|
389
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
390
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
|
391
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
392
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
393
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
394
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
395
|
+
|
396
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
397
|
+
|
398
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icons should be displayed beside the selected options set in the correct tab and red cross-mark icon should be displayed beside the selected alternate tab options and \'Incorrect Answer\' label should be displayed below the table')
|
399
|
+
multipleSelectionGridPage.steps.checkAnswer();
|
400
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
|
401
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
|
402
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
403
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
404
|
+
|
405
|
+
cy.log('When user selects equal number of options from the correct tab and alternate tab then 0 points should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed beside options from the correct tab and red cross-mark icon should be displayed beside the options from the alternate tab and label \'Incorrect Answer\' should be displayed below the table')
|
406
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
407
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [0, 2], [0, 1]]);
|
408
|
+
multipleSelectionGridPage.previewScoreText()
|
409
|
+
.verifyInnerText('0/20');
|
410
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
411
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
412
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
413
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
|
414
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
415
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
416
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
417
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
418
|
+
|
419
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
420
|
+
|
421
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed beside selected options from the correct tab and red cross-mark icon should be displayed beside the selected options from the alternate tab and label \'Incorrect Answer\' should be displayed below the table')
|
422
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
423
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
424
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
|
425
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
426
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
427
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
428
|
+
|
429
|
+
cy.log('Race condition 1: When user attempts a question stem with correct options of both correct and alternate tab (same options set correct in both the correct and alternate tabs) and user selects show correct answer checkbox then green checkmark icon should be displayed for the correct tab options and user should be awarded 0 points and label \'Incorrect Answer\' should be displayed below the table')
|
430
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
431
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(2, [0, 1]);
|
432
|
+
multipleSelectionGridPage.previewScoreText()
|
433
|
+
.verifyInnerText('0/20');
|
434
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
435
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
436
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
437
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
438
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
439
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
440
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
441
|
+
|
442
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
443
|
+
|
444
|
+
cy.log('When the user clicks on \'Check answer\' button green check-mark icons should be displayed beside the selected correct answer options and label \'Incorrect Answer\' should be displayed below the table')
|
445
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
446
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
447
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
448
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
449
|
+
|
450
|
+
cy.log('Race condition 2: When user attempts a question stem with correct options of both correct and alternate tab (one common option set correct in both the correct and alternate tabs) and user selects show correct answer checkbox then green check-mark icons should be displayed for the correct tab options and user should be awarded 0 points and label \'Incorrect Answer\' should be displayed below the table')
|
451
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
452
|
+
multipleSelectionGridPage.previewScoreText()
|
453
|
+
.verifyInnerText('0/20');
|
454
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
455
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(3, [1, 2]);
|
456
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
457
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
458
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
459
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
460
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
461
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
462
|
+
|
463
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
464
|
+
|
465
|
+
cy.log('When the user clicks on \'Check answer\' button green check-mark icons should be displayed beside the selected correct answer options and label \'Incorrect Answer\' should be displayed below the table')
|
466
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
467
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
468
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
469
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
470
|
+
|
471
|
+
cy.log('Race condition 3: When user attempts a question stem with correct options of both correct and alternate tab (both the correct and alternate tabs have exclusive options set correct) and user selects show correct answer checkbox then green check-mark icons should be displayed for the options set in correct tab and red cross-mark icon should be displayed for selected alternate tab options and user should be awarded 0 points and label \'Incorrect Answer\' should be displayed below the table')
|
472
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
473
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(0, [0, 1, 2]);
|
474
|
+
multipleSelectionGridPage.previewScoreText()
|
475
|
+
.verifyInnerText('0/20');
|
476
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
477
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
478
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
|
479
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
480
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
481
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
482
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
483
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
484
|
+
|
485
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
486
|
+
|
487
|
+
cy.log('When the user clicks on \'Check answer\' button green check-mark icons should be displayed beside the selected correct answer options, red cross-mark icon should be displayed beside selected alternate tab options and label \'Incorrect Answer\' should be displayed below the table')
|
488
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
489
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
490
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
|
491
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
492
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
493
|
+
|
494
|
+
//Failing due to https://redmine.zeuslearning.com/issues/535509
|
495
|
+
cy.log('When user selects incorrect answer option, 0 points should be awarded and on selecting Show correct answer checkbox red cross-mark icons should be displayed besides the selected incorrect answer options and green checkmarks should be displayed beside correct tab answers and label \'Incorrect Answer\' should be displayed below the table')
|
496
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
497
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(2, [2]);
|
498
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(3, [0]);
|
499
|
+
multipleSelectionGridPage.previewScoreText()
|
500
|
+
.verifyInnerText('0/20');
|
501
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
502
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
503
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
504
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
505
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
|
506
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
507
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
|
508
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
509
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
510
|
+
|
511
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
512
|
+
|
513
|
+
cy.log('When the user clicks on \'Check answer\' button, red check-marks should be displayed besides the selected incorrect answer options and label \'Incorrect Answer\' should be displayed below the table')
|
514
|
+
multipleSelectionGridPage.steps.checkAnswer();
|
515
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
|
516
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
|
517
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
518
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
519
|
+
});
|
520
|
+
|
521
|
+
it('Alternate answer case: When Alternate Answer points are more than Correct Answer points', () => {
|
522
|
+
multipleSelectionGridPage.steps.switchToEditTab();
|
523
|
+
multipleSelectionGridPage.steps.allotPoints('25');
|
524
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
525
|
+
|
526
|
+
cy.log('Total points displayed besides Show correct answer checkbox should be of Alternate Answer points')
|
527
|
+
multipleSelectionGridPage.previewScoreText()
|
528
|
+
.verifyInnerText('0/25');
|
529
|
+
|
530
|
+
cy.log('When the user selects the Show correct answer checkbox without attempting the question, green check-mark icons should be displayed besides only alternate answer options')
|
531
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
532
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
533
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
534
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
535
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
536
|
+
multipleSelectionGridPage.incorrectIcon()
|
537
|
+
.should('not.exist');
|
538
|
+
multipleSelectionGridPage.correctIncorectAnswerLabel()
|
539
|
+
.should('not.exist');
|
540
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotVisible();
|
541
|
+
|
542
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
543
|
+
|
544
|
+
cy.log('When the user selects correct answer options, points specified for correct answers should be provided(less than overall points) and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides options from the correct tab and label \'Correct answer\' and border should be displayed below the table')
|
545
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
|
546
|
+
multipleSelectionGridPage.previewScoreText()
|
547
|
+
.verifyInnerText('20/25');
|
548
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
549
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
550
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
551
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
552
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
553
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
554
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
555
|
+
|
556
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
557
|
+
|
558
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides selected options from the correct tab and label \'Correct answer\' and border should be displayed below the table')
|
559
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
560
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
561
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
562
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
563
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
564
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
565
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
566
|
+
|
567
|
+
cy.log('When the user selects alternate correct answer options, full points specified for alternate correct answer should be provided and on selecting Show correct answer checkbox green check-mark icons should be displayed besides alternate correct answer options and label \'Correct answer\' should be displayed below the table')
|
568
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
569
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [0, 2], [0, 1], [2]]);
|
570
|
+
multipleSelectionGridPage.previewScoreText()
|
571
|
+
.verifyInnerText('25/25');
|
572
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
573
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
574
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
575
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
576
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
577
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
578
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
579
|
+
|
580
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
581
|
+
|
582
|
+
cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed besides selected alternate correct answer options and label \'Correct answer\' should be displayed below the table')
|
583
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
584
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
585
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
586
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
587
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
588
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
589
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
590
|
+
|
591
|
+
cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab and user selects show correct answer checkbox then green check-mark icons should be displayed beside the options set in the alternate tab and red cross-mark icons should be displayed beside the selected options from the correct tab and \'Incorrect Answer\' label should be displayed below the table')
|
592
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
593
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1]]);
|
594
|
+
multipleSelectionGridPage.previewScoreText()
|
595
|
+
.verifyInnerText('0/25');
|
596
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
597
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
598
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [0, 2]);
|
599
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
600
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [1]);
|
601
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
602
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
603
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
604
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
605
|
+
|
606
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
607
|
+
|
608
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icons should be displayed beside the selected options set in the alternate tab and red cross-mark icons should be displayed beside the selected options from the correct tab \'Incorrect Answer\' label should be displayed below the table')
|
609
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
610
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [0, 2]);
|
611
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [1]);
|
612
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
613
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
614
|
+
|
615
|
+
cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab and user selects show correct answer checkbox then green check-mark icons should be displayed beside the options set in the alternate tab and \'Incorrect Answer\' label should be displayed below the table')
|
616
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
617
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [0, 2]]);
|
618
|
+
multipleSelectionGridPage.previewScoreText()
|
619
|
+
.verifyInnerText('0/25');
|
620
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
621
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
622
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
623
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
624
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
625
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
626
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
627
|
+
|
628
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
629
|
+
|
630
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icons should be displayed beside the selected options set in the alternate tab \'Incorrect Answer\' label should be displayed below the table')
|
631
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
632
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
633
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
634
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
635
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
636
|
+
|
637
|
+
cy.log('When user selects equal number of options from the correct tab and alternate tab then 0 points should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed beside options from the alternate tab and red cross-mark icon should be displayed beside the options from the correct tab and label \'Incorrect Answer\' should be displayed below the table')
|
638
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
639
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [0, 2], [0, 1]]);
|
640
|
+
multipleSelectionGridPage.previewScoreText()
|
641
|
+
.verifyInnerText('0/25');
|
642
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
643
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
644
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [0, 2]);
|
645
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
646
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
647
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
648
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
649
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
650
|
+
|
651
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
652
|
+
|
653
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed beside selected options from the alternate tab and red cross-mark icon should be displayed beside the selected options from the correct tab and label \'Incorrect Answer\' should be displayed below the table')
|
654
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
655
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [0, 2]);
|
656
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
657
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
658
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
659
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
660
|
+
|
661
|
+
cy.log('Race condition 1: When user attempts a question stem with correct options of both correct and alternate tab (same options set correct in both the correct and alternate tabs) and user selects show correct answer checkbox then green checkmark icon should be displayed for the alternate tab options and user should be awarded 0 points and label \'Incorrect Answer\' should be displayed below the table')
|
662
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
663
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(2, [0, 1]);
|
664
|
+
multipleSelectionGridPage.previewScoreText()
|
665
|
+
.verifyInnerText('0/25');
|
666
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
667
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
668
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
669
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
670
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
671
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
672
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
673
|
+
|
674
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
675
|
+
|
676
|
+
cy.log('When the user clicks on \'Check answer\' button green check-mark icons should be displayed beside the selected correct answer options and label \'Incorrect Answer\' should be displayed below the table')
|
677
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
678
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
679
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
680
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
681
|
+
|
682
|
+
cy.log('Race condition 2: When user attempts a question stem with correct options of both correct and alternate tab (one common option set correct in both the correct and alternate tabs) then green check-mark icons should be displayed for the alternate tab options and red cross-mark icon should not be displayed user should be awarded 0 points and label \'Incorrect Answer\' should be displayed below the table')
|
683
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
684
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(3, [1, 2]);
|
685
|
+
multipleSelectionGridPage.previewScoreText()
|
686
|
+
.verifyInnerText('0/25');
|
687
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
688
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
689
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
690
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
691
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
692
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [1]);
|
693
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
694
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
695
|
+
|
696
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
697
|
+
|
698
|
+
cy.log('When the user clicks on \'Check answer\' button green check-mark icons should be displayed for the selected correct and alternate tab options and label \'Incorrect Answer\' should be displayed below the table')
|
699
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
700
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
701
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [1]);
|
702
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
703
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
704
|
+
|
705
|
+
cy.log('Race condition 3: When user attempts a question stem with correct options of both correct and alternate tab (both the correct and alternate tabs have exclusive options set correct) and user selects show correct answer checkbox then green check-mark icons should be displayed for the options set in alternate tab and red cross-mark icon should be displayed for selected correct tab options and user should be awarded 0 points and label \'Incorrect Answer\' should be displayed below the table')
|
706
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
707
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(0, [0, 1, 2]);
|
708
|
+
multipleSelectionGridPage.previewScoreText()
|
709
|
+
.verifyInnerText('0/25');
|
710
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
711
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
712
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [0, 2]);
|
713
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
714
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
715
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
716
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
717
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
718
|
+
|
719
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
720
|
+
|
721
|
+
cy.log('When the user clicks on \'Check answer\' button green check-mark icons should be displayed for the selected options set in alternate tab and red cross-mark icon should be displayed for selected correct tab options and label \'Incorrect Answer\' should be displayed below the table')
|
722
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
723
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
724
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [0, 2]);
|
725
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
726
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
727
|
+
|
728
|
+
cy.log('When user selects incorrect answer option, 0 points should be awarded and on selecting Show correct answer checkbox red cross-mark icons should be displayed besides the selected incorrect answer options and green checkmarks should be displayed beside correct tab answers and label \'Incorrect Answer\' should be displayed below the table')
|
729
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
730
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(2, [2]);
|
731
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(3, [0]);
|
732
|
+
multipleSelectionGridPage.previewScoreText()
|
733
|
+
.verifyInnerText('0/25');
|
734
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
735
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
736
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
737
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
738
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
|
739
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
740
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
|
741
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
742
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
743
|
+
|
744
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
745
|
+
|
746
|
+
cy.log('When the user clicks on \'Check answer\' button, red cross-mark icons should be displayed besides the selected incorrect answer options and label \'Incorrect Answer\' should be displayed below the table')
|
747
|
+
multipleSelectionGridPage.steps.checkAnswer();
|
748
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
|
749
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
|
750
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
751
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
752
|
+
|
753
|
+
});
|
754
|
+
|
755
|
+
it('Alternate answer case: When Alternate Answer points and Correct Answer points both are equal', () => {
|
756
|
+
cy.log('Pre step: Switching to Edit tab and alloting alternate answer points equal to correct answer points')
|
757
|
+
multipleSelectionGridPage.steps.switchToEditTab()
|
758
|
+
multipleSelectionGridPage.steps.allotPoints('20');
|
759
|
+
multipleSelectionGridPage.steps.switchToPreviewTab()
|
760
|
+
|
761
|
+
cy.log('Checking the total points displayed besides Show correct answer checkbox')
|
762
|
+
multipleSelectionGridPage.previewScoreText()
|
763
|
+
.verifyInnerText('0/20')
|
764
|
+
|
765
|
+
cy.log('When the user selects the Show correct answer checkbox without attempting the question, green check-mark icons should be displayed besides only correct answer options')
|
766
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
767
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
768
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
769
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
770
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
771
|
+
multipleSelectionGridPage.incorrectIcon()
|
772
|
+
.should('not.exist');
|
773
|
+
multipleSelectionGridPage.correctIncorectAnswerLabel()
|
774
|
+
.should('not.exist');
|
775
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotVisible();
|
776
|
+
|
777
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
778
|
+
|
779
|
+
cy.log('When the user selects correct answer options, points specified for correct answers should be provided and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides correct tab options and label \'Correct answer\' and border should be displayed below the table')
|
780
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
781
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
|
782
|
+
multipleSelectionGridPage.previewScoreText()
|
783
|
+
.verifyInnerText('20/20');
|
784
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
785
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
786
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
787
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
788
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
789
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
790
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
791
|
+
|
792
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
793
|
+
|
794
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides selected correct tab options and label \'Correct answer\' should be displayed below the below the table')
|
795
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
796
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
797
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
798
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
799
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
800
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
801
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
802
|
+
|
803
|
+
cy.log('When the user selects alternate correct answer options, full points points for alternate correct answer should be provided and on selecting Show correct answer checkbox green check-mark icons should be displayed besides alternate correct answer options and label \'Correct answer\' should be displayed below the table')
|
804
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
805
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [0, 2], [0, 1], [2]]);
|
806
|
+
multipleSelectionGridPage.previewScoreText()
|
807
|
+
.verifyInnerText('20/20');
|
808
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox();
|
809
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
810
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
811
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
812
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
813
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
814
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
815
|
+
|
816
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
817
|
+
|
818
|
+
cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed besides selected alternate correct answer options and label \'Correct answer\' should be displayed below the table')
|
819
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
820
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
821
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
822
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
823
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
824
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
825
|
+
multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
826
|
+
|
827
|
+
cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab and user selects show correct answer checkbox then green check-mark icons should be displayed beside the options set in the correct tab and \'Incorrect Answer\' label should be displayed below the table')
|
828
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
829
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1]]);
|
830
|
+
multipleSelectionGridPage.previewScoreText()
|
831
|
+
.verifyInnerText('0/20');
|
832
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
833
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
834
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
835
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
836
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
837
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
838
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
839
|
+
|
840
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
841
|
+
|
842
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icons should be displayed beside the selected options set in the correct tab and label \'Incorrect Answer\' should be displayed below the table')
|
843
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
844
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
845
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
846
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
847
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
848
|
+
|
849
|
+
//Failing due to https://redmine.zeuslearning.com/issues/535509
|
850
|
+
cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab and user selects show correct answer checkbox then green check-mark icons should be displayed beside the options set in the correct tab and \'Incorrect Answer\' label should be displayed below the table')
|
851
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
852
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [0, 2]]);
|
853
|
+
multipleSelectionGridPage.previewScoreText()
|
854
|
+
.verifyInnerText('0/20');
|
855
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
856
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
857
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
858
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
859
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [2]);
|
860
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
861
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
862
|
+
|
863
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
864
|
+
|
865
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icons should be displayed beside the selected options set in the correct tab and label \'Incorrect Answer\' should be displayed below the table')
|
866
|
+
multipleSelectionGridPage.steps.checkAnswer();
|
867
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [1]);
|
868
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [0, 2]);
|
869
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
870
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
871
|
+
|
872
|
+
cy.log('When user selects equal number of options from the correct tab and alternate tab then 0 points should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed beside options from the correct tab and red cross-mark icon should be displayed beside the options from the alternate tab and label \'Incorrect Answer\' should be displayed below the table')
|
873
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
874
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [0, 2], [0, 1]]);
|
875
|
+
multipleSelectionGridPage.previewScoreText()
|
876
|
+
.verifyInnerText('0/20');
|
877
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
878
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
879
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
880
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
|
881
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
882
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
883
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
884
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
885
|
+
|
886
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
887
|
+
|
888
|
+
cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed beside selected options from the correct tab and red cross-mark icon should be displayed beside the selected options from the alternate tab and label \'Incorrect Answer\' should be displayed below the table')
|
889
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
890
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
891
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
|
892
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
893
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
894
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
895
|
+
|
896
|
+
cy.log('Race condition 1: When user attempts a question stem with correct options of both correct and alternate tab (same options set correct in both the correct and alternate tabs) and user selects show correct answer checkbox then green checkmark icon should be displayed for the correct tab options and user should be awarded 0 points and label \'Incorrect Answer\' should be displayed below the table')
|
897
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
898
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(2, [0, 1]);
|
899
|
+
multipleSelectionGridPage.previewScoreText()
|
900
|
+
.verifyInnerText('0/20');
|
901
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
902
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
903
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
904
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
905
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
906
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
907
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
908
|
+
|
909
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
910
|
+
|
911
|
+
cy.log('When the user clicks on \'Check answer\' button green check-mark icons should be displayed beside the selected correct tab answer options and label \'Incorrect Answer\' should be displayed below the table')
|
912
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
913
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
914
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
915
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
916
|
+
|
917
|
+
cy.log('Race condition 2: When user attempts a question stem with correct options of both correct and alternate tab (one common option set correct in both the correct and alternate tabs) and user selects show correct answer checkbox then green check-mark icons should be displayed for the correct tab options and user should be awarded 0 points and label \'Incorrect Answer\' should be displayed below the table')
|
918
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
919
|
+
multipleSelectionGridPage.previewScoreText()
|
920
|
+
.verifyInnerText('0/20');
|
921
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
922
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(3, [1, 2]);
|
923
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
924
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
925
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
926
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
927
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
928
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
929
|
+
|
930
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
931
|
+
|
932
|
+
cy.log('When the user clicks on \'Check answer\' button green check-mark icons should be displayed beside the selected correct tab answer options and label \'Incorrect Answer\' should be displayed below the table')
|
933
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
934
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
935
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
936
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
937
|
+
|
938
|
+
cy.log('Race condition 3: When user attempts a question stem with correct options of both correct and alternate tab (both the correct and alternate tabs have exclusive options set correct) and user selects show correct answer checkbox then green check-mark icons should be displayed for the options set in correct tab and red cross-mark icon should be displayed for selected alternate tab options and user should be awarded 0 points and label \'Incorrect Answer\' should be displayed below the table')
|
939
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
940
|
+
multipleSelectionGridPage.previewScoreText()
|
941
|
+
.verifyInnerText('0/20');
|
942
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
943
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(0, [0, 1, 2]);
|
944
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
945
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
|
946
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
947
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
948
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
949
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
950
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
951
|
+
|
952
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
953
|
+
|
954
|
+
cy.log('When the user clicks on \'Check answer\' button green check-mark icons should be displayed beside the selected correct answer options, red cross-mark icon should be displayed beside selected alternate tab options and label \'Incorrect Answer\' should be displayed below the table')
|
955
|
+
multipleSelectionGridPage.steps.checkAnswer()
|
956
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
957
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
|
958
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
959
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
960
|
+
|
961
|
+
//Failing due to https://redmine.zeuslearning.com/issues/535509
|
962
|
+
cy.log('When user selects incorrect answer option, 0 points should be awarded and on selecting Show correct answer checkbox red cross-mark icons should be displayed besides the selected incorrect answer options and green checkmarks should be displayed beside correct tab answers and label \'Incorrect Answer\' should be displayed below the table')
|
963
|
+
multipleSelectionGridPage.steps.resetQuestionPreview()
|
964
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(2, [2]);
|
965
|
+
multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(3, [0]);
|
966
|
+
multipleSelectionGridPage.previewScoreText()
|
967
|
+
.verifyInnerText('0/20');
|
968
|
+
multipleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox()
|
969
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
|
970
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
|
971
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
|
972
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
|
973
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
|
974
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
|
975
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
976
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
977
|
+
|
978
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked()
|
979
|
+
|
980
|
+
cy.log('When the user clicks on \'Check answer\' button, red check-marks should be displayed besides the selected incorrect answer options and label \'Incorrect Answer\' should be displayed below the table')
|
981
|
+
multipleSelectionGridPage.steps.checkAnswer();
|
982
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
|
983
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
|
984
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
985
|
+
multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
986
|
+
});
|
987
|
+
|
988
|
+
multipleSelectionGridPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer('20')
|
989
|
+
});
|
990
|
+
});
|