itemengine-cypress-automation 1.0.157 → 1.0.158

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +1 -1
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +49 -1
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +1 -8
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +7 -7
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +4 -4
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettingsForGroupedLayout.js +1 -1
  8. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +11 -8
  9. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +5 -5
  10. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +2 -1
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +1 -1
  12. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +0 -5
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +10 -10
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/specifyCorrectAnswerSection.js +1 -1
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +0 -5
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +1 -0
  18. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +3 -3
  19. package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +4 -4
  20. package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +4 -4
  21. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +1 -0
  22. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +2 -2
  23. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  24. package/cypress/e2e/ILC/Matching/draggableOptions.js +53 -0
  25. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +302 -0
  26. package/cypress/e2e/ILC/MultipleSelectionGridNew/additionalSettingsBasic.js +146 -0
  27. package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +83 -0
  28. package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +18 -22
  29. package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -2
  30. package/cypress/e2e/ILC/SingleSelectionGridNew/additionalSettingsBasic.js +146 -0
  31. package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +83 -0
  32. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -1
  33. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +1 -1
  34. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +1 -1
  35. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +6 -0
  36. package/cypress/fixtures/evaluationMethodsAndCustomSettings.js +1 -1
  37. package/cypress/pages/components/autoScoredScoringPreviewTab.js +6 -0
  38. package/cypress/pages/components/commonComponents.js +2 -1
  39. package/cypress/pages/components/createCustomCategoryFlyout.js +0 -1
  40. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +4 -4
  41. package/cypress/pages/components/gridQuestionCommonComponent.js +29 -1
  42. package/cypress/pages/components/imageCanvasComponent.js +3 -3
  43. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  44. package/cypress/pages/dragAndDropIntoCategoriesPage.js +3 -4
  45. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +10 -0
  46. package/cypress/pages/graphingPage.js +4 -4
  47. package/cypress/pages/index.js +0 -3
  48. package/cypress/pages/matchingPage.js +166 -10
  49. package/cypress/pages/multipleSelectionGridPage.js +10 -2
  50. package/cypress/pages/rulerPage.js +12 -12
  51. package/cypress/pages/singleSelectionGridPage.js +10 -2
  52. package/cypress/pages/textEntryMathPage.js +2 -1
  53. package/package.json +1 -1
  54. package/cypress/pages/listMatchingPage.js +0 -1514
  55. package/cypress/pages/listMatchingScoring.js +0 -2547
  56. package/cypress/pages/passagePage.js +0 -436
