itemengine-cypress-automation 1.0.45 → 1.0.47

Sign up to get free protection for your applications and to get access to all the features.
Files changed (19) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/groupedOptionsAllOrNothingAlternatePointsGreaterThanCorrectPoints.js +1 -1
  2. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/groupedOptionsAllOrNothingCorrectPointsEqualToAlternatePoints.js +1 -1
  3. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/standardAllOrNothingCorrectPointsEqualToAlternatePoints.js +1 -1
  4. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/standardAllOrNothingCorrectPointsGreaterThanAlternatePoints.js +1 -1
  5. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAddResponseContainer.js +221 -0
  6. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettings.js +1588 -0
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingScoring.js +950 -0
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextConditionalCheckboxes.js +357 -0
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +134 -0
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +208 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabScoringSection.js +227 -0
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextHeaderSection.js +109 -0
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextImageProperties.js +156 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextManualAndNonScored.js +157 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsScoring.js +1199 -0
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsScoring.js +1084 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPreviewTab.js +66 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSetCorrectAnswerSection.js +113 -0
  19. package/package.json +1 -1
@@ -0,0 +1,950 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const correctTabAnswerArray = ['Flower', 'Leaf', 'Stem'];
6
+ const alternateTabAnswerArray = ['Petals', 'Leaves', 'Stem'];
7
+ const incorrectAnswerArray = ['Root', 'Branch', 'Seed'];
8
+
9
+ describe('Create item page - Fill in the gaps over image - text: All or nothing scoring', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Show correct answer', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ cy.log('Navigate to fill in the gaps over image - text question type');
18
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
19
+ cy.barsPreLoaderWait();
20
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
21
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
22
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
23
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
24
+ });
25
+
26
+ fillInTheGapsOverImageTextPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet();
27
+
28
+ it('When the user has set correct answer responses 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', () => {
29
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
30
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
31
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
32
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
33
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
34
+ fillInTheGapsOverImageTextPage.steps.verifyDefaultShowCorrectAnswerCheckboxAndLabel();
35
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
36
+ });
37
+
38
+ 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', () => {
39
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
40
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
41
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
42
+ fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(0, '');
43
+ fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(1, '');
44
+ });
45
+ });
46
+
47
+ //https://redmine.zeuslearning.com/issues/542590
48
+ //https://redmine.zeuslearning.com/issues/545382
49
+ describe('Question preview: Auto scored - All or nothing', () => {
50
+ abortEarlySetup();
51
+ before(() => {
52
+ cy.log('Navigate to fill in the gaps over image - text question type');
53
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
54
+ cy.barsPreLoaderWait();
55
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
56
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
57
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
58
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
59
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
60
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
61
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
62
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
63
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
64
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
65
+ });
66
+
67
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct/incorrect icons or label should not be displayed, correct answer container along with \'Correct answers:\' label and correct responses with numeric count should be displayed below the question preview', () => {
68
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
69
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
70
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
71
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
72
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerLabel(), 'Correct answers:');
73
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
74
+ });
75
+
76
+ it('CSS of the correct answer container when \'Show correct answer\' checkbox is checked', { tags: 'css' }, () => {
77
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerLabel(), {
78
+ 'color': css.color.text,
79
+ 'font-size': css.fontSize.normal,
80
+ 'font-weight': css.fontWeight.regular
81
+ });
82
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerContainer(), {
83
+ 'border': `1px solid ${css.color.correctAnswerContainerBorder}`
84
+ });
85
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.responseNumeration(), {
86
+ 'color': css.color.text,
87
+ 'font-size': css.fontSize.default,
88
+ 'font-weight': css.fontWeight.regular
89
+ });
90
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerResponseWrapper(), {
91
+ 'color': css.color.text,
92
+ 'font-size': css.fontSize.default,
93
+ 'font-weight': css.fontWeight.regular,
94
+ 'border-left': `1px solid ${css.color.correctAnswerContainerResponseBlockBorder}`,
95
+ });
96
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerResponseWrapper().parent().find('fieldset'), {
97
+ 'border': `1px solid ${css.color.correctAnswerContainerResponseBlockBorder}`
98
+ });
99
+ });
100
+
101
+ it('Accessibility of \'Correct answer container\'', { tags: 'a11y' }, () => {
102
+ cy.checkAccessibility(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerContainer())
103
+ cy.log('Post step: unchecking the show correct answer checkbox')
104
+ fillInTheGapsOverImageTextPage.steps.uncheckShowCorrectAnswerCheckbox();
105
+ });
106
+
107
+ it('When the user selects \'Check answer\' button without attempting the question, then red cross-mark icon or green check-mark icons, correct/incorrect answer label and border and correct answer container should not be displayed', () => {
108
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
109
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
110
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
111
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
112
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
113
+ });
114
+
115
+ it('When the user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container with all correct answers along with numeration should be displayed', () => {
116
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
117
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
118
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
119
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
120
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
121
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
122
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
123
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
124
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
125
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
126
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
127
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
128
+ cy.log('When the user attempts the question incorrectly and clicks on the \'Check answer\' button, then red cross-mark icons should be displayed beside all incorrect the options, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
129
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
130
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
131
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
132
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
133
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
134
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
135
+ });
136
+
137
+ fillInTheGapsOverImageTextPage.tests.verifyCSSAndA11yOfIncorrectAnswerLabel('fill in the gaps over image - text');
138
+
139
+ it('When the user attempts the question partially correct, then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points, green check-mark icons should be displayed beside the correct response fields, red cross-mark icons should be displayed beside the incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container with correct answers for responses marked incorrect along with numeration should be displayed', () => {
140
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
141
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
142
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
143
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
144
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
145
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
146
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
147
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
148
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
149
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
150
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1]], ['2']);
151
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
152
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
153
+ cy.log('When user attempts the question partially correct and clicks on the \'Check answer\' button, green check-mark icons should be displayed beside the correct response fields, red cross-mark icons should be displayed beside the incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
154
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
155
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
156
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
157
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
158
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
159
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
160
+ });
161
+
162
+ it('When user attempts the question correctly then on selecting \'Show correct answer\' checkbox, the user should be awarded full points and green check-mark icons should be displayed beside all the response fields, a label \'Correct answer\' and correct answer border should be displayed below the question preview and the correct answer container should not be displayed', () => {
163
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
164
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
165
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
166
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
167
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
168
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
169
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
170
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
171
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
172
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
173
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
174
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
175
+ cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, green check-mark icons should be displayed beside the correct response fields, a label \'Correct answer\' and correct answer border should be displayed below the question preview and the correct answer container should not be displayed')
176
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
177
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
178
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
179
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
180
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
181
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
182
+ });
183
+
184
+ fillInTheGapsOverImageTextPage.tests.verifyCSSAndA11yOfCorrectAnswerIcon();
185
+
186
+ fillInTheGapsOverImageTextPage.tests.verifyCSSAndA11yOfFullScoreTextAndCorrectAnswerLabel('fill in the gaps over image - text');
187
+
188
+ fillInTheGapsOverImageTextPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(1, 20);
189
+ });
190
+
191
+ describe('Question preview: Auto scored - All or nothing with alternate answer (Match from all responses - false): When \'Correct answer\' points are more than \'Alternate answer\' points', () => {
192
+ abortEarlySetup();
193
+ before(() => {
194
+ cy.log('Navigate to fill in the gaps over image - text question type');
195
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
196
+ cy.barsPreLoaderWait();
197
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
198
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
199
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
200
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
201
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
202
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
203
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
204
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(2, correctTabAnswerArray[2]);
205
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
206
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
207
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTabAnswerArray[0]);
208
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTabAnswerArray[1]);
209
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(2, alternateTabAnswerArray[2]);
210
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
211
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
212
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
213
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
214
+ });
215
+
216
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct answer container should be displayed with the correct responses from the correct tab', () => {
217
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
218
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1], correctTabAnswerArray[2]], ['1', '2', '3']);
219
+ fillInTheGapsOverImageTextPage.steps.uncheckShowCorrectAnswerCheckbox();
220
+ });
221
+
222
+ it('When the user attempts the question with responses from the correct tab, then the user should be awarded with points specified for correct tab and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed', () => {
223
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
224
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
225
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, correctTabAnswerArray[2]);
226
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
227
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
228
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
229
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
230
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
231
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
232
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
233
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
234
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
235
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields and label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed')
236
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
237
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
238
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
239
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
240
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
241
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
242
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
243
+ });
244
+
245
+ it('When the user attempts the question with responses from the alternate tab, then the user should be awarded with points specified for alternate tab (less than overall points) and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed', () => {
246
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
247
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, alternateTabAnswerArray[0]);
248
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
249
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, alternateTabAnswerArray[2]);
250
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 20);
251
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
252
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
253
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
254
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
255
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
256
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
257
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
258
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
259
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed')
260
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
261
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
262
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
263
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
264
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
265
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
266
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
267
+ });
268
+
269
+ it('When the user attempts the question with partially correct responses exclusively from the correct tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
270
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
271
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
272
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, incorrectAnswerArray[2]);
273
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
274
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
275
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
276
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
277
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
278
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
279
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
280
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1], correctTabAnswerArray[2]], ['2', '3']);
281
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
282
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
283
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
284
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
285
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
286
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
287
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
288
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
289
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
290
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
291
+ });
292
+
293
+ it('When the user attempts the question with partially correct responses exclusively from the alternate tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
294
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
295
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, alternateTabAnswerArray[0]);
296
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, incorrectAnswerArray[2]);
297
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
298
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
299
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
300
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
301
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
302
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
303
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
304
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1], correctTabAnswerArray[2]], ['2', '3']);
305
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
306
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
307
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
308
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
309
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
310
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
311
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
312
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
313
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
314
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
315
+ });
316
+
317
+ it('When the user attempts the question with equal number of correct responses from correct tab and alternate tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response field with correct tab answer, red cross-mark icon should be displayed beside response field with alternate tab answer, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
318
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
319
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
320
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
321
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
322
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
323
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
324
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
325
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(2);
326
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
327
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
328
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1], correctTabAnswerArray[2]], ['2', '3']);
329
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
330
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
331
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response field with correct tab answer, red cross-mark icon should be displayed beside response field with alternate tab answer, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
332
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
333
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
334
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
335
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(2);
336
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
337
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
338
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
339
+ });
340
+
341
+ it('Race condition : When the user attempts the question with the common response between correct tab and alternate tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be besides the common response, red cross-mark icon should be displayed beside incorrect response fields, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
342
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
343
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, correctTabAnswerArray[2]);
344
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
345
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
346
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(0);
347
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
348
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
349
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
350
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
351
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
352
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
353
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
354
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be besides the common response, red cross-mark icon should be displayed beside incorrect response fields, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
355
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
356
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(0);
357
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
358
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
359
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
360
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
361
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
362
+ });
363
+
364
+ it('When the user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab', () => {
365
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
366
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
367
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
368
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, incorrectAnswerArray[2]);
369
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
370
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
371
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
372
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
373
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
374
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
375
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
376
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
377
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1], correctTabAnswerArray[2]], ['1', '2', '3']);
378
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
379
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
380
+ cy.log('When the user attempts the question incorrectly and clicks on the \'Check answer\' button, then red cross-mark icons should be displayed beside all incorrect the options, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
381
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
382
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
383
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
384
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
385
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
386
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
387
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
388
+ });
389
+ });
390
+
391
+ describe('Question preview: Auto scored - All or nothing with alternate answer (Match from all responses - false): When \'Alternate answer\' points are more than \'Correct answer\' points', () => {
392
+ abortEarlySetup();
393
+ before(() => {
394
+ cy.log('Navigate to fill in the gaps over image - text question type');
395
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
396
+ cy.barsPreLoaderWait();
397
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
398
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
399
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
400
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
401
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
402
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
403
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
404
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(2, correctTabAnswerArray[2]);
405
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
406
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
407
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTabAnswerArray[0]);
408
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTabAnswerArray[1]);
409
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(2, alternateTabAnswerArray[2]);
410
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
411
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
412
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
413
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
414
+ });
415
+
416
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct answer container should be displayed with the correct responses from the alternate tab', () => {
417
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
418
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([alternateTabAnswerArray[0], alternateTabAnswerArray[1], alternateTabAnswerArray[2]], ['1', '2', '3']);
419
+ fillInTheGapsOverImageTextPage.steps.uncheckShowCorrectAnswerCheckbox();
420
+ });
421
+
422
+ it('When the user attempts the question with responses from the correct tab, then the user should be awarded with points specified for correct tab (less than overall points) and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed', () => {
423
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
424
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
425
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, correctTabAnswerArray[2]);
426
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 20);
427
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
428
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
429
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
430
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
431
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
432
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
433
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
434
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
435
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields and label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed')
436
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
437
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
438
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
439
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
440
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
441
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
442
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
443
+ });
444
+
445
+ it('When the user attempts the question with responses from the alternate tab, then the user should be awarded with points specified for alternate tab and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed', () => {
446
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
447
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, alternateTabAnswerArray[0]);
448
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
449
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, alternateTabAnswerArray[2]);
450
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
451
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
452
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
453
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
454
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
455
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
456
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
457
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
458
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
459
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed')
460
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
461
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
462
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
463
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
464
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
465
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
466
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
467
+ });
468
+
469
+ it('When the user attempts the question with partially correct responses exclusively from the correct tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the alternate tab for the responses marked incorrect', () => {
470
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
471
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
472
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
473
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, incorrectAnswerArray[2]);
474
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
475
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
476
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
477
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
478
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
479
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
480
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
481
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([alternateTabAnswerArray[2]], ['3']);
482
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
483
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
484
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
485
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
486
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
487
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
488
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
489
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
490
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
491
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
492
+ });
493
+
494
+ it('When the user attempts the question with partially correct responses exclusively from the alternate tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the alternate tab for the responses marked incorrect', () => {
495
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
496
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, alternateTabAnswerArray[0]);
497
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
498
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, incorrectAnswerArray[1]);
499
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
500
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
501
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
502
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
503
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
504
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
505
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
506
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([alternateTabAnswerArray[2]], ['3']);
507
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
508
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
509
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
510
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
511
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
512
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
513
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
514
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
515
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
516
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
517
+ });
518
+
519
+ it('When the user attempts the question with equal number of correct responses from correct tab and alternate tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response field with correct tab answer, red cross-mark icon should be displayed beside response field with alternate tab answer, label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the alternate tab for the responses marked incorrect', () => {
520
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
521
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
522
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
523
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
524
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
525
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
526
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
527
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
528
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
529
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([alternateTabAnswerArray[0], alternateTabAnswerArray[2]], ['1', '3']);
530
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
531
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
532
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response field with correct tab answer, red cross-mark icon should be displayed beside response field with alternate tab answer, label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
533
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
534
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
535
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
536
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
537
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
538
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
539
+ });
540
+
541
+ it('Race condition : When the user attempts the question with the common response between correct tab and alternate tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be besides the common response, red cross-mark icon should be displayed beside incorrect response fields, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the alternate tab for the responses marked incorrect', () => {
542
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
543
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, correctTabAnswerArray[2]);
544
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
545
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
546
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
547
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
548
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
549
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([alternateTabAnswerArray[0], alternateTabAnswerArray[1]], ['1', '2']);
550
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
551
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
552
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be besides the common response, red cross-mark icon should be displayed beside incorrect response fields, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
553
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
554
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
555
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
556
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
557
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
558
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
559
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
560
+ });
561
+
562
+ it('When the user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the alternate tab', () => {
563
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
564
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
565
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
566
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, incorrectAnswerArray[2]);
567
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
568
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
569
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
570
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
571
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
572
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
573
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
574
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
575
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([alternateTabAnswerArray[0], alternateTabAnswerArray[1], alternateTabAnswerArray[2]], ['1', '2', '3']);
576
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
577
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
578
+ cy.log('When the user attempts the question incorrectly and clicks on the \'Check answer\' button, then red cross-mark icons should be displayed beside all incorrect the options, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
579
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
580
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
581
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
582
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
583
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
584
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
585
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
586
+ });
587
+ });
588
+
589
+ describe('Question preview: Auto scored - All or nothing with alternate answer (Match from all responses - false): When \'Correct answer\' points is equal to \'Alternate answer\' points', () => {
590
+ abortEarlySetup();
591
+ before(() => {
592
+ cy.log('Navigate to fill in the gaps over image - text question type');
593
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
594
+ cy.barsPreLoaderWait();
595
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
596
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
597
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
598
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
599
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
600
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
601
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
602
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(2, correctTabAnswerArray[2]);
603
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
604
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
605
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTabAnswerArray[0]);
606
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTabAnswerArray[1]);
607
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(2, alternateTabAnswerArray[2]);
608
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
609
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
610
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
611
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
612
+ });
613
+
614
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct answer container should be displayed with the correct responses from the correct tab', () => {
615
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
616
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1], correctTabAnswerArray[2]], ['1', '2', '3']);
617
+ fillInTheGapsOverImageTextPage.steps.uncheckShowCorrectAnswerCheckbox();
618
+ });
619
+
620
+ it('When the user attempts the question with responses from the correct tab, then the user should be awarded with points specified for correct tab and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed', () => {
621
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
622
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
623
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, correctTabAnswerArray[2]);
624
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
625
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
626
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
627
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
628
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
629
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
630
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
631
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
632
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
633
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields and label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed')
634
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
635
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
636
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
637
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
638
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
639
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
640
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
641
+ });
642
+
643
+ it('When the user attempts the question with responses from the alternate tab, then the user should be awarded with points specified for alternate tab and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed', () => {
644
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
645
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, alternateTabAnswerArray[0]);
646
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
647
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, alternateTabAnswerArray[2]);
648
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
649
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
650
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
651
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
652
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
653
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
654
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
655
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
656
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
657
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed')
658
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
659
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
660
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
661
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
662
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
663
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
664
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
665
+ });
666
+
667
+ it('When the user attempts the question with partially correct responses exclusively from the correct tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
668
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
669
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
670
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, incorrectAnswerArray[2]);
671
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
672
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
673
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
674
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
675
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
676
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
677
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
678
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1], correctTabAnswerArray[2]], ['2', '3']);
679
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
680
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
681
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
682
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
683
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
684
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
685
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
686
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
687
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
688
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
689
+ });
690
+
691
+ it('When the user attempts the question with partially correct responses exclusively from the alternate tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the alternate tab for the responses marked incorrect', () => {
692
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
693
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, alternateTabAnswerArray[0]);
694
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, incorrectAnswerArray[2]);
695
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
696
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
697
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
698
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
699
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
700
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
701
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
702
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([alternateTabAnswerArray[1], alternateTabAnswerArray[2]], ['2', '3']);
703
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
704
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
705
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
706
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
707
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
708
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
709
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
710
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
711
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
712
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
713
+ });
714
+
715
+ it('When the user attempts the question with equal number of correct responses from correct tab and alternate tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response field with correct tab answer, red cross-mark icon should be displayed beside response field with alternate tab answer, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
716
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
717
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
718
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
719
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
720
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
721
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
722
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
723
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(2);
724
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
725
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
726
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1], correctTabAnswerArray[2]], ['2', '3']);
727
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
728
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
729
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response field with correct tab answer, red cross-mark icon should be displayed beside response field with alternate tab answer, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
730
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
731
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
732
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
733
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(2);
734
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
735
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
736
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
737
+ });
738
+
739
+ it('Race condition : When the user attempts the question with the common response between correct tab and alternate tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be besides the common response, red cross-mark icon should be displayed beside incorrect response fields, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
740
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
741
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, correctTabAnswerArray[2]);
742
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
743
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
744
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(0);
745
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
746
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
747
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
748
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
749
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
750
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
751
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
752
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be besides the common response, red cross-mark icon should be displayed beside incorrect response fields, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
753
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
754
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(0);
755
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
756
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(2);
757
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
758
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
759
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
760
+ });
761
+
762
+ it('When the user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab', () => {
763
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
764
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
765
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
766
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(2, incorrectAnswerArray[2]);
767
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
768
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
769
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
770
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
771
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
772
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
773
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
774
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
775
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1], correctTabAnswerArray[2]], ['1', '2', '3']);
776
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
777
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
778
+ cy.log('When the user attempts the question incorrectly and clicks on the \'Check answer\' button, then red cross-mark icons should be displayed beside all incorrect the options, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
779
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
780
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
781
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
782
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
783
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
784
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
785
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
786
+ });
787
+
788
+ fillInTheGapsOverImageTextPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(1, 20);
789
+ });
790
+
791
+ describe('Question preview: Auto scored - All or nothing with alternate answer (Match from all responses - true)', () => {
792
+ abortEarlySetup();
793
+ before(() => {
794
+ cy.log('Navigate to fill in the gaps over image - text question type');
795
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
796
+ cy.barsPreLoaderWait();
797
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
798
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
799
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
800
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
801
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
802
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
803
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
804
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
805
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTabAnswerArray[0]);
806
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTabAnswerArray[1]);
807
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
808
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
809
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
810
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
811
+ });
812
+
813
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct answer container should be displayed with the correct responses from the correct tab', () => {
814
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
815
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
816
+ fillInTheGapsOverImageTextPage.steps.uncheckShowCorrectAnswerCheckbox();
817
+ });
818
+
819
+ it('When the user attempts the question with responses from the correct tab, then the user should be awarded with points specified for correct tab and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed', () => {
820
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
821
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
822
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
823
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
824
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
825
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
826
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
827
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
828
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
829
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
830
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields and label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed')
831
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
832
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
833
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
834
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
835
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
836
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
837
+ });
838
+
839
+ it('When the user attempts the question with responses from the alternate tab, then the user should be awarded with points specified for alternate tab (less than overall points) and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed', () => {
840
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
841
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, alternateTabAnswerArray[0]);
842
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
843
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
844
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
845
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
846
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
847
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
848
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
849
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
850
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
851
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed')
852
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
853
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
854
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
855
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
856
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
857
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
858
+ });
859
+
860
+ it('When the user attempts the question with partially correct responses exclusively from the correct tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
861
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
862
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
863
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
864
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
865
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
866
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
867
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
868
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
869
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
870
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1]], ['2']);
871
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
872
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
873
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
874
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
875
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
876
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
877
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
878
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
879
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
880
+ });
881
+
882
+ it('When the user attempts the question with partially correct responses exclusively from the alternate tab, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the alternate tab for the responses marked incorrect', () => {
883
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
884
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, alternateTabAnswerArray[0]);
885
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
886
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
887
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
888
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
889
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
890
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
891
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
892
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([alternateTabAnswerArray[1]], ['2']);
893
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
894
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
895
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, label \'Incorrect answer\' should be displayed below the question preview and the correct answer container should not be displayed')
896
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
897
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
898
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
899
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
900
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
901
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
902
+ });
903
+
904
+ it('When the user attempts the question with a combination of correct responses from correct tab and alternate tab, then the user should be awarded with full points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, label \'Correct answer\' should be displayed below the question preview and the correct answer container should not be displayed', () => {
905
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
906
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
907
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
908
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
909
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
910
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
911
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
912
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
913
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
914
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
915
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
916
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields, label \'Correct answer\' should be displayed below the question preview and the correct answer container should not be displayed')
917
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
918
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
919
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
920
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
921
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
922
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
923
+ });
924
+
925
+ it('When the user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab', () => {
926
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
927
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[1]);
928
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[0]);
929
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
930
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
931
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
932
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
933
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
934
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
935
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
936
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
937
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
938
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
939
+ cy.log('When the user attempts the question incorrectly and clicks on the \'Check answer\' button, then red cross-mark icons should be displayed beside all incorrect the options, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
940
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
941
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
942
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
943
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
944
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
945
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
946
+ });
947
+
948
+ fillInTheGapsOverImageTextPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(1, 20);
949
+ });
950
+ });