itemengine-cypress-automation 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. package/.build_wna +4 -0
  2. package/README.md +3 -0
  3. package/currents.config.js +6 -0
  4. package/cypress/API/createItem/toggleItemMode.js +15 -0
  5. package/cypress/config-files/ildev.json +15 -0
  6. package/cypress/config-files/ilprod.json +15 -0
  7. package/cypress/config-files/ilqa.json +15 -0
  8. package/cypress/config-files/ilstage.json +15 -0
  9. package/cypress/e2e/ILC/sorry-cypress-test/spec1.js +18 -0
  10. package/cypress/e2e/ILC/sorry-cypress-test/spec2.js +18 -0
  11. package/cypress/e2e/ILC/sorry-cypress-test/spec3.js +18 -0
  12. package/cypress/fixtures/accessibilityConfig.json +6 -0
  13. package/cypress/fixtures/constants.js +18 -0
  14. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +2271 -0
  15. package/cypress/fixtures/specialAndMathCharacters.js +118 -0
  16. package/cypress/fixtures/theme/ilc.json +150 -0
  17. package/cypress/fixtures/theme/ngie.json +26 -0
  18. package/cypress/fixtures/uploads/20mbFile.png +0 -0
  19. package/cypress/fixtures/uploads/80mbFile.pdf +0 -0
  20. package/cypress/fixtures/uploads/highlightImage.jpg +0 -0
  21. package/cypress/fixtures/uploads/image.png +0 -0
  22. package/cypress/fixtures/uploads/sample.aac +0 -0
  23. package/cypress/fixtures/uploads/sample.accdb +0 -0
  24. package/cypress/fixtures/uploads/sample.csv +100 -0
  25. package/cypress/fixtures/uploads/sample.doc +0 -0
  26. package/cypress/fixtures/uploads/sample.gif +0 -0
  27. package/cypress/fixtures/uploads/sample.heic +0 -0
  28. package/cypress/fixtures/uploads/sample.heif +0 -0
  29. package/cypress/fixtures/uploads/sample.hevc +0 -0
  30. package/cypress/fixtures/uploads/sample.jpeg +0 -0
  31. package/cypress/fixtures/uploads/sample.jpg +0 -0
  32. package/cypress/fixtures/uploads/sample.mp3 +0 -0
  33. package/cypress/fixtures/uploads/sample.mp4 +0 -0
  34. package/cypress/fixtures/uploads/sample.pdf +0 -0
  35. package/cypress/fixtures/uploads/sample.ppt +0 -0
  36. package/cypress/fixtures/uploads/sample.pub +0 -0
  37. package/cypress/fixtures/uploads/sample.rtf +7902 -0
  38. package/cypress/fixtures/uploads/sample.svg +10 -0
  39. package/cypress/fixtures/uploads/sample.txt +1 -0
  40. package/cypress/fixtures/uploads/sample.wav +0 -0
  41. package/cypress/fixtures/uploads/sample.xlsx +0 -0
  42. package/cypress/fixtures/uploads/sample.xps +0 -0
  43. package/cypress/fixtures/uploads/sample.zip +0 -0
  44. package/cypress/fixtures/uploads/sample1.jpg +0 -0
  45. package/cypress/fixtures/uploads/sample1.mp3 +0 -0
  46. package/cypress/fixtures/uploads/sample1.zip +0 -0
  47. package/cypress/fixtures/uploads/sample10Sec.mp3 +0 -0
  48. package/cypress/fixtures/uploads/sample2.jpg +0 -0
  49. package/cypress/fixtures/uploads/sample2.mp3 +0 -0
  50. package/cypress/fixtures/uploads/sampleVirus.zip +0 -0
  51. package/cypress/pages/audioPlayerPage.js +628 -0
  52. package/cypress/pages/audioResponsePage.js +264 -0
  53. package/cypress/pages/components/additionalSettingsPanel.js +174 -0
  54. package/cypress/pages/components/answerNumerationComponent.js +109 -0
  55. package/cypress/pages/components/autoScoredAdditionalSettings.js +183 -0
  56. package/cypress/pages/components/autoScoredPreviewBase.js +94 -0
  57. package/cypress/pages/components/autoScoredScoringSection.js +195 -0
  58. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +268 -0
  59. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +291 -0
  60. package/cypress/pages/components/ckEditorToolbar.js +64 -0
  61. package/cypress/pages/components/colorPopupComponent.js +293 -0
  62. package/cypress/pages/components/commonComponents.js +93 -0
  63. package/cypress/pages/components/componentsFlowChart/figFlowChart.png +0 -0
  64. package/cypress/pages/components/createCustomCategoryFlyout.js +138 -0
  65. package/cypress/pages/components/createQuestionBasePage.js +225 -0
  66. package/cypress/pages/components/customizeHighlightPropertiesComponent.js +318 -0
  67. package/cypress/pages/components/dragAndDropResponseOptions.js +738 -0
  68. package/cypress/pages/components/dragAndDropSetCorrectAnswerCheckboxComponents.js +124 -0
  69. package/cypress/pages/components/draggableOptionsContainer.js +857 -0
  70. package/cypress/pages/components/editCategoryFlyout.js +40 -0
  71. package/cypress/pages/components/equationEditorFlyout.js +158 -0
  72. package/cypress/pages/components/essayResponseCommonComponents.js +86 -0
  73. package/cypress/pages/components/figOverImageCommonComponent.js +924 -0
  74. package/cypress/pages/components/fillInTheGapsCommonComponents.js +687 -0
  75. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +442 -0
  76. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +884 -0
  77. package/cypress/pages/components/gridCommonComponents.js +951 -0
  78. package/cypress/pages/components/index.js +38 -0
  79. package/cypress/pages/components/listSortingAndOrderingBase.js +401 -0
  80. package/cypress/pages/components/maximumRecorderLengthComponent.js +116 -0
  81. package/cypress/pages/components/mcqAdditionalSettingsBase.js +390 -0
  82. package/cypress/pages/components/mcqOptionsComponent.js +263 -0
  83. package/cypress/pages/components/mcqPreviewComponents.js +78 -0
  84. package/cypress/pages/components/mcqQuestionCommonComponents.js +265 -0
  85. package/cypress/pages/components/mcqScoringComponent.js +120 -0
  86. package/cypress/pages/components/mcqSetCorrectAnswerSection.js +143 -0
  87. package/cypress/pages/components/optionsWrapperComponent.js +221 -0
  88. package/cypress/pages/components/playbackControlsBaseComponent.js +163 -0
  89. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +90 -0
  90. package/cypress/pages/components/questionInstructionsComponent.js +112 -0
  91. package/cypress/pages/components/scoringSectionBase.js +308 -0
  92. package/cypress/pages/components/setPointsPopupBase.js +79 -0
  93. package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +79 -0
  94. package/cypress/pages/components/specialCharactersFlyoutComponent.js +58 -0
  95. package/cypress/pages/components/studentResponseAreaAndLayoutComponent.js +28 -0
  96. package/cypress/pages/components/uploadImageSectionComponent.js +594 -0
  97. package/cypress/pages/createItemPage.js +28 -0
  98. package/cypress/pages/dialogBoxBase.js +111 -0
  99. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +1161 -0
  100. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +1559 -0
  101. package/cypress/pages/dragAndDropIntoCategoriesPage.js +1556 -0
  102. package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +1396 -0
  103. package/cypress/pages/essayResponseBasicPage.js +57 -0
  104. package/cypress/pages/essayResponseMathPage.js +47 -0
  105. package/cypress/pages/essayResponsePage.js +385 -0
  106. package/cypress/pages/feedbackScalePage.js +698 -0
  107. package/cypress/pages/fillInTheGapsDragAndDropPage.js +742 -0
  108. package/cypress/pages/fillInTheGapsDropdownPage.js +99 -0
  109. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +232 -0
  110. package/cypress/pages/fillInTheGapsOverImageTextPage.js +135 -0
  111. package/cypress/pages/fillInTheGapsScoring.js +5974 -0
  112. package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +260 -0
  113. package/cypress/pages/fillInTheGapsTextPage.js +225 -0
  114. package/cypress/pages/highlightImagePage.js +1316 -0
  115. package/cypress/pages/highlightPage.js +870 -0
  116. package/cypress/pages/index.js +30 -0
  117. package/cypress/pages/listMatchingPage.js +1330 -0
  118. package/cypress/pages/listMatchingScoring.js +2635 -0
  119. package/cypress/pages/listOrderingPage.js +751 -0
  120. package/cypress/pages/listSortingPage.js +1201 -0
  121. package/cypress/pages/multipleSelectionGridPage.js +359 -0
  122. package/cypress/pages/multipleSelectionPage.js +88 -0
  123. package/cypress/pages/passagePage.js +426 -0
  124. package/cypress/pages/readingRulerPage.js +302 -0
  125. package/cypress/pages/selectQuestionResourceToolPage.js +64 -0
  126. package/cypress/pages/shortTextResponsePage.js +197 -0
  127. package/cypress/pages/singleSelectionGridPage.js +370 -0
  128. package/cypress/pages/singleSelectionPage.js +65 -0
  129. package/cypress/pages/uploadResponsePage.js +110 -0
  130. package/cypress/pages/videoResponsePage.js +375 -0
  131. package/cypress/support/commands.js +140 -0
  132. package/cypress/support/e2e.js +14 -0
  133. package/cypress/support/helpers/abortEarly.js +19 -0
  134. package/cypress/support/helpers/accessibility.js +34 -0
  135. package/cypress/support/helpers/cypressUtilities.js +64 -0
  136. package/cypress/support/helpers/localStorage.js +13 -0
  137. package/cypress/support/helpers/selectText.js +77 -0
  138. package/cypress/support/helpers/utilities.js +126 -0
  139. package/cypress.config.js +76 -0
  140. package/il.yaml +14 -0
  141. package/language +1 -0
  142. package/package.json +26 -0