@@ -1,2547 +0,0 @@
1
- import { autoScoredScoringSection, previewScoringAndShowCorrectAnswerComponent } from "./components";
2
- import { listMatchingPage } from "./listMatchingPage";
3
- const css = Cypress.env('css');
4
-
5
- const tests = {
6
- verifyShowCorrectAnswerBasicFunctionality: () => {
7
- 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', () => {
8
- listMatchingPage.steps.switchToEditTab();
9
- listMatchingPage.steps.setCorrectAnswersForScoringWithoutAlternateTab();
10
- listMatchingPage.steps.allotPoints(20);
11
- listMatchingPage.steps.switchToPreviewTab();
12
- listMatchingPage.steps.verifyDefaultShowCorrectAnswerCheckboxAndLabel();
13
- listMatchingPage.previewScoreText()
14
- .verifyInnerText('0/20');
15
- });
16
-
17
- it('CSS of the correct answer container when \'Show correct answer\' checkbox is checked', { tags: 'css' }, () => {
18
- cy.log('Pre-step: Clicking on show correct answer checkbox');
19
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
20
- listMatchingPage.previewTabCorrectAnswerContainer()
21
- .should('have.css', 'border', `1px solid ${css.color.correctAnswerContainerBorder}`);
22
- listMatchingPage.previewTabCorrectAnswerLabel()
23
- .verifyCSS(css.color.text, css.fontSize.normal, css.fontWeight.regular);
24
- listMatchingPage.previewTabCorrectAnswerResponseNumerationWrapper()
25
- .should('have.css', 'border-right', `1px solid ${css.color.correctAnswerContainerResponseBlockBorder}`)
26
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
27
- listMatchingPage.previewTabCorrectAnswerResponseText()
28
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
29
- listMatchingPage.previewTabCorrectAnswerResponseWrapper()
30
- .should('have.css', 'border', `1px solid ${css.color.correctAnswerContainerResponseBlockBorder}`);
31
- cy.log('Post-step: Clicking on show correct answer checkbox to uncheck it');
32
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox();
33
- });
34
-
35
- it('Accessibility of Correct answer container', { tags: 'a11y' }, () => {
36
- cy.log('Pre-step: Clicking on show correct answer checkbox');
37
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
38
- cy.checkAccessibility(listMatchingPage.previewTabCorrectAnswerContainer());
39
- cy.log('Post-step: Clicking on show correct answer checkbox to uncheck it');
40
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox();
41
- });
42
-
43
- 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', () => {
44
- cy.log('Attempting the question in preview tab to verify')
45
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
46
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
47
-
48
- cy.log('Re-switching to Preview tab and checking response fields')
49
- listMatchingPage.steps.switchToEditTab();
50
- listMatchingPage.steps.switchToPreviewTab();
51
- for (let index = 0; index < 2; index++) {
52
- listMatchingPage.previewTabStemResponseArea()
53
- .eq(index)
54
- .verifyInnerText('');
55
- }
56
- listMatchingPage.steps.verifyResponseAreaTextInPreviewTab(0, '');
57
- listMatchingPage.steps.verifyResponseAreaTextInPreviewTab(1, '');
58
- });
59
- },
60
-
61
- verifyAutoScoredAllOrNothingScoring: () => {
62
- it('When the user selects \'Show correct answer\' checkbox without attempting the question, no correct/incorrect icons or label should be displayed, correct answer container along with \'Correct answers\' label and correct responses with numeric count should be displayed below the question field', () => {
63
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
64
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
65
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 1', 'Correct answer for stem 2'], ['1', '2']);
66
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
67
- });
68
-
69
- it('When user clicks on Check answer button without attempting the question, then then red cross-mark icon or green check-mark should not be displayed anywhere, correct/incorrect answer label and its border should not be displayed and the correct answer container should not be displayed', () => {
70
- listMatchingPage.steps.checkAnswer();
71
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
72
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
73
- });
74
-
75
- it('Case: When user adds incorrect response', () => {
76
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
77
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 1);
78
-
79
- cy.log('User should be awarded 0 points')
80
- listMatchingPage.previewScoreText()
81
- .verifyInnerText('0/20');
82
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
83
-
84
- cy.log('When the user selects \'Show correct answer\' checkbox, red cross-mark icon should be displayed besides the incorrect answers input fields, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed below the question field and the correct answer container with both correct answers should be displayed')
85
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
86
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
87
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
88
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
89
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
90
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 1', 'Correct answer for stem 2'], ['1', '2']);
91
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
92
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
93
-
94
- cy.log('When the user clicks on \'Check answer\' button, red cross-mark icon should be displayed besides the incorrect response field, incorrect answer border should appear and a label \'Incorrect Answer\' should be displayed below the question field and correct answer container should be displayed with the correct responses from the correct tab for the user responses marked incorrect')
95
- listMatchingPage.steps.checkAnswer();
96
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
97
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
98
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
99
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
100
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
101
- });
102
-
103
- autoScoredScoringSection.tests.verifyCSSAndA11yOfIncorrectAnswerLabel('list matching');
104
-
105
- it('Case: When user adds Partially correct without any incorrect options', () => {
106
- cy.log('Filling only one response field with correct option and removing the other incorrect option from the response field to keep it blank');
107
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
108
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(1);
109
-
110
- cy.log('User should be awarded 0 points')
111
- listMatchingPage.previewScoreText()
112
- .verifyInnerText('0/20');
113
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
114
-
115
- cy.log('When user selects the show correct answer checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should not be displayed besides the blank response field, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed and correct answer container should be displayed with the correct responses from the correct tab for the blank response field');
116
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
117
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
118
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
119
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
120
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
121
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 2'], ['2']);
122
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
123
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
124
-
125
- cy.log('When the user clicks on the \'Check answer\' button, then red cross-mark icon should not be displayed besides incorrect answer input field, green check-mark icon should be displayed beside correct answer response field, label \'Incorrect Answer\' should be displayed below the question field and incorrect answer border should appear and correct answer container should not be displayed');
126
- listMatchingPage.steps.checkAnswer();
127
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
128
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
129
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
130
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
131
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
132
- });
133
-
134
- it('Case: When user adds partially correct response along with incorrect options', () => {
135
- cy.log('Filling response field with incorrect option');
136
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 1);
137
-
138
- cy.log('User should be awarded 0 points')
139
- listMatchingPage.previewScoreText()
140
- .verifyInnerText('0/20');
141
-
142
- cy.log('When user selects the 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, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed and correct answer container should be displayed with the correct responses from the correct tab for the user responses marked incorrect');
143
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
144
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
145
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
146
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
147
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
148
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 2'], ['2']);
149
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
150
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
151
-
152
- cy.log('When the user clicks on the \'Check answer\' button, then red cross-mark icon should be displayed besides incorrect answer input field, green check-mark icon should be displayed beside correct answer response field, label \'Incorrect Answer\' should be displayed below the question field and incorrect answer border should appear and correct answer container should not be displayed');
153
- listMatchingPage.steps.checkAnswer();
154
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
155
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
156
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
157
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
158
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
159
- });
160
-
161
- it('Case: When user adds correct response', () => {
162
- cy.log('Adding correct response')
163
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
164
-
165
- cy.log('When the user selects the show correct answer checkbox, green check-mark icon should be displayed besides both the response fields, full points should be displayed and a label \'Correct Answer\' should be displayed below the question field and user should be awarded with full points');
166
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
167
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
168
- listMatchingPage.steps.verifyCorrectAttemptBorder();
169
- listMatchingPage.previewScoreText()
170
- .verifyInnerText('20/20');
171
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
172
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
173
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
174
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
175
-
176
- cy.log('When the user clicks on the \'Check answer\' button, green check-mark icon should be displayed besides the response fields and a label \'Correct Answer\' should be displayed below the question field, correct answer border should appear and correct answer container should not be displayed')
177
- listMatchingPage.steps.checkAnswer();
178
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
179
- listMatchingPage.steps.verifyCorrectAttemptBorder();
180
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
181
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
182
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
183
- });
184
-
185
- autoScoredScoringSection.tests.verifyCSSAndA11yOfCorrectAnswerIcon();
186
-
187
- autoScoredScoringSection.tests.verifyCSSAndA11yOfFullScoreTextAndCorrectAnswerLabel('list matching');
188
- },
189
-
190
- verifyAllOrNothingScoringWithAlternateAnswerWhenCorrectPointsAreMoreThanAlternatePoints: () => {
191
- it('Alternate answer case: When Correct answer points are more than alternate answer points', () => {
192
- cy.log('The points displayed should be equal to correct answer points')
193
- listMatchingPage.previewScoreText()
194
- .verifyInnerText('0/7');
195
-
196
- cy.log('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');
197
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
198
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
199
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
200
-
201
- cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state')
202
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox();
203
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
204
-
205
- cy.log('When the user enters incorrect answer responses, 0 points should be awarded and on selecting \'Show correct answer\' checkbox red cross-mark icon should be displayed besides the attempted response fields, no icon should be displayed beside the unattempted responses and label \'Incorrect Answer\' should be displayed below the question field and correct answer container should be displayed with correct answer from the correct tab');
206
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
207
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 3);
208
- listMatchingPage.previewScoreText()
209
- .verifyInnerText('0/7');
210
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
211
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
212
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
213
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
214
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
215
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
216
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
217
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
218
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
219
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
220
-
221
- cy.log('When the user clicks on \'Check answer\' button, then red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses and label \'Incorrect Answer\' should be displayed below the below the question field and correct answer container should not be displayed');
222
- listMatchingPage.steps.checkAnswer();
223
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
224
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
225
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
226
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
227
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
228
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
229
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
230
-
231
- cy.log('When the user attempts the question fully correct as set in the Correct tab, points specified for correct answer should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides response fields and label \'Correct Answer\' should be displayed below the question field and correct answer container should not be displayed');
232
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
233
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
234
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
235
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
236
- listMatchingPage.previewScoreText()
237
- .verifyInnerText('7/7');
238
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
239
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
240
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
241
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
242
- listMatchingPage.steps.verifyCorrectAttemptBorder();
243
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
244
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
245
-
246
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields and label \'Correct Answer\' should be displayed below the below the question field and correct answer container should not be displayed');
247
- listMatchingPage.steps.checkAnswer();
248
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
249
- listMatchingPage.steps.verifyCorrectAttemptBorder()
250
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
251
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
252
-
253
- cy.log('When the user attempts the question fully correct as set in the Alternate tab, points specified for alternate correct answers should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields and label \'Correct Answer\' should be displayed below the question field and correct answer container should not be displayed');
254
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
255
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
256
- listMatchingPage.previewScoreText()
257
- .verifyInnerText('3/7');
258
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
259
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
260
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
261
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
262
- listMatchingPage.steps.verifyCorrectAttemptBorder();
263
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
264
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
265
-
266
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields and label \'Correct Answer\' should be displayed below the below the question field and correct answer container should not be displayed');
267
- listMatchingPage.steps.checkAnswer();
268
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
269
- listMatchingPage.steps.verifyCorrectAttemptBorder()
270
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
271
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
272
-
273
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab then 0 points should be awarded and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab, red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted responses, \'Incorrect Answer\' label should be displayed below the table and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
274
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
275
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
276
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
277
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(3);
278
- listMatchingPage.previewScoreText()
279
- .verifyInnerText('0/7');
280
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
281
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
282
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
283
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
284
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
285
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
286
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
287
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
288
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
289
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
290
-
291
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response and label \'Incorrect Answer\' should be displayed below the question field and correct answer container should not be displayed')
292
- listMatchingPage.steps.checkAnswer();
293
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
294
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
295
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
296
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
297
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
298
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
299
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
300
-
301
-
302
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab then 0 points should be awarded and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, \'Incorrect Answer\' label should be displayed below the table and correct answer container should be displayed with the correct answers for the user responses marked incorrect')
303
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
304
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
305
- listMatchingPage.previewScoreText()
306
- .verifyInnerText('0/7');
307
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
308
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
309
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
310
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
311
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
312
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
313
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
314
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
315
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
316
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
317
-
318
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed besides the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, label \'Incorrect Answer\' should be displayed below the question field and correct answer container should not be displayed')
319
- listMatchingPage.steps.checkAnswer();
320
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
321
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
322
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
323
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
324
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
325
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
326
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
327
-
328
- cy.log('When user selects equal number of options from the correct tab and alternate tab then 0 points should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, label \'Incorrect Answer\' should be displayed below the table and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
329
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
330
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
331
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
332
- listMatchingPage.previewScoreText()
333
- .verifyInnerText('0/7');
334
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
335
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
336
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
337
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
338
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
339
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
340
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
341
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 3'], ['3']);
342
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
343
-
344
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, label \'Incorrect Answer\' should be displayed below the question field and correct answer container should not be displayed');
345
- listMatchingPage.steps.checkAnswer();
346
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
347
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
348
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
349
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
350
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
351
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
352
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
353
- });
354
- },
355
-
356
- verifyAllOrNothingScoringWithAlternateAnswerWhenAlternatePointsAreMoreThanCorrectPoints: () => {
357
- it('Alternate answer case: When Alternate answer points are more than correct answer points', () => {
358
- cy.log('Total points displayed besides Show correct answer checkbox should be of Alternate answer')
359
- listMatchingPage.previewScoreText()
360
- .verifyInnerText('0/10');
361
-
362
- cy.log('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')
363
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
364
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Alternate answer for stem 2', 'Alternate answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
365
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
366
-
367
- cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state')
368
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox();
369
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
370
-
371
- cy.log('When the user enters incorrect answer responses, 0 points should be awarded and on selecting \'Show correct answer\' checkbox red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses and label \'Incorrect Answer\' should be displayed below the question field and correct answer container should be displayed with correct answer from the alternate tab');
372
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
373
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 3);
374
- listMatchingPage.previewScoreText()
375
- .verifyInnerText('0/10');
376
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
377
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
378
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
379
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
380
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
381
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
382
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
383
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Alternate answer for stem 2', 'Alternate answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
384
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
385
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
386
-
387
- cy.log('When the user clicks on \'Check answer\' button, then red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses and label \'Incorrect Answer\' should be displayed below the below the question field and correct answer container should not be displayed');
388
- listMatchingPage.steps.checkAnswer();
389
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
390
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
391
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
392
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
393
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
394
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
395
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
396
-
397
- cy.log('When the user attempts the question fully correct as set in the Correct tab, points specified for correct answers should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields and label \'Correct Answer\' should be displayed below the question field and correct answer container should not be displayed')
398
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
399
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
400
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
401
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
402
- listMatchingPage.previewScoreText()
403
- .verifyInnerText('7/10');
404
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
405
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
406
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
407
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
408
- listMatchingPage.steps.verifyCorrectAttemptBorder()
409
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
410
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
411
-
412
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields and label \'Correct Answer\' should be displayed below the below the question field and correct answer container should not be displayed')
413
- listMatchingPage.steps.checkAnswer();
414
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
415
- listMatchingPage.steps.verifyCorrectAttemptBorder()
416
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
417
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
418
-
419
- cy.log('When the user attempts the question fully correct as set in the Alternate tab, points specified for alternate correct answers should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields and label \'Correct Answer\' should be displayed below the question field and correct answer container should not be displayed')
420
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
421
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
422
- listMatchingPage.previewScoreText()
423
- .verifyInnerText('10/10');
424
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
425
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
426
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
427
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
428
- listMatchingPage.steps.verifyCorrectAttemptBorder()
429
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
430
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
431
-
432
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields and label \'Correct Answer\' should be displayed below the below the question field and correct answer container should not be displayed');
433
- listMatchingPage.steps.checkAnswer();
434
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
435
- listMatchingPage.steps.verifyCorrectAttemptBorder()
436
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
437
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
438
-
439
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab then 0 points should be awarded and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, \'Incorrect Answer\' label should be displayed below the table and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
440
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
441
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
442
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
443
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(3);
444
- listMatchingPage.previewScoreText()
445
- .verifyInnerText('0/10');
446
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
447
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
448
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
449
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
450
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
451
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
452
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
453
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
454
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
455
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
456
-
457
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, label \'Incorrect Answer\' should be displayed below the question field and correct answer container should not be displayed');
458
- listMatchingPage.steps.checkAnswer();
459
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
460
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
461
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
462
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
463
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
464
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
465
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
466
-
467
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab then 0 points should be awarded and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, \'Incorrect Answer\' label should be displayed below the table and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
468
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
469
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
470
- listMatchingPage.previewScoreText()
471
- .verifyInnerText('0/10');
472
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
473
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
474
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
475
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
476
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
477
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
478
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
479
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
480
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
481
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
482
-
483
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, label \'Incorrect Answer\' should be displayed below the question field and correct answer container should not be displayed')
484
- listMatchingPage.steps.checkAnswer()
485
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
486
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
487
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
488
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
489
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
490
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
491
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
492
-
493
- cy.log('When user selects equal number of options from the correct tab and alternate tab then 0 points should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the alternate tab and red cross-mark icon should be displayed besides the attempted responses from the correct tab, label \'Incorrect Answer\' should be displayed below the table and correct answer container should be displayed with the correct answers from the alternate tab for the user responses marked incorrect')
494
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
495
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
496
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
497
- listMatchingPage.previewScoreText()
498
- .verifyInnerText('0/10');
499
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
500
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
501
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
502
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
503
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
504
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
505
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
506
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Alternate answer for stem 3'], ['3']);
507
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
508
-
509
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the alternate tab and red cross-mark icon should be displayed besides the attempted responses from the correct tab, label \'Incorrect Answer\' should be displayed below the question field and correct answer container should not be displayed')
510
- listMatchingPage.steps.checkAnswer()
511
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
512
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
513
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
514
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
515
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
516
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
517
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
518
- });
519
- },
520
-
521
- verifyAllOrNothingScoringWithAlternateAnswerWhenCorrectPointsAreEqualToAlternatePoints: () => {
522
- it('Alternate answer case: When Alternate answer points and correct answer points both are equal', () => {
523
- cy.log('Pre step: Switching to Edit tab and allotting points of Alternate answer equal to correct answer')
524
- listMatchingPage.steps.switchToEditTab();
525
- listMatchingPage.steps.clearPointsField();
526
- listMatchingPage.steps.allotPoints(7);
527
- listMatchingPage.steps.switchToPreviewTab();
528
-
529
- cy.log('Checking total points displayed')
530
- listMatchingPage.previewScoreText()
531
- .verifyInnerText('0/7');
532
-
533
- cy.log('When the user selects the Show correct answer checkbox without attempting the question, correct answer container should be displayed with the correct responses from the correct tab and no label should be displayed below the question field')
534
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
535
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
536
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
537
-
538
- cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state')
539
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox()
540
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
541
-
542
- cy.log('When the user enters incorrect answer responses, 0 points should be awarded and on selecting \'Show correct answer\' checkbox red cross-mark icon should be displayed besides the attempted response fields, no icon should be displayed beside the unattempted responses and label \'Incorrect Answer\' should be displayed below the question field and correct answer container should be displayed with correct answer from the correct tab');
543
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
544
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 3);
545
- listMatchingPage.previewScoreText()
546
- .verifyInnerText('0/7');
547
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
548
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
549
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
550
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
551
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
552
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
553
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
554
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
555
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
556
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
557
-
558
- cy.log('When the user clicks on \'Check answer\' button, then red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses and label \'Incorrect Answer\' should be displayed below the below the question field and correct answer container should not be displayed');
559
- listMatchingPage.steps.checkAnswer()
560
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
561
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
562
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
563
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
564
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
565
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
566
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
567
-
568
- cy.log('When the user attempts the question fully correct as set in the Correct tab, points specified for correct answer should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, label \'Correct Answer\' should be displayed below the question field and correct answer container should not be displayed');
569
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
570
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
571
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
572
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
573
- listMatchingPage.previewScoreText()
574
- .verifyInnerText('7/7');
575
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
576
-
577
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
578
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
579
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
580
- listMatchingPage.steps.verifyCorrectAttemptBorder()
581
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
582
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
583
-
584
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, label \'Correct Answer\' should be displayed below the below the question field and correct answer container should not be displayed')
585
- listMatchingPage.steps.checkAnswer()
586
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
587
- listMatchingPage.steps.verifyCorrectAttemptBorder()
588
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
589
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
590
-
591
- cy.log('When the user attempts the question fully correct as set in the Alternate tab, points specified for alternate correct answers (full points) should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, label \'Correct Answer\' should be displayed below the question field and correct answer container should not be displayed')
592
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
593
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
594
- listMatchingPage.previewScoreText()
595
- .verifyInnerText('7/7');
596
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
597
-
598
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
599
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
600
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
601
- listMatchingPage.steps.verifyCorrectAttemptBorder()
602
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
603
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
604
-
605
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, label \'Correct Answer\' should be displayed below the below the question field and correct answer container should not be displayed')
606
- listMatchingPage.steps.checkAnswer()
607
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
608
- listMatchingPage.steps.verifyCorrectAttemptBorder()
609
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
610
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
611
-
612
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab then 0 points should be awarded and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, \'Incorrect Answer\' label should be displayed below the table and correct answer container should be displayed with the correct answers for the user responses marked incorrect')
613
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
614
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
615
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
616
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(3);
617
- listMatchingPage.previewScoreText()
618
- .verifyInnerText('0/7');
619
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
620
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
621
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
622
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
623
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
624
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
625
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
626
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
627
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
628
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
629
-
630
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, label \'Incorrect Answer\' should be displayed below the question field and correct answer container should not be displayed')
631
- listMatchingPage.steps.checkAnswer()
632
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
633
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
634
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
635
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
636
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
637
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
638
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
639
-
640
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab then 0 points should be awarded and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, \'Incorrect Answer\' label should be displayed below the table and correct answer container should be displayed with the correct answers for the user responses marked incorrect')
641
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
642
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
643
- listMatchingPage.previewScoreText()
644
- .verifyInnerText('0/7');
645
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
646
-
647
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
648
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
649
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
650
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
651
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
652
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
653
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
654
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
655
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
656
-
657
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, label \'Incorrect Answer\' should be displayed below the question field and correct answer container should not be displayed')
658
- listMatchingPage.steps.checkAnswer()
659
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
660
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
661
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
662
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
663
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
664
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
665
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
666
-
667
- cy.log('When user selects equal number of options from the correct tab and alternate tab then 0 points should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the correctly attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, label \'Incorrect Answer\' should be displayed below the table and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect')
668
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
669
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
670
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
671
- listMatchingPage.previewScoreText()
672
- .verifyInnerText('0/7');
673
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
674
-
675
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
676
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
677
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
678
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
679
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
680
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
681
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 3'], ['3']);
682
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
683
-
684
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, label \'Incorrect Answer\' should be displayed below the question field and correct answer container should not be displayed')
685
- listMatchingPage.steps.checkAnswer();
686
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
687
- listMatchingPage.steps.verifyIncorrectAttemptBorder()
688
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
689
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
690
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
691
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
692
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
693
- });
694
- },
695
-
696
- verifyMinimumScoreAwardedIfAttemptedForIncorrectAnswer: (totalPoints) => {
697
- it('When user has provided minimum score awarded (if attempted) points, then in Preview tab on entering incorrect answer, minimum score should be awarded for the question', () => {
698
- cy.log('Switch to edit tab and set minimum score if attempted points')
699
- listMatchingPage.steps.switchToEditTab();
700
- listMatchingPage.minimumScoreIfAttemptedInputField()
701
- .type('1')
702
- .should('have.value', '1');
703
- listMatchingPage.steps.switchToPreviewTab();
704
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 1);
705
- listMatchingPage.previewScoreText()
706
- .verifyInnerText(`1/${totalPoints}`);
707
- });
708
-
709
- it('When user removes minimum score awarded (if attempted) points, then in Preview tab on selecting any options other than correct answers, points should not be provided', () => {
710
- cy.log('Switch to edit tab and remove minimum score if attempted points')
711
- listMatchingPage.steps.switchToEditTab();
712
- listMatchingPage.steps.clearMinimumScoreIfAttemptedPointsField();
713
- listMatchingPage.steps.switchToPreviewTab()
714
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 1);
715
- listMatchingPage.previewScoreText()
716
- .verifyInnerText(`0/${totalPoints}`);
717
- });
718
-
719
- },
720
-
721
- verifyPenaltyPointsAwardedForIncorrectAnswer: (acquiredScore, totalPoints) => {
722
- it('When user has defined penalty points', () => {
723
- cy.log('Pre-step: Switch to edit tab and set penalty points');
724
- listMatchingPage.steps.switchToEditTab();
725
- listMatchingPage.steps.allotPenaltyPoints('2');
726
-
727
- cy.log('After switching to preview tab, when user adds an incorrect answer input, then 0 points should be awarded(no negative points)');
728
- listMatchingPage.steps.switchToPreviewTab();
729
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
730
- listMatchingPage.previewScoreText()
731
- .verifyInnerText(`0/${totalPoints}`);
732
-
733
- cy.log('When user adds a partially correct answer input, the points should be updated accordingly with deducted penalty points');
734
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
735
- listMatchingPage.previewScoreText()
736
- .verifyInnerText(`${acquiredScore}/${totalPoints}`);
737
- });
738
- },
739
-
740
- verifyPointsAwardedForIncorrectAnswerWhenMinimumScoreAwardedAndPenaltyPointsAreDefined: (acquiredScore, totalPoints) => {
741
- it('When user has defined both penalty points and minimum score awarded (if attempted) points', () => {
742
- cy.log('Pre-step: Switch to edit tab and set minimum score awarded (if attempted) points');
743
- listMatchingPage.steps.switchToEditTab();
744
- listMatchingPage.steps.allotMinimumScoreAwardedIfAttempted('1');
745
-
746
- cy.log('Switch to preview tab and give incorrect answer input to check that minimum points are displayed');
747
- listMatchingPage.steps.switchToPreviewTab();
748
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
749
- listMatchingPage.previewScoreText()
750
- .verifyInnerText(`1/${totalPoints}`);
751
-
752
- cy.log('When user adds a partially correct answer such that the points of the attempt(with penalty points deducted) is more than the minimum score awarded(if attempted) points');
753
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
754
- listMatchingPage.previewScoreText()
755
- .verifyInnerText(`${acquiredScore}/${totalPoints}`);
756
-
757
- cy.log('When user switches to edit tab and increases the minimum score awarded (if attempted) points to check the case for an attempt in which points of the attempt is less than minimum score awarded (if attempted) points, then the minimum score awarded (if attempted) points should be displayed to the user');
758
- listMatchingPage.steps.switchToEditTab();
759
- listMatchingPage.steps.clearMinimumScoreIfAttemptedPointsField()
760
- listMatchingPage.steps.allotMinimumScoreAwardedIfAttempted('9')
761
- cy.log('Switching to preview tab');
762
- listMatchingPage.steps.switchToPreviewTab();
763
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
764
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
765
- listMatchingPage.previewScoreText()
766
- .verifyInnerText(`9/${totalPoints}`);
767
- });
768
- },
769
-
770
- verifyAutoScoredPartialEqualWeightsScoring: () => {
771
- it('When the user selects \'Show correct answer\' checkbox without attempting the question, no correct/incorrect icons or label should be displayed, correct answer container along with \'Correct answers\' label and correct responses with numeric count should be displayed below the question field', () => {
772
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
773
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
774
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 1', 'Correct answer for stem 2'], ['1', '2']);
775
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
776
- });
777
-
778
- it('When user clicks on Check answer button without attempting the question, then then red cross-mark icon or green check-mark should not be displayed anywhere, correct/incorrect answer label and its border should not be displayed and the correct answer container should not be displayed', () => {
779
- listMatchingPage.steps.checkAnswer();
780
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
781
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
782
- });
783
-
784
- it('Case: When user adds incorrect response', () => {
785
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
786
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 1);
787
-
788
- cy.log('User should be awarded 0 points');
789
- listMatchingPage.previewScoreText()
790
- .verifyInnerText('0/20');
791
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
792
-
793
- cy.log('When user selects \'Show correct answer\' checkbox, red cross-mark icon should be displayed besides the incorrect response input fields, the correct answer container with correct answers should be displayed and correct/incorrect answer label and its border should not be displayed');
794
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
795
- listMatchingPage.steps.verifyIncorrectOptionsCrossMarkIconsForAllStemResponseAreas(2);
796
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
797
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
798
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 1', 'Correct answer for stem 2'], ['1', '2']);
799
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
800
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
801
-
802
- cy.log('When the user clicks on \'Check answer\' button, red cross-mark icon should be displayed besides the incorrect response input fields, correct/incorrect answer label and its border should not be displayed and the correct answer container should not be displayed');
803
- listMatchingPage.steps.checkAnswer();
804
- listMatchingPage.steps.verifyIncorrectOptionsCrossMarkIconsForAllStemResponseAreas(2);
805
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
806
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
807
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
808
- });
809
-
810
- it('Case: When user enters partially correct response without incorrect options', () => {
811
- cy.log('Filling only one response field with correct option and removing the other incorrect option from the response field to keep it blank');
812
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
813
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(1);
814
-
815
- cy.log('User should be awarded points as per the partially attempted correct responses');
816
- listMatchingPage.previewScoreText()
817
- .verifyInnerText('10/20');
818
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
819
-
820
- cy.log('When user selects the show correct answer checkbox, green check-mark icon should be displayed besides correct response input field, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct responses from the correct tab for the response fields left blank');
821
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
822
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
823
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
824
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
825
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
826
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 2'], ['2']);
827
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
828
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
829
-
830
- cy.log('When the user clicks on the \'Check answer\' button, green check-mark icon should be displayed besides correct response input field, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
831
- listMatchingPage.steps.checkAnswer();
832
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
833
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
834
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
835
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
836
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
837
- });
838
-
839
- it('Case: When user enters partially correct response along with incorrect options', () => {
840
- cy.log('Filling response field with incorrect option');
841
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 1);
842
-
843
- cy.log('User should be awarded points as per the partially attempted correct responses');
844
- listMatchingPage.previewScoreText()
845
- .verifyInnerText('10/20');
846
-
847
- cy.log('When user selects the show correct answer checkbox, green check-mark icon should be displayed besides correct response input field, red cross-mark icon should be displayed besides the incorrect response input field, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct responses from the correct tab for the user responses marked incorrect');
848
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
849
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
850
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
851
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
852
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
853
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 2'], ['2']);
854
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
855
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
856
-
857
- cy.log('When the user clicks on the \'Check answer\' button, green check-mark icon should be displayed besides correct response input field, red cross-mark icon should be displayed besides the incorrect response input field, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
858
- listMatchingPage.steps.checkAnswer();
859
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
860
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
861
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
862
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
863
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
864
- });
865
-
866
- it('Case: When user adds correct response', () => {
867
- cy.log('Adding correct response')
868
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
869
-
870
- cy.log('User should be awarded full points');
871
- listMatchingPage.previewScoreText()
872
- .verifyInnerText('20/20');
873
-
874
- cy.log('When the user selects the show correct answer checkbox, green check-mark icon should be displayed besides the correct response input fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
875
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
876
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(2);
877
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
878
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
879
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
880
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
881
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
882
-
883
- cy.log('When the user clicks on the \'Check answer\' button, green check-mark icon should be displayed besides the correct response input fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
884
- listMatchingPage.steps.checkAnswer();
885
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(2);
886
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
887
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
888
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
889
- });
890
- },
891
-
892
- verifyPartialEqualWeightsWithAlternateAnswerWhenCorrectPointsAreMoreThanAlternatePoints: (optionLayout) => {
893
- it('Alternate answer case: When Correct Answer points are more than Alternate Answer points', () => {
894
- cy.log('Total points displayed besides Show correct answer checkbox should be of Correct Answer points')
895
- listMatchingPage.previewScoreText()
896
- .verifyInnerText('0/20');
897
-
898
- cy.log('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');
899
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
900
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
901
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
902
-
903
- cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state')
904
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox();
905
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
906
-
907
- cy.log('When the user enters incorrect answer responses, 0 points should be awarded and on selecting \'Show correct answer\' checkbox red cross-mark icon should be displayed besides the attempted response fields, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with correct answer from the correct tab');
908
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
909
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 3);
910
- listMatchingPage.previewScoreText()
911
- .verifyInnerText('0/20');
912
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
913
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
914
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
915
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
916
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
917
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
918
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
919
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
920
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
921
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
922
-
923
- cy.log('When the user clicks on \'Check answer\' button, then red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
924
- listMatchingPage.steps.checkAnswer();
925
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
926
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
927
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
928
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
929
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
930
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
931
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
932
-
933
- cy.log('When the user attempts the question fully correct as set in the Correct tab, points specified for correct answer should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
934
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
935
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
936
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
937
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
938
- listMatchingPage.previewScoreText()
939
- .verifyInnerText('20/20');
940
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
941
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
942
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
943
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
944
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
945
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
946
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
947
-
948
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
949
- listMatchingPage.steps.checkAnswer();
950
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
951
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
952
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
953
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
954
-
955
- cy.log('When the user attempts the question fully correct as set in the Alternate tab, points specified for alternate correct answers should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
956
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
957
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
958
- listMatchingPage.previewScoreText()
959
- .verifyInnerText('12/20');
960
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
961
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
962
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
963
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
964
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
965
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
966
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
967
-
968
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
969
- listMatchingPage.steps.checkAnswer();
970
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
971
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
972
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
973
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
974
-
975
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab then user should be awarded with points for the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
976
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
977
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
978
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
979
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(3);
980
- listMatchingPage.previewScoreText()
981
- .verifyInnerText('10/20');
982
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
983
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
984
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
985
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
986
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
987
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
988
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
989
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
990
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
991
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
992
-
993
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
994
- listMatchingPage.steps.checkAnswer();
995
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
996
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
997
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
998
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
999
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1000
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1001
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1002
-
1003
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab then user should be awarded with points for the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect')
1004
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
1005
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
1006
- listMatchingPage.previewScoreText()
1007
- .verifyInnerText('6/20');
1008
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1009
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1010
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1011
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1012
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1013
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1014
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1015
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
1016
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1017
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1018
-
1019
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
1020
- listMatchingPage.steps.checkAnswer();
1021
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1022
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1023
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1024
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1025
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1026
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1027
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1028
-
1029
- cy.log('When user selects equal number of options from the correct tab and alternate tab then points of the correctly attempted responses from the correct tab should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
1030
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
1031
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1032
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
1033
- listMatchingPage.previewScoreText()
1034
- .verifyInnerText('15/20');
1035
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1036
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1037
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1038
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1039
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
1040
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1041
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1042
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 3'], ['3']);
1043
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1044
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1045
-
1046
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1047
- listMatchingPage.steps.checkAnswer();
1048
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1049
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1050
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1051
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
1052
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1053
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1054
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1055
-
1056
- cy.log('(Overachiever case) Pre-step: Switching to Edit tab and allotting points to correct and alternate tab such that the difference between the points is substantial and the points per response are in decimal');
1057
- listMatchingPage.steps.switchToEditTab();
1058
- listMatchingPage.steps.uncheckRoundDownScoreCheckbox();
1059
- switch (optionLayout) {
1060
- case 'standard':
1061
- listMatchingPage.steps.addOption();
1062
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Alternate answer for stem 1', 8);
1063
- listMatchingPage.steps.addOption();
1064
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Alternate answer for stem 4', 9);
1065
- break;
1066
- case 'grouped':
1067
- listMatchingPage.steps.addOptionInGroupedResponseLayout(0);
1068
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Alternate answer for stem 1', 4);
1069
- listMatchingPage.steps.addOptionInGroupedResponseLayout(1);
1070
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Alternate answer for stem 4', 9);
1071
- break;
1072
- default:
1073
- throw new Error('Invalid option layout');
1074
- }
1075
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Alternate answer for stem 1', 0);
1076
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Alternate answer for stem 4', 3);
1077
- listMatchingPage.steps.allotPoints('10');
1078
- listMatchingPage.steps.navigateToCorrectTab();
1079
- listMatchingPage.steps.allotPoints('50');
1080
- listMatchingPage.steps.switchToPreviewTab();
1081
-
1082
- cy.log('Overachiever case: When the user selects more number of correct options from the alternate tab than the correct tab but the score of the individual response selected from the correct tab overpowers the combined score of the alternate tab responses then green check-mark icon should be displayed for the attempted option from the correct tab, red cross-mark icon should be displayed for the attempted options from the alternate tab and points awarded should be of the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
1083
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 1', 0);
1084
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1085
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
1086
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 4', 3);
1087
- listMatchingPage.previewScoreText()
1088
- .verifyInnerText('12.5/50');
1089
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1090
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1091
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1092
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1093
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1094
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1095
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1096
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '3', '4']);
1097
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1098
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1099
-
1100
- cy.log('Overachiever case: When the user clicks on \'Check answer\' button, green check-mark icon should be displayed for the attempted option from the correct tab, red cross-mark icon should be displayed for the attempted options from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1101
- listMatchingPage.steps.checkAnswer();
1102
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1103
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1104
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1105
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1106
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1107
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1108
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1109
- });
1110
- },
1111
-
1112
- verifyPartialEqualWeightsWithAlternateAnswerWhenAlternatePointsAreMoreThanCorrectPoints: (optionLayout) => {
1113
- it('Alternate answer case: When Alternate Answer points are more than Correct Answer points', () => {
1114
- cy.log('Total points displayed besides Show correct answer checkbox should be of Alternate answer')
1115
- listMatchingPage.previewScoreText()
1116
- .verifyInnerText('0/24');
1117
-
1118
- cy.log('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')
1119
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1120
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Alternate answer for stem 2', 'Alternate answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
1121
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
1122
-
1123
- cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state')
1124
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox();
1125
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1126
-
1127
- cy.log('When the user enters incorrect answer responses, 0 points should be awarded and on selecting \'Show correct answer\' checkbox red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with correct answer from the alternate tab');
1128
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
1129
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 3);
1130
- listMatchingPage.previewScoreText()
1131
- .verifyInnerText('0/24');
1132
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1133
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1134
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1135
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
1136
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1137
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1138
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1139
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Alternate answer for stem 2', 'Alternate answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
1140
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1141
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1142
-
1143
- cy.log('When the user clicks on \'Check answer\' button, then red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1144
- listMatchingPage.steps.checkAnswer();
1145
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1146
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1147
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1148
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1149
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
1150
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1151
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1152
-
1153
- cy.log('When the user attempts the question fully correct as set in the Correct tab, points specified for correct answer should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1154
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
1155
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1156
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1157
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
1158
- listMatchingPage.previewScoreText()
1159
- .verifyInnerText('20/24');
1160
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1161
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
1162
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1163
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1164
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1165
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1166
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1167
-
1168
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1169
- listMatchingPage.steps.checkAnswer();
1170
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
1171
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1172
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1173
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1174
-
1175
- cy.log('When the user attempts the question fully correct as set in the Alternate tab, points specified for alternate correct answers should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1176
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
1177
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
1178
- listMatchingPage.previewScoreText()
1179
- .verifyInnerText('24/24');
1180
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1181
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
1182
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1183
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1184
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1185
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1186
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1187
-
1188
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1189
- listMatchingPage.steps.checkAnswer();
1190
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
1191
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1192
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1193
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1194
-
1195
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab then user should be awarded with points for the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
1196
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
1197
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1198
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1199
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(3);
1200
- listMatchingPage.previewScoreText()
1201
- .verifyInnerText('10/24');
1202
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1203
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1204
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1205
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1206
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1207
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1208
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1209
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
1210
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1211
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1212
-
1213
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
1214
- listMatchingPage.steps.checkAnswer();
1215
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1216
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1217
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1218
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1219
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1220
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1221
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1222
-
1223
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab then user should be awarded with the points for the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
1224
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
1225
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
1226
- listMatchingPage.previewScoreText()
1227
- .verifyInnerText('12/24');
1228
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1229
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1230
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1231
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1232
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1233
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1234
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1235
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
1236
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1237
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1238
-
1239
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1240
- listMatchingPage.steps.checkAnswer();
1241
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1242
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1243
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1244
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1245
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1246
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1247
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1248
-
1249
- cy.log('When user selects equal number of options from the correct tab and alternate tab then points of the correctly attempted responses from the alternate tab should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the alternate tab and red cross-mark icon should be displayed besides the attempted responses from the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
1250
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
1251
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1252
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
1253
- listMatchingPage.previewScoreText()
1254
- .verifyInnerText('18/24');
1255
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1256
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1257
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1258
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1259
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
1260
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1261
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1262
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Alternate answer for stem 3'], ['3']);
1263
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1264
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1265
-
1266
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the alternate tab and red cross-mark icon should be displayed besides the attempted responses from the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1267
- listMatchingPage.steps.checkAnswer();
1268
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1269
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1270
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1271
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
1272
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1273
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1274
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1275
-
1276
- cy.log('(Overachiever case) Pre-step: Switching to Edit tab and allotting points to correct and alternate tab such that the difference between the points is substantial and the points per response are in decimal');
1277
- listMatchingPage.steps.switchToEditTab();
1278
- listMatchingPage.steps.allotPoints('50');
1279
- switch (optionLayout) {
1280
- case 'standard':
1281
- listMatchingPage.steps.addOption();
1282
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 1', 8);
1283
- listMatchingPage.steps.addOption();
1284
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 4', 9);
1285
- break;
1286
- case 'grouped':
1287
- listMatchingPage.steps.addOptionInGroupedResponseLayout(0);
1288
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 1', 4);
1289
- listMatchingPage.steps.addOptionInGroupedResponseLayout(1);
1290
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 4', 9);
1291
- break;
1292
- default:
1293
- throw new Error('Invalid option layout');
1294
- }
1295
- listMatchingPage.steps.navigateToCorrectTab();
1296
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
1297
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 4', 3);
1298
- listMatchingPage.steps.allotPoints('10');
1299
- listMatchingPage.steps.switchToPreviewTab();
1300
-
1301
- cy.log('Overachiever case: When the user selects more number of correct options from the correct tab than the alternate tab but the score of the individual response selected from the alternate tab overpowers the combined score of the correct tab responses then green check-mark icon should be displayed for the attempted option from the alternate tab, red cross-mark icon should be displayed for the attempted options from the correct tab and points awarded should be of the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
1302
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
1303
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
1304
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1305
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 4', 3);
1306
- listMatchingPage.previewScoreText()
1307
- .verifyInnerText('12.5/50');
1308
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1309
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1310
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1311
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1312
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1313
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1314
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1315
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Alternate answer for stem 3', 'Common answer for stem 4'], ['1', '3', '4']);
1316
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1317
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1318
-
1319
- cy.log('Overachiever case: When the user clicks on \'Check answer\' button, green check-mark icon should be displayed for the attempted option from the alternate tab, red cross-mark icon should be displayed for the attempted options from the correct tab and points awarded should be of the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1320
- listMatchingPage.steps.checkAnswer();
1321
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1322
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1323
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1324
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1325
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1326
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1327
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1328
- });
1329
- },
1330
-
1331
- verifyPartialEqualWeightsWithAlternateAnswerWhenCorrectPointsAreEqualToAlternatePoints: () => {
1332
- it('Alternate answer case: When Alternate answer points and correct answer points both are equal', () => {
1333
- cy.log('Pre step: Switching to Edit tab and allotting points of Alternate answer equal to correct answer')
1334
- cy.log('Checking total points displayed')
1335
- listMatchingPage.previewScoreText()
1336
- .verifyInnerText('0/20');
1337
-
1338
- cy.log('When the user selects the Show correct answer checkbox without attempting the question, correct answer container should be displayed with the correct responses from the correct tab and no label should be displayed below the question field')
1339
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
1340
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
1341
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
1342
-
1343
- cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state')
1344
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox()
1345
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1346
-
1347
- cy.log('When the user enters incorrect answer responses, 0 points should be awarded and on selecting \'Show correct answer\' checkbox red cross-mark icon should be displayed besides the attempted response fields, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with correct answer from the correct tab');
1348
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
1349
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 3);
1350
- listMatchingPage.previewScoreText()
1351
- .verifyInnerText('0/20');
1352
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
1353
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1354
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1355
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
1356
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1357
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1358
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1359
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
1360
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1361
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1362
-
1363
- cy.log('When the user clicks on \'Check answer\' button, then red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1364
- listMatchingPage.steps.checkAnswer()
1365
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1366
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1367
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1368
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1369
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
1370
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1371
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1372
-
1373
- cy.log('When the user attempts the question fully correct as set in the Correct tab, points specified for correct answer should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1374
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
1375
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1376
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1377
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
1378
- listMatchingPage.previewScoreText()
1379
- .verifyInnerText('20/20');
1380
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
1381
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
1382
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1383
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1384
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1385
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1386
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1387
-
1388
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, label \'Correct Answer\' should be displayed below the below the question field and correct answer container should not be displayed')
1389
- listMatchingPage.steps.checkAnswer()
1390
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1391
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1392
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
1393
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1394
-
1395
- cy.log('When the user attempts the question fully correct as set in the Alternate tab, points specified for alternate correct answer should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
1396
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
1397
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
1398
- listMatchingPage.previewScoreText()
1399
- .verifyInnerText('20/20');
1400
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
1401
-
1402
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
1403
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1404
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1405
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1406
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1407
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1408
-
1409
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
1410
- listMatchingPage.steps.checkAnswer()
1411
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1412
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1413
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(4);
1414
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1415
-
1416
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab then user should be awarded with points for the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
1417
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
1418
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1419
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1420
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(3);
1421
- listMatchingPage.previewScoreText()
1422
- .verifyInnerText('10/20');
1423
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1424
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1425
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1426
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1427
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1428
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1429
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1430
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
1431
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1432
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1433
-
1434
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
1435
- listMatchingPage.steps.checkAnswer();
1436
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1437
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1438
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1439
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1440
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1441
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1442
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1443
-
1444
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab then user should be awarded with the points for the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
1445
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
1446
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
1447
- listMatchingPage.previewScoreText()
1448
- .verifyInnerText('10/20');
1449
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1450
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1451
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1452
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1453
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1454
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1455
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1456
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
1457
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1458
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1459
-
1460
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1461
- listMatchingPage.steps.checkAnswer();
1462
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1463
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1464
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1465
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1466
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1467
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1468
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1469
-
1470
- cy.log('When user selects equal number of options from the correct tab and alternate tab then points of the correctly attempted responses from the correct tab should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
1471
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
1472
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1473
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
1474
- listMatchingPage.previewScoreText()
1475
- .verifyInnerText('15/20');
1476
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1477
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1478
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1479
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1480
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
1481
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1482
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1483
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 3'], ['3']);
1484
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1485
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1486
-
1487
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1488
- listMatchingPage.steps.checkAnswer();
1489
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1490
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1491
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1492
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
1493
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1494
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1495
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1496
- });
1497
- },
1498
-
1499
- verifyAutoScoredPartialEqualWeightsRoundDownScore: () => {
1500
- it('When the \'Round down score\' checkbox is not selected, then in Preview tab when user selects partially or fully correct answers the points should be displayed in decimal points if applicable as per the options selected by the user', () => {
1501
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
1502
- listMatchingPage.previewScoreText()
1503
- .verifyInnerText('4.25/8.5');
1504
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1505
- listMatchingPage.previewScoreText()
1506
- .verifyInnerText('8.5/8.5');
1507
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
1508
- });
1509
-
1510
- it('When the \'Round down score\' checkbox is selected, then in Preview tab when user enters partially or fully correct answers responses the points displayed should be rounded down to the nearest whole number', () => {
1511
- listMatchingPage.steps.switchToEditTab();
1512
- listMatchingPage.steps.expandRoundingDropdown();
1513
- listMatchingPage.steps.selectOptionFromRoundingDropdownOption('round down if <= 0.99');
1514
- listMatchingPage.steps.switchToPreviewTab();
1515
- listMatchingPage.previewScoreText()
1516
- .verifyInnerText('0/8.5');
1517
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
1518
- listMatchingPage.previewScoreText()
1519
- .verifyInnerText('4/8.5');
1520
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
1521
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1522
- listMatchingPage.previewScoreText()
1523
- .verifyInnerText('8/8.5');
1524
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
1525
- });
1526
- },
1527
-
1528
- verifyAutoScoredPartialDifferentWeightsScoring: () => {
1529
- it('When the user selects \'Show correct answer\' checkbox without attempting the question, no correct/incorrect icons or label should be displayed, correct answer container along with \'Correct answers\' label and correct responses with numeric count should be displayed below the question field', () => {
1530
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1531
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
1532
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 1', 'Correct answer for stem 2'], ['1', '2']);
1533
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1534
- });
1535
-
1536
- it('When user clicks on Check answer button without attempting the question, then then red cross-mark icon or green check-mark should not be displayed anywhere, correct/incorrect answer label and its border should not be displayed and the correct answer container should not be displayed', () => {
1537
- listMatchingPage.steps.checkAnswer();
1538
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
1539
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1540
- });
1541
-
1542
- it('Case: When user adds incorrect response', () => {
1543
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
1544
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 1);
1545
-
1546
- cy.log('User should be awarded 0 points');
1547
- listMatchingPage.previewScoreText()
1548
- .verifyInnerText('0/10');
1549
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
1550
-
1551
- cy.log('When user selects \'Show correct answer\' checkbox, red cross-mark icon should be displayed besides the incorrect answers input fields, the correct answer container with correct answers should be displayed and correct/incorrect answer label and its border should not be displayed');
1552
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1553
- listMatchingPage.steps.verifyIncorrectOptionsCrossMarkIconsForAllStemResponseAreas(2);
1554
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1555
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1556
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 1', 'Correct answer for stem 2'], ['1', '2']);
1557
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1558
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1559
-
1560
- cy.log('When the user clicks on \'Check answer\' button, red cross-mark icon should be displayed besides the incorrect response field, correct/incorrect answer label and its border should not be displayed');
1561
- listMatchingPage.steps.checkAnswer();
1562
- listMatchingPage.steps.verifyIncorrectOptionsCrossMarkIconsForAllStemResponseAreas(2);
1563
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1564
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1565
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1566
- });
1567
-
1568
- it('Case: When user enters partially correct response without incorrect options', () => {
1569
- cy.log('Filling only one response field with correct option and removing the other incorrect option from the response field to keep it blank');
1570
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
1571
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(1);
1572
-
1573
- cy.log('User should be awarded points as per the partially attempted correct responses');
1574
- listMatchingPage.previewScoreText()
1575
- .verifyInnerText('5.4/10');
1576
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
1577
-
1578
- cy.log('When user selects the show correct answer checkbox, green check-mark icon should be displayed besides correct response input field, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct responses from the correct tab');
1579
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1580
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1581
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1582
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1583
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1584
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 2'], ['2']);
1585
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1586
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1587
-
1588
- cy.log('When the user clicks on the \'Check answer\' button, green check-mark icon should be displayed besides correct response input field, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1589
- listMatchingPage.steps.checkAnswer();
1590
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1591
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1592
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1593
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1594
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1595
- });
1596
-
1597
- it('Case: When user enters partially correct response along with incorrect options', () => {
1598
- cy.log('Filling response field with incorrect option');
1599
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 1);
1600
-
1601
- cy.log('User should be awarded points as per the partially attempted correct responses');
1602
- listMatchingPage.previewScoreText()
1603
- .verifyInnerText('5.4/10');
1604
-
1605
- cy.log('When user selects the show correct answer checkbox, green check-mark icon should be displayed besides correct response input field, red cross-mark icon should be displayed besides the incorrect response input field, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct responses from the correct tab for the user responses marked incorrect');
1606
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1607
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1608
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
1609
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1610
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1611
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 2'], ['2']);
1612
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1613
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1614
-
1615
- cy.log('When the user clicks on the \'Check answer\' button, green check-mark icon should be displayed besides correct response input field, red cross-mark icon should be displayed besides the incorrect response input field, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1616
- listMatchingPage.steps.checkAnswer();
1617
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1618
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
1619
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1620
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1621
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1622
- });
1623
-
1624
- it('Case: When user adds correct response', () => {
1625
- cy.log('Adding correct response')
1626
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1627
-
1628
- cy.log('User should be awarded full points');
1629
- listMatchingPage.previewScoreText()
1630
- .verifyInnerText('10/10');
1631
-
1632
- cy.log('When the user selects the show correct answer checkbox, green check-mark icon should be displayed besides the correct response input fields, correct answer container should not be displayed and a correct/incorrect answer label and its border should not be displayed');
1633
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1634
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(2);
1635
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1636
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1637
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1638
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1639
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1640
-
1641
- cy.log('When the user clicks on the \'Check answer\' button, green check-mark icon should be displayed besides the correct response input fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1642
- listMatchingPage.steps.checkAnswer();
1643
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas(2);
1644
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1645
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1646
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1647
- });
1648
- },
1649
-
1650
- verifyPartialDifferentWeightWithAlternateAnswerWhenCorrectPointsMoreThanAlternatePoints
1651
- : (optionLayout) => {
1652
- it('Alternate answer case: When Correct Answer points are more than Alternate Answer points', () => {
1653
- cy.log('Total points displayed besides Show correct answer checkbox should be of Correct Answer points')
1654
- listMatchingPage.previewScoreText()
1655
- .verifyInnerText('0/24');
1656
-
1657
- cy.log('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');
1658
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1659
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
1660
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
1661
-
1662
- cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state')
1663
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox();
1664
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1665
-
1666
- cy.log('When the user enters incorrect answer responses, 0 points should be awarded and on selecting \'Show correct answer\' checkbox red cross-mark icon should be displayed besides the attempted response fields, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with correct answer from the correct tab');
1667
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
1668
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 3);
1669
- listMatchingPage.previewScoreText()
1670
- .verifyInnerText('0/24');
1671
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1672
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1673
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1674
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
1675
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1676
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1677
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1678
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
1679
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1680
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1681
-
1682
- cy.log('When the user clicks on \'Check answer\' button, then red cross-mark icon should be displayed besides the attempted response fields, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1683
- listMatchingPage.steps.checkAnswer();
1684
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1685
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1686
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
1687
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1688
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1689
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1690
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1691
-
1692
- cy.log('When the user attempts the question fully correct as set in the Correct tab, points specified for correct answer should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1693
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
1694
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1695
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1696
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
1697
- listMatchingPage.previewScoreText()
1698
- .verifyInnerText('24/24');
1699
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1700
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
1701
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1702
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1703
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1704
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1705
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1706
-
1707
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1708
- listMatchingPage.steps.checkAnswer();
1709
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
1710
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1711
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1712
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1713
-
1714
- cy.log('When the user attempts the question fully correct as set in the Alternate tab, points specified for alternate correct answers should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1715
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
1716
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
1717
- listMatchingPage.previewScoreText()
1718
- .verifyInnerText('20/24');
1719
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1720
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
1721
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1722
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1723
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1724
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1725
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1726
-
1727
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1728
- listMatchingPage.steps.checkAnswer();
1729
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
1730
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1731
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1732
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1733
-
1734
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab then user should be awarded with points for the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
1735
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
1736
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1737
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1738
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(3);
1739
- listMatchingPage.previewScoreText()
1740
- .verifyInnerText('11/24');
1741
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1742
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1743
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1744
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1745
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1746
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1747
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1748
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
1749
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1750
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1751
-
1752
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
1753
- listMatchingPage.steps.checkAnswer();
1754
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1755
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1756
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1757
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1758
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1759
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1760
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1761
-
1762
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab then user should be awarded with points for the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect')
1763
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
1764
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
1765
- listMatchingPage.previewScoreText()
1766
- .verifyInnerText('11/24');
1767
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1768
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1769
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1770
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1771
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1772
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1773
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1774
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
1775
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1776
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1777
-
1778
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
1779
- listMatchingPage.steps.checkAnswer();
1780
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1781
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1782
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1783
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1784
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1785
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1786
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1787
-
1788
- cy.log('When user selects equal number of options from the correct tab and alternate tab then points of the correctly attempted options from the tab that awards maximum points i.e. alternate tab in this case should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the alternate tab and red cross-mark icon should be displayed besides the attempted responses from the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
1789
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
1790
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1791
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
1792
- listMatchingPage.previewScoreText()
1793
- .verifyInnerText('18/24');
1794
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1795
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1796
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1797
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1798
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
1799
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1800
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1801
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 3'], ['3']);
1802
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1803
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1804
-
1805
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the alternate tab and red cross-mark icon should be displayed besides the attempted responses from the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1806
- listMatchingPage.steps.checkAnswer();
1807
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1808
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1809
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1810
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
1811
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1812
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1813
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1814
-
1815
- cy.log('When user selects equal number of options from the correct tab and alternate tab then points of the correctly attempted options from the tab that awards maximum points i.e. correct tab in this case should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
1816
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1817
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
1818
- listMatchingPage.previewScoreText()
1819
- .verifyInnerText('20/24');
1820
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1821
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1822
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1823
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1824
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
1825
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1826
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1827
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 3'], ['3']);
1828
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1829
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1830
-
1831
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1832
- listMatchingPage.steps.checkAnswer();
1833
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1834
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1835
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
1836
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
1837
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1838
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1839
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1840
-
1841
- cy.log('(Overachiever case) Pre-step: Switching to Edit tab and allotting points to correct and alternate tab such that the difference between the points is substantial and the points per response are in decimal');
1842
- listMatchingPage.steps.switchToEditTab();
1843
- switch (optionLayout) {
1844
- case 'standard':
1845
- listMatchingPage.steps.addOption();
1846
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Alternate answer for stem 1', 8);
1847
- listMatchingPage.steps.addOption();
1848
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Alternate answer for stem 4', 9);
1849
- break;
1850
- case 'grouped':
1851
- listMatchingPage.steps.addOptionInGroupedResponseLayout(0);
1852
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Alternate answer for stem 1', 4);
1853
- listMatchingPage.steps.addOptionInGroupedResponseLayout(1);
1854
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Alternate answer for stem 4', 9);
1855
- break;
1856
- default:
1857
- throw new Error('Invalid option layout');
1858
- }
1859
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Alternate answer for stem 1', 0);
1860
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Alternate answer for stem 4', 3);
1861
- listMatchingPage.steps.addPartialDifferentWeightsPoints([4.5, 1.5, 2.5, 3.5]);
1862
- listMatchingPage.steps.navigateToCorrectTab();
1863
- listMatchingPage.steps.addPartialDifferentWeightsPoints([5.5, 14.5, 17.5, 12.5]);
1864
- listMatchingPage.steps.switchToPreviewTab();
1865
-
1866
- cy.log('Overachiever case: When the user selects more number of correct options from the alternate tab than the correct tab but the score of the individual response selected from the correct tab overpowers the combined score of the alternate tab responses then green check-mark icon should be displayed for the attempted option from the correct tab, red cross-mark icon should be displayed for the attempted options from the alternate tab and points awarded should be of the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
1867
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 1', 0);
1868
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
1869
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1870
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 4', 3);
1871
- listMatchingPage.previewScoreText()
1872
- .verifyInnerText('17.5/50');
1873
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1874
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1875
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
1876
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1877
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1878
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1879
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1880
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Common answer for stem 4'], ['1', '2', '4']);
1881
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1882
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1883
-
1884
- cy.log('Overachiever case: When the user clicks on \'Check answer\' button, green check-mark icon should be displayed for the attempted option from the correct tab, red cross-mark icon should be displayed for the attempted options from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1885
- listMatchingPage.steps.checkAnswer();
1886
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1887
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
1888
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1889
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1890
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1891
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1892
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1893
- });
1894
- },
1895
-
1896
- verifyPartialDifferentWeightWithAlternateAnswerWhenAlternatePointsMoreThanCorrectPoints: (optionLayout) => {
1897
- it('Alternate answer case: When Alternate Answer points are more than Correct Answer points', () => {
1898
- cy.log('Total points displayed besides Show correct answer checkbox should be of Alternate answer points')
1899
- listMatchingPage.previewScoreText()
1900
- .verifyInnerText('0/29');
1901
-
1902
- cy.log('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')
1903
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1904
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Alternate answer for stem 2', 'Alternate answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
1905
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
1906
-
1907
- cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state')
1908
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox();
1909
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1910
-
1911
- cy.log('When the user enters incorrect answer responses, 0 points should be awarded and on selecting \'Show correct answer\' checkbox red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses and label \'Incorrect Answer\' should be displayed below the question field and correct answer container should be displayed with correct answer from the alternate tab');
1912
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
1913
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 3);
1914
- listMatchingPage.previewScoreText()
1915
- .verifyInnerText('0/29');
1916
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1917
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1918
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1919
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
1920
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1921
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1922
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1923
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Alternate answer for stem 2', 'Alternate answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
1924
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1925
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1926
-
1927
- cy.log('When the user clicks on \'Check answer\' button, then red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses and label \'Incorrect Answer\' should be displayed below the below the question field and correct answer container should not be displayed');
1928
- listMatchingPage.steps.checkAnswer();
1929
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1930
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1931
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1932
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1933
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
1934
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
1935
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1936
-
1937
- cy.log('When the user attempts the question fully correct as set in the Correct tab, points specified for correct answer should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1938
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
1939
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1940
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1941
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
1942
- listMatchingPage.previewScoreText()
1943
- .verifyInnerText('24/29');
1944
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1945
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
1946
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1947
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1948
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1949
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1950
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1951
-
1952
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1953
- listMatchingPage.steps.checkAnswer();
1954
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
1955
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1956
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1957
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1958
-
1959
- cy.log('When the user attempts the question fully correct as set in the Alternate tab, points specified for alternate correct answers should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1960
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
1961
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
1962
- listMatchingPage.previewScoreText()
1963
- .verifyInnerText('29/29');
1964
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1965
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
1966
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1967
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1968
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1969
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1970
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1971
-
1972
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
1973
- listMatchingPage.steps.checkAnswer();
1974
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
1975
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1976
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1977
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1978
-
1979
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab then user should be awarded with points for the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
1980
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
1981
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
1982
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
1983
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(3);
1984
- listMatchingPage.previewScoreText()
1985
- .verifyInnerText('11/29');
1986
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
1987
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
1988
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
1989
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
1990
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
1991
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
1992
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
1993
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
1994
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1995
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
1996
-
1997
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
1998
- listMatchingPage.steps.checkAnswer();
1999
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2000
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2001
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2002
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
2003
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2004
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2005
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2006
-
2007
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab then user should be awarded with the points for the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
2008
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
2009
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
2010
- listMatchingPage.previewScoreText()
2011
- .verifyInnerText('15/29');
2012
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2013
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2014
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2015
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2016
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
2017
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2018
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2019
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
2020
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2021
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2022
-
2023
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
2024
- listMatchingPage.steps.checkAnswer();
2025
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2026
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2027
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2028
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
2029
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2030
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2031
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2032
-
2033
- cy.log('When user selects equal number of options from the correct tab and alternate tab then points of the correctly attempted options from the tab that awards maximum points i.e. alternate tab in this case should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the alternate tab and red cross-mark icon should be displayed besides the attempted responses from the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
2034
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
2035
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
2036
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
2037
- listMatchingPage.previewScoreText()
2038
- .verifyInnerText('23/29');
2039
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2040
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2041
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2042
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
2043
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
2044
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2045
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2046
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Alternate answer for stem 3'], ['3']);
2047
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2048
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2049
-
2050
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the alternate tab and red cross-mark icon should be displayed besides the attempted responses from the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
2051
- listMatchingPage.steps.checkAnswer();
2052
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2053
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2054
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
2055
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
2056
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2057
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2058
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2059
-
2060
- cy.log('When user selects equal number of options from the correct tab and alternate tab then points of the correctly attempted options from the tab that awards maximum points i.e. correct tab in this case should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the alternate tab for the user responses marked incorrect');
2061
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
2062
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
2063
- listMatchingPage.previewScoreText()
2064
- .verifyInnerText('20/29');
2065
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2066
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2067
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2068
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
2069
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
2070
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2071
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2072
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Alternate answer for stem 3'], ['3']);
2073
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2074
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2075
-
2076
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
2077
- listMatchingPage.steps.checkAnswer();
2078
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2079
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2080
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
2081
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
2082
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2083
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2084
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2085
-
2086
- cy.log('(Overachiever case) Pre-step: Switching to Edit tab and allotting points to correct and alternate tab such that the difference between the points is substantial and the points per response are in decimal');
2087
- listMatchingPage.steps.switchToEditTab();
2088
- switch (optionLayout) {
2089
- case 'standard':
2090
- listMatchingPage.steps.addOption();
2091
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 1', 8);
2092
- listMatchingPage.steps.addOption();
2093
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 4', 9);
2094
- break;
2095
- case 'grouped':
2096
- listMatchingPage.steps.addOptionInGroupedResponseLayout(0);
2097
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 1', 4);
2098
- listMatchingPage.steps.addOptionInGroupedResponseLayout(1);
2099
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 4', 9);
2100
- break;
2101
- default:
2102
- throw new Error('Invalid option layout');
2103
- }
2104
- listMatchingPage.steps.addPartialDifferentWeightsPoints([5.5, 14.5, 17.5, 12.5]);
2105
- listMatchingPage.steps.navigateToCorrectTab();
2106
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
2107
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 4', 3);
2108
- listMatchingPage.steps.addPartialDifferentWeightsPoints([4.5, 1.5, 2.5, 3.5]);
2109
- listMatchingPage.steps.switchToPreviewTab();
2110
-
2111
- cy.log('Overachiever case: When the selects user more number of correct options from the correct tab than the alternate tab but the score of the individual response selected from the alternate tab overpowers the combined score of the correct tab answers then green check-mark icon should be displayed for the attempted option from the alternate tab, red cross-mark icon should be displayed for the attempted options from the correct tab and points awarded should be of the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the alternate tab for the user responses marked incorrect');
2112
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
2113
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
2114
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
2115
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 4', 3);
2116
- listMatchingPage.previewScoreText()
2117
- .verifyInnerText('17.5/50');
2118
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2119
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2120
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
2121
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2122
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
2123
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2124
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2125
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Alternate answer for stem 2', 'Common answer for stem 4'], ['1', '2', '4']);
2126
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2127
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2128
-
2129
- cy.log('Overachiever case: When the user clicks on \'Check answer\' button, green check-mark icon should be displayed for the attempted option from the alternate tab, red cross-mark icon should be displayed for the attempted options from the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
2130
- listMatchingPage.steps.checkAnswer();
2131
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2132
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
2133
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2134
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
2135
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2136
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2137
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2138
- });
2139
- },
2140
-
2141
- verifyPartialDifferentWeightWithAlternateAnswerWhenCorrectPointsEqualToAlternatePoints: (optionLayout) => {
2142
- it('Alternate answer case: When Alternate answer points and correct answer points both are equal', () => {
2143
- cy.log('Checking total points displayed')
2144
- listMatchingPage.previewScoreText()
2145
- .verifyInnerText('0/24');
2146
-
2147
- cy.log('When the user selects the Show correct answer checkbox without attempting the question, correct answer container should be displayed with the correct responses from the correct tab and no label should be displayed below the question field')
2148
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
2149
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
2150
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
2151
-
2152
- cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state')
2153
- listMatchingPage.steps.uncheckShowCorrectAnswerCheckbox()
2154
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2155
-
2156
- cy.log('When the user enters incorrect answer responses, 0 points should be awarded and on selecting \'Show correct answer\' checkbox red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with correct answer from the correct tab');
2157
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
2158
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 3);
2159
- listMatchingPage.previewScoreText()
2160
- .verifyInnerText('0/24');
2161
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
2162
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2163
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
2164
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
2165
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
2166
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2167
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2168
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3', 'Common answer for stem 4'], ['1', '2', '3', '4']);
2169
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2170
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2171
-
2172
- cy.log('When the user clicks on \'Check answer\' button, then red cross-mark icon should be displayed besides attempted response fields, no icon should be displayed beside the unattempted responses,correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
2173
- listMatchingPage.steps.checkAnswer()
2174
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2175
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2176
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2177
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
2178
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(2);
2179
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
2180
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2181
-
2182
- cy.log('When the user attempts the question fully correct as set in the Correct tab, points specified for correct answer should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
2183
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
2184
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
2185
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
2186
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
2187
- listMatchingPage.previewScoreText()
2188
- .verifyInnerText('24/24');
2189
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2190
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
2191
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2192
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2193
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2194
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2195
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2196
-
2197
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, and label \'Correct Answer\' should be displayed below the below the question field and correct answer container should not be displayed')
2198
- listMatchingPage.steps.checkAnswer()
2199
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2200
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2201
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
2202
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2203
-
2204
- cy.log('When the user attempts the question fully correct as set in the Alternate tab, points specified for alternate correct answer should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
2205
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
2206
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
2207
- listMatchingPage.previewScoreText()
2208
- .verifyInnerText('24/24');
2209
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox()
2210
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
2211
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2212
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2213
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2214
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2215
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2216
-
2217
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides all the response fields, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
2218
- listMatchingPage.steps.checkAnswer()
2219
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2220
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2221
- listMatchingPage.steps.verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas();
2222
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2223
-
2224
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the correct tab then user should be awarded with points of the correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
2225
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
2226
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
2227
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
2228
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(3);
2229
- listMatchingPage.previewScoreText()
2230
- .verifyInnerText('11/24');
2231
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2232
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2233
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2234
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2235
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
2236
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2237
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2238
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
2239
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2240
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2241
-
2242
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed')
2243
- listMatchingPage.steps.checkAnswer();
2244
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2245
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2246
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2247
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
2248
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2249
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2250
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2251
-
2252
- cy.log('When user selects partially correct answer options such that user has selected correct options only from the alternate tab then user should be awarded with the points from selected correctly attempted responses and on selecting show correct answer checkbox then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers for the user responses marked incorrect');
2253
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
2254
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
2255
- listMatchingPage.previewScoreText()
2256
- .verifyInnerText('13/24');
2257
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2258
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2259
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2260
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2261
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
2262
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2263
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2264
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Common answer for stem 1', 'Common answer for stem 4'], ['1', '4']);
2265
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2266
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2267
-
2268
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icons should be displayed beside the correctly attempted responses from the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted response fields, no icon should be displayed beside the unattempted response, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
2269
- listMatchingPage.steps.checkAnswer();
2270
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2271
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2272
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2273
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(3);
2274
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2275
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2276
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2277
-
2278
- cy.log('When user selects equal number of options from the correct tab and alternate tab then points of the correctly attempted options from the tab that awards maximum points i.e. alternate tab in this case should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the alternate tab and red cross-mark icon should be displayed besides the attempted responses from the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the alternate tab for the user responses marked incorrect');
2279
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
2280
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
2281
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
2282
- listMatchingPage.previewScoreText()
2283
- .verifyInnerText('20/24');
2284
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2285
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2286
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2287
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
2288
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
2289
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2290
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2291
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Alternate answer for stem 3'], ['3']);
2292
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2293
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2294
-
2295
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the alternate tab and red cross-mark icon should be displayed besides the attempted responses from the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
2296
- listMatchingPage.steps.checkAnswer();
2297
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2298
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2299
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
2300
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
2301
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2302
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2303
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2304
-
2305
- cy.log('When user selects equal number of options from the correct tab and alternate tab then points of the correctly attempted options from the tab that awards maximum points i.e. correct tab in this case should be awarded and on selecting show correct answer checkbox green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
2306
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
2307
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 3', 2);
2308
- listMatchingPage.previewScoreText()
2309
- .verifyInnerText('20/24');
2310
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2311
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2312
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2313
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
2314
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
2315
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2316
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2317
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 3'], ['3']);
2318
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2319
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2320
-
2321
- cy.log('When the user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides the attempted responses from the correct tab and red cross-mark icon should be displayed besides the attempted responses from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
2322
- listMatchingPage.steps.checkAnswer();
2323
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2324
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2325
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
2326
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(3);
2327
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2328
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2329
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2330
-
2331
- cy.log('(Overachiever case) Pre-step: Switching to Edit tab, allotting points to correct and alternate tab such that the difference between the points is substantial and the points per response are in decimal');
2332
- listMatchingPage.steps.switchToEditTab();
2333
- listMatchingPage.steps.addPartialDifferentWeightsPoints([9.1, 8.3, 12.5, 7.7]);
2334
- listMatchingPage.steps.navigateToCorrectTab();
2335
- switch (optionLayout) {
2336
- case 'standard':
2337
- listMatchingPage.steps.addOption();
2338
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 1', 8);
2339
- listMatchingPage.steps.addOption();
2340
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 4', 9);
2341
- break;
2342
- case 'grouped':
2343
- listMatchingPage.steps.addOptionInGroupedResponseLayout(0);
2344
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 1', 4);
2345
- listMatchingPage.steps.addOptionInGroupedResponseLayout(1);
2346
- listMatchingPage.steps.addInputToOptionForDragAndDropInputField('Correct answer for stem 4', 9);
2347
- break;
2348
- default:
2349
- throw new Error('Invalid option layout');
2350
- }
2351
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
2352
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 4', 3);
2353
- listMatchingPage.steps.addPartialDifferentWeightsPoints([1.1, 2.3, 30.5, 3.7]);
2354
- listMatchingPage.steps.switchToPreviewTab();
2355
-
2356
- cy.log('Overachiever case: When the selects user more number of correct options from the alternate tab than the correct tab but the score of the individual response selected from the correct tab overpowers the combined score of the alternate tab answers then green check-mark icon should be displayed for the attempted option from the correct tab, red cross-mark icon should be displayed for the attempted options from the alternate tab and points awarded should be of the correct tab, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with the correct answers from the correct tab for the user responses marked incorrect');
2357
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 1', 0);
2358
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Alternate answer for stem 2', 1);
2359
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 3', 2);
2360
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Common answer for stem 4', 3);
2361
- listMatchingPage.previewScoreText()
2362
- .verifyInnerText('30.5/37.6');
2363
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2364
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2365
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
2366
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2367
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
2368
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2369
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2370
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 4'], ['1', '2', '4']);
2371
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2372
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2373
-
2374
- cy.log('Overachiever case: When the user clicks on \'Check answer\' button, green check-mark icon should be displayed for the attempted option from the correct tab, red cross-mark icon should be displayed for the attempted options from the alternate tab, correct/incorrect answer label and its border should not be displayed and correct answer container should not be displayed');
2375
- listMatchingPage.steps.checkAnswer();
2376
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2377
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
2378
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(2);
2379
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
2380
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
2381
- listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
2382
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2383
-
2384
- cy.log('(Overachiever case) Post-step: Switching to Edit tab and removing unique option responses given for correct tab, setting proper option responses for the same');
2385
- listMatchingPage.steps.switchToEditTab();
2386
- switch (optionLayout) {
2387
- case 'standard':
2388
- listMatchingPage.steps.deleteResponseOptionInputField(9);
2389
- listMatchingPage.steps.deleteResponseOptionInputField(8);
2390
- break;
2391
- case 'grouped':
2392
- listMatchingPage.steps.deleteResponseOptionInputField(9);
2393
- listMatchingPage.steps.deleteResponseOptionInputField(4);
2394
- break;
2395
- default:
2396
- throw new Error('Invalid option layout');
2397
- }
2398
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Common answer for stem 1', 0);
2399
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Common answer for stem 4', 3);
2400
- listMatchingPage.steps.addPartialDifferentWeightsPoints([5, 7, 4, 8]);
2401
- listMatchingPage.steps.navigateToAlternateTab(1);
2402
- listMatchingPage.steps.addPartialDifferentWeightsPoints([6, 9, 4, 5]);
2403
- });
2404
- },
2405
-
2406
- verifyAutoScoredPartialDifferentWeightsRoundDownScore: () => {
2407
- it('When the \'Round down score\' checkbox is not selected, then in Preview tab when user selects partially or fully correct answers the points should be displayed in decimal points if applicable as per the options selected by the user', () => {
2408
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
2409
- listMatchingPage.previewScoreText()
2410
- .verifyInnerText('4.1/7.4');
2411
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
2412
- listMatchingPage.previewScoreText()
2413
- .verifyInnerText('7.4/7.4');
2414
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
2415
- });
2416
-
2417
- it('When the \'Round down score\' checkbox is selected, then in Preview tab when user enters partially or fully correct answers responses the points displayed should be rounded down to the nearest whole number', () => {
2418
- listMatchingPage.steps.switchToEditTab()
2419
- listMatchingPage.steps.expandRoundingDropdown();
2420
- listMatchingPage.steps.selectOptionFromRoundingDropdownOption('round down if <= 0.99');
2421
- listMatchingPage.steps.switchToPreviewTab();
2422
- listMatchingPage.previewScoreText()
2423
- .verifyInnerText('0/7.4');
2424
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
2425
- listMatchingPage.previewScoreText()
2426
- .verifyInnerText('4/7.4');
2427
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
2428
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
2429
- listMatchingPage.previewScoreText()
2430
- .verifyInnerText('7/7.4');
2431
- listMatchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
2432
- });
2433
- },
2434
-
2435
- verifyNonScoredScoring: () => {
2436
- previewScoringAndShowCorrectAnswerComponent.tests.verifyShowCorrectAnswerLabelAndCheckboxExistAndPreviewScoreNotExistInPreviewTab();
2437
-
2438
- it('When the user selects \'Show correct answer\' checkbox without attempting the question, no correct/incorrect icons or label should be displayed, correct answer container along with \'Correct answers\' label and correct responses with numeric count should be displayed below the question field', () => {
2439
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2440
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
2441
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 1', 'Correct answer for stem 2'], ['1', '2']);
2442
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2443
- });
2444
-
2445
- it('When user clicks on Check answer button without attempting the question, then then red cross-mark icon or green check-mark should not be displayed anywhere, correct/incorrect answer label and its border should not be displayed and the correct answer container should not be displayed', () => {
2446
- listMatchingPage.steps.checkAnswer();
2447
- listMatchingPage.steps.verifyCorrectIncorrectIconLabelAndBorderNotExist();
2448
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2449
- });
2450
-
2451
- it('Case: When user adds incorrect response', () => {
2452
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 1', 0);
2453
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 1);
2454
-
2455
- cy.log('When the user selects \'Show correct answer\' checkbox, red cross-mark icon should be displayed besides the incorrect answers input fields, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed below the question field and the correct answer container with both correct answers should be displayed')
2456
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2457
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2458
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
2459
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
2460
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
2461
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 1', 'Correct answer for stem 2'], ['1', '2']);
2462
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2463
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2464
-
2465
- cy.log('When the user clicks on \'Check answer\' button, red cross-mark icon should be displayed besides the incorrect response field, incorrect answer border should appear and a label \'Incorrect Answer\' should be displayed below the question field and correct answer container should be displayed with the correct responses from the correct tab for the user responses marked incorrect')
2466
- listMatchingPage.steps.checkAnswer();
2467
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
2468
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
2469
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
2470
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
2471
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2472
- });
2473
-
2474
- it('Case: When user adds Partially correct without any incorrect options', () => {
2475
- cy.log('Filling only one response field with correct option and removing the other incorrect option from the response field to keep it blank');
2476
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
2477
- listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(1);
2478
-
2479
- cy.log('When user selects the show correct answer checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should not be displayed besides the blank response field, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed and correct answer container should be displayed with the correct responses from the correct tab for the blank response field');
2480
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2481
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2482
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
2483
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
2484
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
2485
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 2'], ['2']);
2486
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2487
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2488
-
2489
- cy.log('When the user clicks on the \'Check answer\' button, then red cross-mark icon should not be displayed besides incorrect answer input field, green check-mark icon should be displayed beside correct answer response field, label \'Incorrect Answer\' should be displayed below the question field and incorrect answer border should appear and correct answer container should not be displayed');
2490
- listMatchingPage.steps.checkAnswer();
2491
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
2492
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
2493
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2494
- listMatchingPage.steps.verifyCorrectIncorrectIconNotVisible(1);
2495
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2496
- });
2497
-
2498
- it('Case: When user adds partially correct response along with incorrect options', () => {
2499
- cy.log('Filling response field with incorrect option');
2500
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Incorrect answer 2', 1);
2501
-
2502
- cy.log('When user selects the 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, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed and correct answer container should be displayed with the correct responses from the correct tab for the user responses marked incorrect');
2503
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2504
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2505
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
2506
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
2507
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
2508
- listMatchingPage.steps.verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount(['Correct answer for stem 2'], ['2']);
2509
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2510
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2511
-
2512
- cy.log('When the user clicks on the \'Check answer\' button, then red cross-mark icon should be displayed besides incorrect answer input field, green check-mark icon should be displayed beside correct answer response field, label \'Incorrect Answer\' should be displayed below the question field and incorrect answer border should appear and correct answer container should not be displayed');
2513
- listMatchingPage.steps.checkAnswer();
2514
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
2515
- listMatchingPage.steps.verifyIncorrectAttemptBorder();
2516
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2517
- listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
2518
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2519
- });
2520
-
2521
- it('Case: When user adds correct response', () => {
2522
- cy.log('Adding correct response')
2523
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 2', 1);
2524
-
2525
- cy.log('When the user selects the show correct answer checkbox, green check-mark icon should be displayed besides both the response fields, label \'Correct Answer\' should be displayed below the question field and user should be awarded with full points');
2526
- listMatchingPage.steps.checkShowCorrectAnswerCheckbox();
2527
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
2528
- listMatchingPage.steps.verifyCorrectAttemptBorder();
2529
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2530
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2531
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2532
- listMatchingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
2533
-
2534
- cy.log('When the user clicks on the \'Check answer\' button, green check-mark icon should be displayed besides the response fields and a label \'Correct Answer\' should be displayed below the question field, correct answer border should appear and correct answer container should not be displayed')
2535
- listMatchingPage.steps.checkAnswer();
2536
- listMatchingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
2537
- listMatchingPage.steps.verifyCorrectAttemptBorder();
2538
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(0);
2539
- listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(1);
2540
- listMatchingPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
2541
- });
2542
- },
2543
- }
2544
-
2545
- export const listMatchingScoring = {
2546
- tests
2547
- }