@@ -0,0 +1,1330 @@
1
+ import { additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, autoScoredScoringSection, autoScoredScoringSectionMultipleResponsesType, autoScoredSetCorrectAnswerSection, commonComponents, createQuestionBasePage, dragAndDropResponseOptions, dragAndDropSetCorrectAnswerCheckboxComponents, draggableOptionsContainer, mcqOptionsComponent, optionsWrapperComponent, previewScoringAndShowCorrectAnswerComponent, questionInstructionsComponent, scoringSectionBase } from "./components"
2
+ import { dialogBoxBase } from "./dialogBoxBase";
3
+ const css = Cypress.env('css');
4
+
5
+ let optionsForThreeResponses = ['Correct answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3'];
6
+
7
+ const selectors = {
8
+ ...questionInstructionsComponent,
9
+ ...commonComponents,
10
+ ...scoringSectionBase,
11
+ ...autoScoredSetCorrectAnswerSection,
12
+ ...mcqOptionsComponent,
13
+ ...scoringSectionBase,
14
+ ...previewScoringAndShowCorrectAnswerComponent,
15
+ ...autoScoredScoringSection,
16
+ ...dragAndDropResponseOptions,
17
+ ...autoScoredAdditionalSettings,
18
+ ...autoScoredPreviewBase,
19
+ ...autoScoredScoringSectionMultipleResponsesType,
20
+ ...optionsWrapperComponent,
21
+ ...dragAndDropSetCorrectAnswerCheckboxComponents,
22
+ ...draggableOptionsContainer,
23
+
24
+ //Options section
25
+ addOptionButton: () => cy.get('.add-option-wrapper-cls .ngie-button').eq(1),
26
+ groupedOptionsAddOptionButton: () => cy.get('.add-option-wrapper-cls .ngie-button'),
27
+ optionsForDragAndDropInputField: () => cy.get('[title="Enter option"]'),
28
+ responseOptionsSectionWrapper: () => cy.get('.cloze-drag-and-drop-response-option-wrapper').eq(1),
29
+ optionWrapper: () => cy.get('[data-rbd-draggable-id*="option-draggable-choice"]'),
30
+ //Stems section
31
+ stemsLabel: () => cy.get('.match-list-stem-label'),
32
+ stemWrapper: () => cy.get('[data-rbd-draggable-id*="option-draggable-stemOption"]'),
33
+ buttonDeleteStem: () => cy.get('[aria-label*="Delete stem"]'),
34
+ optionNumeration: () => cy.get('div[class*="AdornmentDiv"]'),
35
+ stemInputField: () => cy.get('[title="Enter stem"]'),
36
+ addStemButton: () => cy.get('.add-option-wrapper-cls .ngie-button').eq(0),
37
+ //Set correct answer section
38
+ setCorrectAnswerStemRow: () => cy.get('.grid-container'),
39
+ setCorrectAnswerStemField: () => listMatchingPage.setCorrectAnswerStemLabel().parent(),
40
+ setCorrectAnswerStemLabel: () => cy.get('.input-field-label .question-text-wrapper'),
41
+ setCorrectAnswerStemResponseArea: () => cy.get('[class="droppable-area"] [role="button"]'),
42
+ setCorrectAnswerStemResponseAreaWrapper: () => cy.get('[class*="DroppableHotspotstyle__DroppableHotspotWrapper"]'),
43
+ //preview tab
44
+ previewTabStemRow: () => cy.get('.match-list-response-container'),
45
+ previewTabStemLabel: () => cy.get('.no-split-pane-wrapper .input-field-label .question-text-wrapper'),
46
+ previewTabStemField: () => listMatchingPage.previewTabStemLabel().parent(),
47
+ //Below same as FIG DnD
48
+ previewTabStemResponseArea: () => cy.get('.no-split-pane-wrapper [class="droppable-area"] [role="button"]'),
49
+ previewTabStemResponseAreaWrapper: () => cy.get('.no-split-pane-wrapper [class*="DroppableHotspotstyle__DroppableHotspotWrapper"]'),
50
+ previewTabQuestionField: () => cy.get('.no-split-pane-wrapper div[class*="ClozeWithDragAndDropstyles__QuestionItemContainer"]'),
51
+ previewDraggableOptionContainer: () => cy.get('.no-split-pane-wrapper .draggable-wrapper'),
52
+ previewTabCorrectAnswerContainer: () => cy.get('[class*="ClozeWithDragAndDropstyles__CorrectAnswerTextWrapper"]'),
53
+ previewTabCorrectAnswerLabel: () => listMatchingPage.previewTabCorrectAnswerContainer().find('[class*="ClozeWithDragAndDropstyles__CorrectAnswerLabel"]'),
54
+ previewTabCorrectAnswerResponseNumerationWrapper: () => cy.get('[class*="ClozeWithDragAndDropstyles__NumerationWrapper"]'),
55
+ previewTabCorrectAnswerResponseWrapper: () => listMatchingPage.previewTabCorrectAnswerResponseNumerationWrapper().parents('[class*="ClozeWithDragAndDropstyles__ItemWrapper"]'),
56
+ previewTabCorrectAnswerResponseText: () => cy.get('[class*="ClozeWithDragAndDropstyles__ItemWrapper"] .question-text-wrapper'),
57
+ draggableOption: () => cy.get('.draggable-selected-item'),
58
+ }
59
+
60
+ const steps = {
61
+ ...createQuestionBasePage.steps,
62
+ ...questionInstructionsComponent.steps,
63
+ ...scoringSectionBase.steps,
64
+ ...commonComponents.steps,
65
+ ...autoScoredSetCorrectAnswerSection.steps,
66
+ ...createQuestionBasePage.steps,
67
+ ...commonComponents.steps,
68
+ ...scoringSectionBase.steps,
69
+ ...autoScoredScoringSection.steps,
70
+ ...dragAndDropResponseOptions.steps,
71
+ ...autoScoredPreviewBase.steps,
72
+ ...additionalSettingsPanel.steps,
73
+ ...previewScoringAndShowCorrectAnswerComponent.steps,
74
+ ...autoScoredAdditionalSettings.steps,
75
+ ...autoScoredScoringSectionMultipleResponsesType.steps,
76
+ ...dragAndDropSetCorrectAnswerCheckboxComponents.steps,
77
+ ...draggableOptionsContainer.steps,
78
+ ...dialogBoxBase.steps,
79
+ ...optionsWrapperComponent.steps,
80
+
81
+ /**
82
+ * @param {number} index of the stem
83
+ * @description verify the enter stem input field, drag handle, delete button and stem numeration
84
+ */
85
+ verifyStemContents: (index) => {
86
+ listMatchingPage.stemWrapper()
87
+ .eq(index)
88
+ .within(() => {
89
+ optionsWrapperComponent.optionsInputField()
90
+ .should('have.attr', 'data-cke-editorplaceholder', 'Enter stem');
91
+ commonComponents.dragHandleButton()
92
+ .should('exist');
93
+ listMatchingPage.buttonDeleteStem()
94
+ .should('be.visible');
95
+ listMatchingPage.optionNumeration()
96
+ .should('have.text', index + 1);
97
+ })
98
+ },
99
+
100
+ verifyDragHandleTooltipForStem: () => {
101
+ listMatchingPage.stemWrapper()
102
+ .eq(0)
103
+ .within(() => {
104
+ commonComponents.dragHandleButton()
105
+ .trigger('mouseover');
106
+ });
107
+ commonComponents.tooltipText()
108
+ .should('have.text', 'Drag to reorder');
109
+ listMatchingPage.stemWrapper()
110
+ .eq(0)
111
+ .within(() => {
112
+ commonComponents.dragHandleButton()
113
+ .trigger('mouseout');
114
+ });
115
+ commonComponents.tooltipText()
116
+ .should('not.exist');
117
+ },
118
+
119
+ verifyDeleteButtonTooltipForStem: () => {
120
+ listMatchingPage.buttonDeleteStem()
121
+ .eq(0)
122
+ .trigger('mouseover');
123
+ commonComponents.tooltipText()
124
+ .should('have.text', 'Delete stem');
125
+ listMatchingPage.buttonDeleteStem()
126
+ .eq(0)
127
+ .trigger('mouseout');
128
+ commonComponents.tooltipText()
129
+ .should('not.exist');
130
+ },
131
+
132
+ deleteStem: (index) => {
133
+ listMatchingPage.buttonDeleteStem()
134
+ .eq(index)
135
+ .click();
136
+ },
137
+
138
+ /**
139
+ * @param {number} index of the delete button
140
+ * @description verify the disabled delete button
141
+ */
142
+ verifyDisabledDeleteStemButton: (index) => {
143
+ listMatchingPage.stemWrapper()
144
+ .eq(index)
145
+ .within(() => {
146
+ commonComponents.steps.verifyDeleteButtonDisabled()
147
+ });
148
+ },
149
+
150
+ verifyDisabledDeleteStemButtonTooltip: () => {
151
+ listMatchingPage.buttonDeleteStem()
152
+ .trigger('mouseover', { force: true });
153
+ commonComponents.tooltipText()
154
+ .should('have.text', 'Minimum one stem is required');
155
+ listMatchingPage.buttonDeleteStem()
156
+ .trigger('mouseout', { force: true });
157
+ commonComponents.tooltipText()
158
+ .should('not.exist');
159
+ },
160
+
161
+ addOption: () => {
162
+ listMatchingPage.addOptionButton()
163
+ .click();
164
+ },
165
+
166
+ addOptionInGroupedResponseLayout: (groupIndex) => {
167
+ listMatchingPage.groupResponseContainer()
168
+ .eq(groupIndex)
169
+ .within(() => {
170
+ listMatchingPage.groupedOptionsAddOptionButton()
171
+ .click();
172
+ });
173
+ },
174
+
175
+ addStem: () => {
176
+ listMatchingPage.addStemButton()
177
+ .click();
178
+ },
179
+
180
+ /**
181
+ * @param {number} index of the stem input field
182
+ * @description focus in and focus out of the stem input field
183
+ */
184
+ focusInAndFocusOutOfStemInputField: (index) => {
185
+ listMatchingPage.stemWrapper()
186
+ .eq(index)
187
+ .within(() => {
188
+ listMatchingPage.stemInputField()
189
+ .click()
190
+ .blur();
191
+ });
192
+ },
193
+
194
+ /**
195
+ * @param {number} index of the option input field
196
+ * @description focus in and focus out of the option input field
197
+ */
198
+ focusInAndFocusOutOfOptionInputField: (index) => {
199
+ listMatchingPage.optionWrapper()
200
+ .eq(index)
201
+ .within(() => {
202
+ listMatchingPage.optionsForDragAndDropInputField()
203
+ .click()
204
+ .blur();
205
+ });
206
+ },
207
+
208
+ /**
209
+ * @param {number} index of the stem input field
210
+ * @description verify the empty stem input field error message
211
+ */
212
+ verifyStemErrorMessageIsDisplayed: (index) => {
213
+ listMatchingPage.stemWrapper()
214
+ .eq(index)
215
+ .within(() => {
216
+ commonComponents.errorMessage()
217
+ .should('have.text', 'Error: Stem is required.');
218
+ });
219
+ },
220
+
221
+ /**
222
+ * @param {number} stemInputFieldIndex Index of stem input field
223
+ * @param {string} responseFieldText Text to be given as input in stem input field
224
+ * @description Add input to the stem input field
225
+ */
226
+ addInputToStemField: (stemInputFieldIndex, responseFieldText) => {
227
+ listMatchingPage.stemInputField()
228
+ .eq(stemInputFieldIndex)
229
+ .clear()
230
+ .type(responseFieldText)
231
+ .should('have.text', responseFieldText);
232
+ },
233
+
234
+ /**
235
+ * @param {string[]} stemTextArray Array of text to be given as input for all stem input fields
236
+ * @description Add input to all the stem input fields
237
+ */
238
+ addInputToAllStemFields: (stemTextArray) => {
239
+ stemTextArray.forEach((stemText, count) => {
240
+ steps.addInputToStemField(count, stemText);
241
+ });
242
+ },
243
+
244
+ /**
245
+ * @param {number} index Index of stem input field
246
+ * @description Verify that stem input field error message is not displayed
247
+ */
248
+ verifyStemErrorMessageIsNotDisplayed: (index) => {
249
+ listMatchingPage.stemWrapper()
250
+ .eq(index)
251
+ .within(() => {
252
+ commonComponents.errorMessage()
253
+ .should('not.exist');
254
+ });
255
+ },
256
+
257
+ /**
258
+ * @param {string[]} stemTextArray Array of text in set correct answer stem fields
259
+ * @description Verify the text displayed in set correct answer stem fields
260
+ */
261
+ verifyAllStemTextInSetCorrectAnswerSection: (stemTextArray) => {
262
+ stemTextArray.forEach((stemText, stemIndex) => {
263
+ listMatchingPage.setCorrectAnswerStemLabel()
264
+ .eq(stemIndex)
265
+ .verifyInnerText(stemText);
266
+ });
267
+ },
268
+
269
+ /**
270
+ * @param {string[]} stemTextArray Array of text in preview tab stem fields
271
+ * @description Verify the text displayed in preview tab stem fields
272
+ */
273
+ verifyAllStemTextInPreviewTab: (stemTextArray) => {
274
+ stemTextArray.forEach((stemText, stemIndex) => {
275
+ listMatchingPage.previewTabStemLabel()
276
+ .eq(stemIndex)
277
+ .verifyInnerText(stemText);
278
+ });
279
+ },
280
+
281
+ /**
282
+ * @param {string} textInput Text to be given as input for option input field
283
+ * @param {number} optionIndex Index of the option input field
284
+ * @description Add text input to all options input field
285
+ */
286
+ addInputToOptionForDragAndDropInputField: (textInput, optionIndex) => {
287
+ listMatchingPage.optionsForDragAndDropInputField()
288
+ .eq(optionIndex)
289
+ .type(textInput, { delay: 0 })
290
+ .blur()
291
+ .focus()
292
+ .should('have.text', textInput);
293
+ },
294
+
295
+ /**
296
+ * @param {string[]} responseTextArray Array of text to be given as input for options input fields
297
+ * @description Add text input to all options input field
298
+ */
299
+ addInputToOptionsForDragAndDropFields: (responseTextArray) => {
300
+ responseTextArray.forEach((responseFieldText, optionIndex) => {
301
+ steps.addInputToOptionForDragAndDropInputField(responseFieldText, optionIndex);
302
+ });
303
+ },
304
+
305
+ /**
306
+ * @param {string[]} optionName Array of option names
307
+ * @param {number[]} responseAreaIndex Array of index of response area
308
+ * @description Click and drop draggable option in response area in set correct answer section
309
+ */
310
+ clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection: (optionName, responseAreaIndex) => {
311
+ listMatchingPage.draggableOption()
312
+ .contains(optionName)
313
+ .click();
314
+ listMatchingPage.setCorrectAnswerStemResponseArea()
315
+ .eq(responseAreaIndex)
316
+ .click();
317
+ },
318
+
319
+ /**
320
+ * @param {number[]} responseAreaIndex Array of index of response area
321
+ * @description Click the draggable option in the response area and drop it in draggable option container in set correct answer section
322
+ */
323
+ clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInSetCorrectAnswerSection: (responseAreaIndex) => {
324
+ listMatchingPage.setCorrectAnswerStemResponseArea()
325
+ .eq(responseAreaIndex)
326
+ .click();
327
+ listMatchingPage.setCorrectAnswerDraggableOptionsWrapper('List matching')
328
+ .click('right');
329
+ },
330
+
331
+ /**
332
+ * @param {string[]} optionName Array of option names
333
+ * @param {number[]} responseAreaIndex Array of index of response area
334
+ * @description Click and drop draggable option in response area in preview tab
335
+ */
336
+ clickAndDropOptionInStemResponseAreaInPreviewTab: (optionName, responseAreaIndex) => {
337
+ listMatchingPage.previewTabDraggableOptionsWrapper()
338
+ .within(() => {
339
+ listMatchingPage.draggableOption()
340
+ .contains(optionName)
341
+ .click();
342
+ });
343
+ listMatchingPage.previewTabStemResponseArea()
344
+ .eq(responseAreaIndex)
345
+ .click();
346
+ },
347
+
348
+ /**
349
+ * @param {number[]} responseAreaIndex Array of index of response area
350
+ * @description Click the draggable option in the response area and drop it in draggable option container in preview tab
351
+ */
352
+ clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab: (responseAreaIndex) => {
353
+ listMatchingPage.previewTabStemResponseArea()
354
+ .eq(responseAreaIndex)
355
+ .click();
356
+ listMatchingPage.previewDraggableOptionContainer()
357
+ .click('right');
358
+ },
359
+
360
+ verifyStemFieldsInSetCorrectAnswerSection: (stemsArray) => {
361
+ stemsArray.forEach((stemText, stemIndex) => {
362
+ listMatchingPage.setCorrectAnswerStemField()
363
+ .eq(stemIndex)
364
+ .should('have.text', stemText);
365
+ });
366
+ },
367
+
368
+ verifyStemFieldsInPreviewTab: (stemsArray) => {
369
+ stemsArray.forEach((stemText, stemIndex) => {
370
+ listMatchingPage.previewTabStemLabel()
371
+ .eq(stemIndex)
372
+ .should('have.text', stemText);
373
+ });
374
+ },
375
+
376
+ /**
377
+ * @param {string[]} draggableOptionsArray Array of draggable options text
378
+ * @description Verify the draggable options displayed in set correct answer section
379
+ */
380
+ verifyOptionsInSetCorrectAnswerSection: (draggableOptionsArray) => {
381
+ draggableOptionsArray.forEach((draggableOption, optionIndex) => {
382
+ listMatchingPage.draggableOption()
383
+ .eq(optionIndex)
384
+ .should('have.text', draggableOption);
385
+ });
386
+ listMatchingPage.draggableOption()
387
+ .should('have.length', draggableOptionsArray.length);
388
+ },
389
+
390
+ /**
391
+ * @param {string[]} draggableOptionsArray Array of draggable options text
392
+ * @description Verify the draggable options displayed in preview tab
393
+ */
394
+ verifyOptionsInPreviewTab: (draggableOptionsArray) => {
395
+ listMatchingPage.previewTabDraggableOptionsWrapper()
396
+ .within(() => {
397
+ draggableOptionsArray.forEach((draggableOption, optionIndex) => {
398
+ listMatchingPage.draggableOption()
399
+ .eq(optionIndex)
400
+ .should('have.text', draggableOption);
401
+ });
402
+ listMatchingPage.draggableOption()
403
+ .should('have.length', draggableOptionsArray.length);
404
+ });
405
+ },
406
+
407
+ /**
408
+ * @param {string} optionText Text of option given as input in response area
409
+ * @param {number} responseAreaIndex Index of response area
410
+ * @description Verify the filled response areas in set correct answer section
411
+ */
412
+ verifyFilledResponseAreaInSetCorrectAnswerSection: (responseAreaIndex, optionText) => {
413
+ listMatchingPage.setCorrectAnswerStemResponseAreaWrapper()
414
+ .eq(responseAreaIndex)
415
+ .should('have.class', 'isNotEmpty');
416
+ listMatchingPage.setCorrectAnswerStemResponseArea()
417
+ .eq(responseAreaIndex)
418
+ .should('have.text', optionText)
419
+ .and('be.visible');
420
+ },
421
+
422
+ /**
423
+ * @param {number[]} responseAreaIndex Index of response area
424
+ * @description Verify response area in set correct answer is empty
425
+ */
426
+ verifyEmptyResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
427
+ listMatchingPage.setCorrectAnswerStemResponseAreaWrapper()
428
+ .eq(responseAreaIndex)
429
+ .should('have.class', 'isEmpty');
430
+ },
431
+
432
+ /**
433
+ * @param {string} responseAreaText Text of the response area
434
+ * @param {number} responseAreaIndex Index of response area
435
+ * @description Verify the text displayed in response area in preview tab
436
+ */
437
+ verifyResponseAreaTextInPreviewTab: (responseAreaIndex, responseAreaText) => {
438
+ listMatchingPage.previewTabStemResponseArea()
439
+ .eq(responseAreaIndex)
440
+ .and('have.text', responseAreaText)
441
+ .and('be.visible');
442
+ },
443
+
444
+ /**
445
+ * @param {string} optionText Text of option given as input in response area
446
+ * @param {number} responseAreaIndex Index of response area
447
+ * @description Verify the filled response area in preview tab
448
+ */
449
+ verifyFilledOptionResponseAreaInPreviewTab: (responseAreaIndex, optionText) => {
450
+ listMatchingPage.previewTabStemResponseAreaWrapper()
451
+ .eq(responseAreaIndex)
452
+ .should('have.class', 'isNotEmpty');
453
+ steps.verifyResponseAreaTextInPreviewTab(responseAreaIndex, optionText);
454
+ },
455
+
456
+ /**
457
+ * @param {number} index Index of stem input field
458
+ * @description Clear input given to stem input field
459
+ */
460
+ clearStemInputField: (index) => {
461
+ listMatchingPage.stemInputField()
462
+ .eq(index)
463
+ .clear();
464
+ },
465
+
466
+ /**
467
+ * @param {string[]} stemArray Array of stems displayed in preview tab
468
+ * @description Verify that stems displayed in preview tab are randomized
469
+ */
470
+ verifyRandomizedStemsOrder: (stemArray) => {
471
+ let currentStems = [...stemArray]
472
+ for (let index = 0; index < currentStems.length; index++) {
473
+ listMatchingPage.previewTabStemLabel()
474
+ .eq(index)
475
+ .then(($element) => {
476
+ expect($element.text()).to.be.oneOf(currentStems);
477
+ currentStems = currentStems.filter((value) => value !== $element.text())
478
+ });
479
+ };
480
+ listMatchingPage.steps.verifyRerandomizedStemsOrder(stemArray);
481
+ },
482
+
483
+ /**
484
+ * @param {string[]} PreviousOrderOfStems Array of randomized stems displayed in preview tab
485
+ * @description Verify that stems displayed in preview tab are randomized
486
+ */
487
+ verifyRerandomizedStemsOrder: (PreviousOrderOfStems) => {
488
+ listMatchingPage.previewTabStemLabel()
489
+ .should('not.have.text', '')
490
+ .and('not.have.text', PreviousOrderOfStems.join(''));
491
+ },
492
+
493
+ getStemsArray: () => {
494
+ const stemsArray = []
495
+ listMatchingPage.previewTabStemLabel()
496
+ .each(($el) => {
497
+ cy.wrap($el)
498
+ .invoke('text')
499
+ .then((text) => {
500
+ stemsArray.push(text);
501
+ });
502
+ });
503
+ return stemsArray;
504
+ },
505
+
506
+ /**
507
+ * @param {string[]} correctAnswerArray Array of text of options displayed in correct answer container
508
+ * @param {number[]} optionNumerationArray Array of numeration of options displayed in correct answer container
509
+ * @description Verify the options and their numeration displayed in correct answer container
510
+ */
511
+ verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount: (correctAnswerArray, optionNumerationArray) => {
512
+ listMatchingPage.previewTabCorrectAnswerContainer()
513
+ .should('be.visible');
514
+ listMatchingPage.previewTabCorrectAnswerLabel()
515
+ .verifyInnerText('Correct answers:');
516
+ correctAnswerArray.forEach((responseFieldText, count) => {
517
+ listMatchingPage.previewTabCorrectAnswerResponseNumerationWrapper()
518
+ .eq(count)
519
+ .should('have.text', optionNumerationArray[count]);
520
+ listMatchingPage.previewTabCorrectAnswerResponseText()
521
+ .eq(count)
522
+ .verifyInnerText(responseFieldText);
523
+ });
524
+ listMatchingPage.previewTabCorrectAnswerResponseWrapper()
525
+ .should('have.length', correctAnswerArray.length);
526
+ },
527
+
528
+ /**
529
+ * @param {number} index Index of option in preview tab
530
+ * @description Verify cross-mark icon displayed beside option input field
531
+ */
532
+ verifyIncorrectOptionCrossmarkIcon: (index) => {
533
+ listMatchingPage.previewTabStemResponseArea()
534
+ .eq(index)
535
+ .parents('[class="droppable-area"]')
536
+ .next('.tick-icon-wrapper')
537
+ .should('have.class', 'icon-incorrect')
538
+ .and('be.visible');
539
+ },
540
+
541
+ /**
542
+ * @param {number} index Index of option in preview tab
543
+ * @description Verify check-mark icon displayed beside option input field
544
+ */
545
+ verifyCorrectOptionCheckmarkIcon: (index) => {
546
+ listMatchingPage.previewTabStemResponseArea()
547
+ .eq(index)
548
+ .parents('[class="droppable-area"]')
549
+ .next('.tick-icon-wrapper')
550
+ .should('have.class', 'icon-correct')
551
+ .and('be.visible');
552
+ },
553
+
554
+ /**
555
+ * @param {number} index Index of option in preview tab
556
+ * @description Verify check-mark or cross-mark icon is not displayed beside option input field
557
+ */
558
+ verifyCorrectIncorrectIconNotVisible: (index) => {
559
+ listMatchingPage.previewTabStemResponseArea()
560
+ .eq(index)
561
+ .parents('[class="droppable-area"]')
562
+ .next('.tick-icon-wrapper')
563
+ .should('not.exist');
564
+ },
565
+
566
+ /**
567
+ * @param {number} numberOfStemResponsesArea Total number of stem response areas
568
+ * @description Verify check-mark icon is displayed beside all the stem response areas
569
+ */
570
+ verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas: (numberOfStemResponsesArea) => {
571
+ for (let index = 0; index < numberOfStemResponsesArea; index++) {
572
+ listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(index)
573
+ }
574
+ },
575
+
576
+ /**
577
+ * @param {number} numberOfStemResponsesArea Total number of stem response areas
578
+ * @description Verify cross-mark icon is displayed beside all the stem response areas
579
+ */
580
+ verifyIncorrectOptionsCrossMarkIconsForAllStemResponseAreas: (numberOfStemResponsesArea) => {
581
+ for (let index = 0; index < numberOfStemResponsesArea; index++) {
582
+ listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(index)
583
+ }
584
+ },
585
+
586
+ /**
587
+ * @param {number} inputFieldIndex Index of option input field in response options section
588
+ * @description Delete response option input field in response options section
589
+ */
590
+ deleteResponseOptionInputField: (inputFieldIndex) => {
591
+ listMatchingPage.responseOptionsSectionWrapper()
592
+ .within(() => {
593
+ listMatchingPage.deleteOptionButton()
594
+ .eq(inputFieldIndex)
595
+ .click();
596
+ });
597
+ },
598
+
599
+ verifyCorrectIncorrectIconLabelAndBorderNotExist: () => {
600
+ listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
601
+ listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists()
602
+ listMatchingPage.correctIcon()
603
+ .should('not.exist');
604
+ listMatchingPage.incorrectIcon()
605
+ .should('not.exist');
606
+ },
607
+
608
+ verifyPreviewTabCorrectAnswerContainerNotExist: () => {
609
+ listMatchingPage.previewTabCorrectAnswerContainer()
610
+ .should('not.exist');
611
+ },
612
+
613
+ setQuestionStemsAndOptionsForScoringWithAlternateTab: () => {
614
+ listMatchingPage.steps.addStem();
615
+ listMatchingPage.steps.addInputToAllStemFields(['Stem 1', 'Stem 2', 'Stem 3', 'Stem 4']);
616
+ listMatchingPage.steps.addOption();
617
+ listMatchingPage.steps.addOption();
618
+ listMatchingPage.steps.addOption();
619
+ listMatchingPage.steps.addOption();
620
+ listMatchingPage.steps.addOption();
621
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(['Common answer for stem 1', 'Common answer for stem 4', 'Correct answer for stem 2', 'Alternate answer for stem 2', 'Correct answer for stem 3', 'Alternate answer for stem 3', 'Incorrect answer 1', 'Incorrect answer 2']);
622
+ },
623
+
624
+ setQuestionStemsAndOptionsForScoringWithoutAlternateTab: () => {
625
+ listMatchingPage.steps.deleteStem(2);
626
+ listMatchingPage.steps.addInputToAllStemFields(['Stem 1', 'Stem 2']);
627
+ listMatchingPage.steps.addOption();
628
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for stem 1', 'Correct answer for stem 2', 'Incorrect answer 1', 'Incorrect answer 2']);
629
+ },
630
+
631
+ setCorrectAnswersForScoringWithoutAlternateTab: () => {
632
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
633
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 2', 1);
634
+ },
635
+
636
+ setCorrectAnswersForCorrectTab: () => {
637
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Common answer for stem 1', 0);
638
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 2', 1);
639
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 3', 2);
640
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Common answer for stem 4', 3);
641
+ },
642
+
643
+ setCorrectAnswersForAlternateTab: () => {
644
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Common answer for stem 1', 0);
645
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Alternate answer for stem 2', 1);
646
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Alternate answer for stem 3', 2);
647
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Common answer for stem 4', 3);
648
+ },
649
+
650
+ setQuestionStemsAndGroupedOptionsForScoringWithoutAlternateTab: () => {
651
+ listMatchingPage.steps.deleteStem(2);
652
+ listMatchingPage.steps.addInputToAllStemFields(['Stem 1', 'Stem 2']);
653
+ listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
654
+ listMatchingPage.steps.addGroupTitle(0, 'Group 1');
655
+ listMatchingPage.steps.deleteResponseOptionInputField(2);
656
+ listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(0, ['Correct answer for stem 1', 'Incorrect answer 1']);
657
+ listMatchingPage.steps.addGroup();
658
+ listMatchingPage.steps.addGroupTitle(1, 'Group 2');
659
+ listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, ['Correct answer for stem 2', 'Incorrect answer 2']);
660
+ },
661
+
662
+ setQuestionStemsAndGroupedOptionsForScoringWithAlternateTab: () => {
663
+ listMatchingPage.steps.addInputToAllStemFields(['Stem 1', 'Stem 2', 'Stem 3']);
664
+ listMatchingPage.steps.addStem();
665
+ listMatchingPage.steps.addInputToStemField(3, 'Stem 4');
666
+ listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
667
+ listMatchingPage.steps.addGroupTitle(0, 'Group 1');
668
+ listMatchingPage.steps.addOptionInGroupedResponseLayout(0);
669
+ listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(0, ['Common answer for stem 1', 'Correct answer for stem 2', 'Alternate answer for stem 2', 'Incorrect answer 1']);
670
+ listMatchingPage.steps.addGroup();
671
+ listMatchingPage.steps.addGroupTitle(1, 'Group 2');
672
+ listMatchingPage.steps.addOptionInGroupedResponseLayout(1);
673
+ listMatchingPage.steps.addOptionInGroupedResponseLayout(1);
674
+ listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, ['Common answer for stem 4', 'Correct answer for stem 3', 'Alternate answer for stem 3', 'Incorrect answer 2']);
675
+ },
676
+
677
+ verifyInactiveStateOfAllStemResponseAreasInSetCorrectAnswerSection: () => {
678
+ listMatchingPage.setCorrectAnswerStemResponseArea()
679
+ .each($element => {
680
+ cy.wrap($element)
681
+ .should('not.have.class', 'isActiveForDrop');
682
+ });
683
+ },
684
+
685
+ verifyInactiveStateOfAllStemResponseAreasInPreviewTab: () => {
686
+ listMatchingPage.previewTabStemResponseArea()
687
+ .each($element => {
688
+ cy.wrap($element)
689
+ .should('not.have.class', 'isActiveForDrop');
690
+ });
691
+ },
692
+
693
+ /**
694
+ * @param {number} responseAreaIndex Index of the stem response area in set correct answer section
695
+ * @description Verify inactive state of stem response area in set correct answer section
696
+ */
697
+ verifyInactiveStateOfStemResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
698
+ listMatchingPage.setCorrectAnswerStemResponseArea()
699
+ .eq(responseAreaIndex)
700
+ .should('not.have.class', 'isActiveForDrop');
701
+ },
702
+
703
+ /**
704
+ * @param {number} responseAreaIndex Index of the stem response area in preview tab
705
+ * @description Verify inactive state of stem response area in preview tab
706
+ */
707
+ verifyInactiveStateOfStemResponseAreaInPreviewTab: (responseAreaIndex) => {
708
+ listMatchingPage.previewTabStemResponseArea()
709
+ .eq(responseAreaIndex)
710
+ .should('not.have.class', 'isActiveForDrop');
711
+ },
712
+
713
+ verifyActiveStateOfAllStemResponseAreasInSetCorrectAnswerSection: () => {
714
+ listMatchingPage.setCorrectAnswerStemResponseArea()
715
+ .each($element => {
716
+ cy.wrap($element)
717
+ .should('have.class', 'isActiveForDrop');
718
+ });
719
+ },
720
+
721
+ verifyActiveStateOfAllStemResponseAreasInPreviewTab: () => {
722
+ listMatchingPage.previewTabStemResponseArea()
723
+ .each($element => {
724
+ cy.wrap($element)
725
+ .should('have.class', 'isActiveForDrop');
726
+ });
727
+ },
728
+
729
+ /**
730
+ * @param {number} responseAreaIndex Index of the stem response area in set correct answer section
731
+ * @description Verify active state of stem response area in set correct answer section
732
+ */
733
+ verifyActiveStateOfStemResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
734
+ listMatchingPage.setCorrectAnswerStemResponseArea()
735
+ .eq(responseAreaIndex)
736
+ .should('have.class', 'isActiveForDrop');
737
+ },
738
+
739
+ /**
740
+ * @param {number} responseAreaIndex Index of the stem response area in preview tab
741
+ * @description Verify active state of stem response area in preview tab
742
+ */
743
+ verifyActiveStateOfStemResponseAreaInPreviewTab: (responseAreaIndex) => {
744
+ listMatchingPage.previewTabStemResponseArea()
745
+ .eq(responseAreaIndex)
746
+ .should('have.class', 'isActiveForDrop');
747
+ },
748
+
749
+ /**
750
+ * @param {number} responseAreaIndex Index of the stem response area in set correct answer section
751
+ * @description Verify inactive state of filled stem response area in set correct answer section
752
+ */
753
+ verifyInactiveStateOfFilledStemResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
754
+ listMatchingPage.setCorrectAnswerStemResponseArea()
755
+ .eq(responseAreaIndex)
756
+ .should('not.have.class', 'isActiveForDrop');
757
+ },
758
+
759
+ /**
760
+ * @param {number} responseAreaIndex Index of the stem response area in preview tab
761
+ * @description Verify inactive state of filled stem response area in preview tab
762
+ */
763
+ verifyInactiveStateOfFilledStemResponseAreaInPreviewTab: (responseAreaIndex) => {
764
+ listMatchingPage.previewTabStemResponseArea()
765
+ .eq(responseAreaIndex)
766
+ .should('not.have.class', 'isActiveForDrop');
767
+ },
768
+
769
+ /**
770
+ * @param {number} responseAreaIndex Index of the stem response area in set correct answer section
771
+ * @description Verify drag handle is not visible in filled stem response area in set correct answer section
772
+ */
773
+ verifyDragHandleNotVisibleInFilledResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
774
+ listMatchingPage.setCorrectAnswerStemResponseArea()
775
+ .eq(responseAreaIndex)
776
+ .within(() => {
777
+ listMatchingPage.draggableOptionDragIcon()
778
+ .should('not.exist');
779
+ })
780
+ },
781
+
782
+ /**
783
+ * @param {number} groupIndex Index of group of options in set correct answer section
784
+ * @param {string} groupTitle Title of group of options in set correct answer section
785
+ * @param {string[]} OptionsArray Array of options displayed in the group of options in set correct answer section
786
+ * @description Verify group of options displayed in set correct answer section
787
+ */
788
+ verifyGroupedResponseOptionsInSetCorrectAnswerSection: (groupIndex, groupTitle, OptionsArray) => {
789
+ listMatchingPage.setCorrectAnswerSectionGroupedResponseTitle()
790
+ .eq(groupIndex)
791
+ .verifyInnerText(groupTitle)
792
+ listMatchingPage.setCorrectAnswerSectionGroupedResponseContainer()
793
+ .eq(groupIndex)
794
+ .within(() => {
795
+ OptionsArray.forEach((optionText, optionIndex) => {
796
+ listMatchingPage.draggableOption()
797
+ .eq(optionIndex)
798
+ .should('have.text', optionText)
799
+ .and('be.visible');
800
+ });
801
+ });
802
+ },
803
+
804
+ /**
805
+ * @param {number} groupIndex Index of group of options in preview tab
806
+ * @param {string} groupTitle Title of group of options in preview tab
807
+ * @param {string[]} OptionsArray Array of options displayed in the group of options in preview tab
808
+ * @description Verify group of options displayed preview tab
809
+ */
810
+ verifyGroupedResponseOptionsInPreviewTab: (groupIndex, groupTitle, OptionsArray) => {
811
+ listMatchingPage.previewTabGroupedResponseTitle()
812
+ .eq(groupIndex)
813
+ .verifyInnerText(groupTitle)
814
+ listMatchingPage.previewTabGroupedResponseContainer()
815
+ .eq(groupIndex)
816
+ .within(() => {
817
+ OptionsArray.forEach((optionText, optionIndex) => {
818
+ listMatchingPage.draggableOption()
819
+ .eq(optionIndex)
820
+ .should('have.text', optionText)
821
+ .and('be.visible');
822
+ });
823
+ });
824
+ },
825
+
826
+ /**
827
+ * @param {number} index Index of points input field
828
+ * @description Verify points input is enabled
829
+ */
830
+ verifyPointsInputFieldIsEnabled: (index) => {
831
+ listMatchingPage.pointsInputField()
832
+ .eq(index)
833
+ .should('be.enabled');
834
+ },
835
+
836
+ /**
837
+ * @param {number} responseAreaIndex Index of the stem response area in preview tab
838
+ * @description Verify drag handle is not visible in filled stem response area in preview tab
839
+ */
840
+ verifyDragHandleNotVisibleInFilledResponseAreaInPreviewTab: (responseAreaIndex) => {
841
+ listMatchingPage.previewTabStemResponseArea()
842
+ .eq(responseAreaIndex)
843
+ .within(() => {
844
+ listMatchingPage.draggableOptionDragIcon()
845
+ .should('not.exist');
846
+ });
847
+ },
848
+
849
+ /**
850
+ * @param {number} responseAreaIndex Index of the stem response area in set correct answer section
851
+ * @description Select response area by clicking on it
852
+ */
853
+ clickOnResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
854
+ listMatchingPage.setCorrectAnswerStemResponseArea()
855
+ .eq(responseAreaIndex)
856
+ .click();
857
+ },
858
+
859
+ /**
860
+ * @param {number} responseAreaIndex Index of the stem response area in preview tab
861
+ * @description Select response area by clicking on it
862
+ */
863
+ clickOnResponseAreaInPreviewTab: (responseAreaIndex) => {
864
+ listMatchingPage.previewTabStemResponseArea()
865
+ .eq(responseAreaIndex)
866
+ .click();
867
+ },
868
+
869
+ /**
870
+ * @param {number} responseAreaIndex Index of the stem response area in set correct answer section
871
+ * @description Verify errored state of empty stem response area in set correct answer section
872
+ */
873
+ verifyErroredStateOfEmptyResponseFieldInSetCorrectAnswerSection: (responseAreaIndex) => {
874
+ listMatchingPage.setCorrectAnswerStemResponseArea()
875
+ .eq(responseAreaIndex)
876
+ .should('have.class', 'isEmpty')
877
+ .and('have.class', 'error');
878
+ },
879
+
880
+ /**
881
+ * @param {number} responseAreaIndex Index of the stem response area in preview tab
882
+ * @description Verify errored state of empty stem response area in preview tab
883
+ */
884
+ verifyErroredStateOfEmptyResponseFieldInPreviewTab: (responseAreaIndex) => {
885
+ listMatchingPage.previewTabStemResponseArea()
886
+ .eq(responseAreaIndex)
887
+ .should('have.class', 'isEmpty')
888
+ .and('have.class', 'error');
889
+ },
890
+
891
+ /**
892
+ * @param {number} responseAreaIndex Index of the stem response area in set correct answer section
893
+ * @description Verify non-errored state of filled stem response area in set correct answer section
894
+ */
895
+ verifyNonErroredStateOfFilledResponseFieldInSetCorrectAnswerSection: (responseAreaIndex) => {
896
+ listMatchingPage.setCorrectAnswerStemResponseArea()
897
+ .eq(responseAreaIndex)
898
+ .should('not.have.class', 'isEmpty')
899
+ .and('not.have.class', 'error');
900
+ },
901
+
902
+ /**
903
+ * @param {number} responseAreaIndex Index of the stem response area in preview tab
904
+ * @description Verify non-errored state of filled stem response area in preview tab
905
+ */
906
+ verifyNonErroredStateOfFilledResponseFieldInPreviewTab: (responseAreaIndex) => {
907
+ listMatchingPage.previewTabStemResponseArea()
908
+ .eq(responseAreaIndex)
909
+ .should('not.have.class', 'isEmpty')
910
+ .and('not.have.class', 'error');
911
+ },
912
+
913
+ verifyPleaseSetACorrectAnswerErrorMessage: () => {
914
+ commonComponents.errorMessage()
915
+ .verifyInnerText('Error: Please set a correct answer.')
916
+ .should('be.visible');
917
+ },
918
+
919
+ /**
920
+ * @param {string[]} responseTextArray Array of text in option input field
921
+ * @description Verify text present in options input fields
922
+ */
923
+ verifyOptionInputFieldContentsInOptionsSection: (responseTextArray) => {
924
+ listMatchingPage.responseOptionsSectionWrapper()
925
+ .within(() => {
926
+ responseTextArray.forEach((responseFieldText, optionIndex) => {
927
+ dragAndDropResponseOptions.optionsInputField()
928
+ .eq(optionIndex)
929
+ .should('have.text', responseFieldText);
930
+ dragAndDropResponseOptions.optionNumeration()
931
+ .eq(optionIndex)
932
+ .should('have.text', optionIndex + 1);
933
+ });
934
+ dragAndDropResponseOptions.optionsInputField()
935
+ .should('have.length', responseTextArray.length);
936
+ });
937
+ },
938
+
939
+ verifyDisabledStateOfOptionDeleteButton: () => { //Added this function separately as common function does not work for list matching due to similar DOM structure for stem and option fields
940
+ listMatchingPage.responseOptionsSectionWrapper()
941
+ .within(() => {
942
+ optionsWrapperComponent.deleteOptionButton()
943
+ .each(($element) => {
944
+ cy.wrap($element)
945
+ .should('be.disabled');
946
+ });
947
+ });
948
+ },
949
+
950
+ verifyOptionsForDragAndDropContentsInSetCorrectAnswerSection: () => { //Added this as function in line no. 766 does not work for list matching due to similar DOM structure for stem and option fields
951
+ listMatchingPage.responseOptionsSectionWrapper()
952
+ .within(() => {
953
+ dragAndDropResponseOptions.steps.verifyOptionsForDragAndDropSectionOptionFieldContents();
954
+ });
955
+ },
956
+ }
957
+
958
+ const tests = {
959
+ ...createQuestionBasePage.tests,
960
+ ...questionInstructionsComponent.tests,
961
+ ...autoScoredScoringSection.tests,
962
+ ...autoScoredScoringSectionMultipleResponsesType.tests,
963
+ ...autoScoredSetCorrectAnswerSection.tests,
964
+ ...scoringSectionBase.tests,
965
+ ...previewScoringAndShowCorrectAnswerComponent.tests,
966
+ ...dragAndDropResponseOptions.tests,
967
+ ...dragAndDropSetCorrectAnswerCheckboxComponents.tests,
968
+ ...draggableOptionsContainer.tests,
969
+ ...commonComponents.tests,
970
+
971
+ verifyDefaultStemFieldsAndResponseAreasInSetCorrectAnswerSection: () => {
972
+ it('Three stem fields and three empty response areas should be displayed in the set correct answer section', () => {
973
+ listMatchingPage.setCorrectAnswerStemRow()
974
+ .should('have.length', '3')
975
+ .each(($element) => {
976
+ cy.wrap($element)
977
+ .within(() => {
978
+ listMatchingPage.setCorrectAnswerStemField()
979
+ .should('be.visible')
980
+ .verifyInnerText('');
981
+ listMatchingPage.setCorrectAnswerStemResponseArea()
982
+ .should('be.visible')
983
+ .verifyInnerText('');
984
+ });
985
+ });
986
+ });
987
+ },
988
+
989
+ verifyDragToReorderTooltipInOptionsSection: () => {
990
+ it('When the user hovers over the drag handle of the options then \'Drag to reorder\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the drag handle', () => {
991
+ listMatchingPage.optionWrapper()
992
+ .eq(0)
993
+ .within(() => {
994
+ commonComponents.dragHandleButton()
995
+ .trigger('mouseover');
996
+ });
997
+ commonComponents.tooltipText()
998
+ .should('be.visible')
999
+ .verifyInnerText('Drag to reorder');
1000
+ listMatchingPage.optionWrapper()
1001
+ .eq(0)
1002
+ .within(() => {
1003
+ commonComponents.dragHandleButton()
1004
+ .trigger('mouseout');
1005
+ });
1006
+ commonComponents.tooltipText()
1007
+ .should('not.exist');
1008
+ });
1009
+
1010
+ it('CSS of drag handle tooltip', { tags: 'css' }, () => {
1011
+ listMatchingPage.optionWrapper()
1012
+ .eq(0)
1013
+ .within(() => {
1014
+ listMatchingPage.dragHandleButton()
1015
+ .trigger('mouseover');
1016
+ });
1017
+ listMatchingPage.tooltipText()
1018
+ .should('be.visible')
1019
+ .verifyCSS(css.color.whiteText, css.fontSize.small, css.fontWeight.regular);
1020
+ listMatchingPage.optionWrapper()
1021
+ .eq(0)
1022
+ .within(() => {
1023
+ listMatchingPage.dragHandleButton()
1024
+ .trigger('mouseout');
1025
+ });
1026
+ listMatchingPage.tooltipText()
1027
+ .should('not.exist');
1028
+ });
1029
+
1030
+ it('Accessibility of drag handle tooltip', { tags: 'a11y' }, () => {
1031
+ listMatchingPage.optionWrapper()
1032
+ .eq(0)
1033
+ .within(() => {
1034
+ listMatchingPage.dragHandleButton()
1035
+ .trigger('mouseover');
1036
+ });
1037
+ listMatchingPage.tooltipText()
1038
+ .should('be.visible');
1039
+ cy.checkAccessibility(listMatchingPage.tooltipText());
1040
+ listMatchingPage.optionWrapper()
1041
+ .eq(0)
1042
+ .within(() => {
1043
+ listMatchingPage.dragHandleButton()
1044
+ .trigger('mouseout');
1045
+ });
1046
+ listMatchingPage.tooltipText()
1047
+ .should('not.exist');
1048
+ });
1049
+ },
1050
+
1051
+ verifyToolTipForDisabledDeleteOptionButton: () => {
1052
+ it('When the user hovers over the disabled delete buttons of the options then \'Minimum two options are required\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the delete button', () => {
1053
+ listMatchingPage.optionWrapper()
1054
+ .eq(0)
1055
+ .within(() => {
1056
+ listMatchingPage.deleteOptionButton()
1057
+ .trigger('mouseover', { force: true });
1058
+ });
1059
+ commonComponents.tooltipText()
1060
+ .verifyInnerText('Minimum two options are required');
1061
+ listMatchingPage.optionWrapper()
1062
+ .eq(0)
1063
+ .within(() => {
1064
+ listMatchingPage.deleteOptionButton()
1065
+ .trigger('mouseout', { force: true });
1066
+ });
1067
+ commonComponents.tooltipText()
1068
+ .should('not.exist');
1069
+ });
1070
+
1071
+ it('CSS of disabled delete button tooltip', { tags: 'css' }, () => {
1072
+ listMatchingPage.optionWrapper()
1073
+ .eq(0)
1074
+ .within(() => {
1075
+ listMatchingPage.deleteOptionButton()
1076
+ .trigger('mouseover', { force: true });
1077
+ });
1078
+ commonComponents.tooltipText()
1079
+ .should('be.visible')
1080
+ .verifyCSS(css.color.whiteText, css.fontSize.small, css.fontWeight.regular);
1081
+ listMatchingPage.optionWrapper()
1082
+ .eq(0)
1083
+ .within(() => {
1084
+ listMatchingPage.deleteOptionButton()
1085
+ .trigger('mouseout', { force: true });
1086
+ });
1087
+ commonComponents.tooltipText()
1088
+ .should('not.exist');
1089
+ });
1090
+
1091
+ it('Accessibility of disabled delete button tooltip', { tags: 'a11y' }, () => {
1092
+ listMatchingPage.optionWrapper()
1093
+ .eq(0)
1094
+ .within(() => {
1095
+ listMatchingPage.deleteOptionButton()
1096
+ .trigger('mouseover', { force: true });
1097
+ });
1098
+ commonComponents.tooltipText()
1099
+ .should('be.visible');
1100
+ cy.checkAccessibility(commonComponents.tooltipText());
1101
+ listMatchingPage.optionWrapper()
1102
+ .eq(0)
1103
+ .within(() => {
1104
+ listMatchingPage.deleteOptionButton()
1105
+ .trigger('mouseout', { force: true });
1106
+ });
1107
+ commonComponents.tooltipText()
1108
+ .should('not.exist');
1109
+ });
1110
+ },
1111
+
1112
+ verifyToolTipForEnabledDeleteOptionButton: () => {
1113
+ it('when the user hovers over the enabled \'Delete\' icon buttons, then \'Delete option\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
1114
+ listMatchingPage.optionWrapper()
1115
+ .eq(0)
1116
+ .within(() => {
1117
+ cy.log('Pre step: Focusing out of the newly added option input field')
1118
+ dragAndDropResponseOptions.optionsInputField()
1119
+ .eq(2)
1120
+ .blur();
1121
+ listMatchingPage.deleteOptionButton()
1122
+ .trigger('mouseover', { force: true });
1123
+ });
1124
+ commonComponents.tooltipText()
1125
+ .verifyInnerText('Delete option');
1126
+ listMatchingPage.optionWrapper()
1127
+ .eq(0)
1128
+ .within(() => {
1129
+ listMatchingPage.deleteOptionButton()
1130
+ .trigger('mouseout', { force: true });
1131
+ });
1132
+ commonComponents.tooltipText()
1133
+ .should('not.exist');
1134
+ });
1135
+
1136
+ it('CSS of enabled delete button tooltip', { tags: 'css' }, () => {
1137
+ listMatchingPage.optionWrapper()
1138
+ .eq(0)
1139
+ .within(() => {
1140
+ listMatchingPage.deleteOptionButton()
1141
+ .trigger('mouseover', { force: true });
1142
+ });
1143
+ commonComponents.tooltipText()
1144
+ .should('be.visible')
1145
+ .verifyCSS(css.color.whiteText, css.fontSize.small, css.fontWeight.regular);
1146
+ listMatchingPage.optionWrapper()
1147
+ .eq(0)
1148
+ .within(() => {
1149
+ listMatchingPage.deleteOptionButton()
1150
+ .trigger('mouseout', { force: true });
1151
+ });
1152
+ commonComponents.tooltipText()
1153
+ .should('not.exist');
1154
+ });
1155
+
1156
+ it('Accessibility of enabled delete button tooltip', { tags: 'a11y' }, () => {
1157
+ listMatchingPage.optionWrapper()
1158
+ .eq(0)
1159
+ .within(() => {
1160
+ listMatchingPage.deleteOptionButton()
1161
+ .trigger('mouseover', { force: true });
1162
+ });
1163
+ commonComponents.tooltipText()
1164
+ .should('be.visible');
1165
+ cy.checkAccessibility(commonComponents.tooltipText());
1166
+ listMatchingPage.optionWrapper()
1167
+ .eq(0)
1168
+ .within(() => {
1169
+ listMatchingPage.deleteOptionButton()
1170
+ .trigger('mouseout', { force: true });
1171
+ });
1172
+ commonComponents.tooltipText()
1173
+ .should('not.exist');
1174
+ });
1175
+ },
1176
+
1177
+ verifyAutoScoredPartialEqualWeightsScoringEditTabContents: () => {
1178
+ it('User should be able to select \'Partial - equal weights\' scoring type', () => {
1179
+ listMatchingPage.steps.selectPartialEqualWeightsCheckbox();
1180
+ });
1181
+
1182
+ it('When the Points input field is empty and the user has switched to \'Partial - equal weights\' scoring, then \'Points per response\' label should be displayed and a \'-\' should be displayed besides each response, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and \'Round down score\' label and checkbox should be displayed and by default it should be checked', () => {
1183
+ listMatchingPage.steps.verifyDefaultPointsLabelAndInputField();
1184
+ listMatchingPage.steps.verifyPointsPerResponseLabel();
1185
+ listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('-');
1186
+ listMatchingPage.steps.verifyDefaultPenaltyPointsInputFieldAndLabel();
1187
+ listMatchingPage.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField();
1188
+ listMatchingPage.steps.verifyDefaultRoundDownScoreCheckboxCheckedAndLabel();
1189
+ });
1190
+ },
1191
+
1192
+ verifyAutoScoredPartialEqualWeightsScoringEditTabFunctionality: () => {
1193
+ it('When user gives a score input to \'Points\' input field, then the score should be equally divided and displayed besides each response under the \'Points per response\' label', () => {
1194
+ listMatchingPage.steps.allotPoints('6')
1195
+ listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('2');
1196
+ });
1197
+
1198
+ it('When user adds a stem, one more stem and its response area should be displayed in the set correct answer section and points per response score should be updated accordingly', () => {
1199
+ cy.log('Pre-step: Adding a response token to question field')
1200
+ steps.addStem()
1201
+ listMatchingPage.setCorrectAnswerStemRow()
1202
+ .should('have.length', '4');
1203
+ listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('1.5')
1204
+ });
1205
+
1206
+ it('When user removes a stem, then the points per response score should be updated accordingly', () => {
1207
+ listMatchingPage.steps.deleteStem(0);
1208
+ listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('2')
1209
+ });
1210
+
1211
+ it('User should be able to enter points in \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields', () => {
1212
+ listMatchingPage.steps.allotPenaltyPoints('1');
1213
+ listMatchingPage.steps.allotMinimumScoreAwardedIfAttempted('1');
1214
+ });
1215
+
1216
+ it('CSS of \'Points per response\' label and its displayed score, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' and \'Round down score\' checkbox', { tags: 'css' }, () => {
1217
+ listMatchingPage.pointsPerResponseLabel()
1218
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
1219
+ listMatchingPage.partialEqualWeightsPointsPerResponseScore()
1220
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
1221
+ listMatchingPage.penaltyPointsLabel()
1222
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
1223
+ listMatchingPage.minimumScoreIfAttemptedLabel()
1224
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
1225
+ listMatchingPage.rounddownScoreCheckboxLabel()
1226
+ .verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
1227
+ });
1228
+
1229
+ it('Accessibility of \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input field and \'Round down score\' checkbox', { tags: 'a11y' }, () => {
1230
+ cy.checkAccessibility(listMatchingPage.penaltyPointsInputField());
1231
+ cy.checkAccessibility(listMatchingPage.minimumScoreIfAttemptedInputField());
1232
+ cy.checkAccessibility(listMatchingPage.rounddownScoreCheckbox());
1233
+ });
1234
+
1235
+ it('When the user switches to \'All or nothing\' scoring, the \'Points per response\' label and the points displayed for individual responses should not be displayed, \'Minimum score awarded(If attempted)\' and \'Penalty points\' input fields should not be displayed and the points displayed in \'Points\' input field should remain unchanged', () => {
1236
+ listMatchingPage.steps.selectAllOrNothingCheckbox();
1237
+ listMatchingPage.pointsPerResponseLabel()
1238
+ .should('not.exist');
1239
+ listMatchingPage.partialEqualWeightsPointsPerResponseScore()
1240
+ .should('not.exist');
1241
+ listMatchingPage.steps.verifyPointsFieldValue('6');
1242
+ });
1243
+
1244
+ it('When user has entered points in \'All or nothing\' scoring type and switches to \'Partial equal weights\' scoring type, then the score should be equally divided and displayed besides each response under the \'Points per response\' label', () => {
1245
+ listMatchingPage.steps.allotPoints('9')
1246
+ listMatchingPage.steps.selectPartialEqualWeightsCheckbox();
1247
+ listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('3');
1248
+ });
1249
+ },
1250
+
1251
+ verifyAutoScoredPartialDifferentWeightsScoringEditTabContents: () => {
1252
+ it('User should be able to select \'Partial - different weights\' scoring', () => {
1253
+ listMatchingPage.steps.selectPartialDifferentWeightsCheckbox();
1254
+ });
1255
+
1256
+ it('When the user has switched to \'Partial - different weights\' scoring, then \'Points per response\' label should be displayed and a points input field should be displayed besides each response option, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and \'Round down score\' checkbox should be displayed and by default it should be checked', () => {
1257
+ listMatchingPage.steps.verifyPointsPerResponseLabel();
1258
+ listMatchingPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmpty();
1259
+ listMatchingPage.steps.verifyDefaultPenaltyPointsInputFieldAndLabel();
1260
+ listMatchingPage.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField();
1261
+ listMatchingPage.steps.verifyDefaultRoundDownScoreCheckboxCheckedAndLabel();
1262
+ });
1263
+
1264
+ it('When the user has not set any answer in the response, then the \'Points per response\' input field should be disabled', () => {
1265
+ listMatchingPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsDisabled();
1266
+ });
1267
+ },
1268
+
1269
+ verifyAutoScoredPartialDifferentWeightsScoringEditTabFunctionality: () => {
1270
+ it('When user adds an answer in the stem response area then the \'Points per response\' input field should be enabled', () => {
1271
+ for (let i = 0; i < optionsForThreeResponses.length; i++) {
1272
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection(optionsForThreeResponses[i], i);
1273
+ listMatchingPage.steps.verifyPointsInputFieldIsEnabled(i);
1274
+ }
1275
+ });
1276
+
1277
+ it('User should be able to give a score input to \'Points per response\' input fields', () => {
1278
+ listMatchingPage.steps.addPartialDifferentWeightsPoints([2.3, 3.4, 4.5]);
1279
+ });
1280
+
1281
+ it('User should be able to enter points in \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields', () => {
1282
+ listMatchingPage.steps.allotPenaltyPoints('1');
1283
+ listMatchingPage.steps.allotMinimumScoreAwardedIfAttempted('1');
1284
+ });
1285
+
1286
+ it('CSS of \'Points per response\' label, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' and \'Round down score\' checkbox', { tags: 'css' }, () => {
1287
+ listMatchingPage.pointsPerResponseLabel()
1288
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
1289
+ listMatchingPage.penaltyPointsLabel()
1290
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
1291
+ listMatchingPage.minimumScoreIfAttemptedLabel()
1292
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
1293
+ listMatchingPage.rounddownScoreCheckboxLabel()
1294
+ .verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
1295
+ });
1296
+
1297
+ it('Accessibility of \'Points per response\', \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields and \'Round down score\' checkbox', { tags: 'a11y' }, () => {
1298
+ cy.checkAccessibility(listMatchingPage.pointsInputField());
1299
+ cy.checkAccessibility(listMatchingPage.minimumScoreIfAttemptedInputField());
1300
+ cy.checkAccessibility(listMatchingPage.rounddownScoreCheckbox());
1301
+ });
1302
+
1303
+ it('When the user switches to \'All or nothing\' scoring, the points added for individual responses in Partial - different weights scoring should get summed up in the All or nothing scoring Points input field and \'Minimum score awarded(If attempted)\' and \'Penalty points\' input fields should not be displayed', () => {
1304
+ listMatchingPage.steps.selectAllOrNothingCheckbox();
1305
+ listMatchingPage.steps.verifyPointsFieldValue('10.2');
1306
+ listMatchingPage.pointsPerResponseLabel()
1307
+ .should('not.exist');
1308
+ listMatchingPage.partialEqualWeightsPointsPerResponseScore()
1309
+ .should('not.exist');
1310
+ });
1311
+
1312
+ it('When user has entered points in \'All or nothing\' scoring type and switches to \'Partial different weights\' scoring type, then the points input field displayed besides each response should be blank.', () => {
1313
+ listMatchingPage.steps.allotPoints('9')
1314
+ listMatchingPage.steps.selectPartialDifferentWeightsCheckbox();
1315
+ listMatchingPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmpty();
1316
+ });
1317
+ },
1318
+
1319
+ verifyOptionsInAlternateTab: () => {
1320
+ it('The draggable options set by the user should also be displayed in the option container of the alternate tab in the \'Set correct answer\' section', () => {
1321
+ listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection(optionsForThreeResponses);
1322
+ });
1323
+ }
1324
+ }
1325
+
1326
+ export const listMatchingPage = {
1327
+ ...selectors,
1328
+ steps,
1329
+ tests
1330
+ }