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,38 @@
1
+ export * from './createQuestionBasePage';
2
+ export * from './commonComponents';
3
+ export * from './additionalSettingsPanel';
4
+ export * from './mcqAdditionalSettingsBase';
5
+ export * from './mcqOptionsComponent';
6
+ export * from './mcqPreviewComponents';
7
+ export * from './questionInstructionsComponent';
8
+ export * from './mcqSetCorrectAnswerSection';
9
+ export * from './ckEditorToolbar';
10
+ export * from './autoScoredPreviewBase';
11
+ export * from './scoringSectionBase';
12
+ export * from './mcqQuestionCommonComponents';
13
+ export * from './essayResponseCommonComponents';
14
+ export * from './autoScoredAdditionalSettings';
15
+ export * from './autoScoredSetCorrectAnswerSection';
16
+ export * from './autoScoredScoringSectionMultipleResponsesType';
17
+ export * from './autoScoredScoringSection';
18
+ export * from './mcqScoringComponent';
19
+ export * from './createQuestionBasePage';
20
+ export * from './fillInTheGapsCommonComponents';
21
+ export * from './optionsWrapperComponent';
22
+ export * from './specialCharactersFlyoutComponent';
23
+ export * from './specialAndCustomSpecialCharactersComponent';
24
+ export * from './previewScoringAndShowCorrectAnswerComponent';
25
+ export * from './dragAndDropResponseOptions';
26
+ export * from './dragAndDropSetCorrectAnswerCheckboxComponents';
27
+ export * from './draggableOptionsContainer';
28
+ export * from './equationEditorFlyout';
29
+ export * from './answerNumerationComponent';
30
+ export * from './studentResponseAreaAndLayoutComponent';
31
+ export * from './maximumRecorderLengthComponent';
32
+ export * from './playbackControlsBaseComponent';
33
+ export * from './fillInTheGapsTextCommonComponent'
34
+ export * from './fillInTheGapsDropdownCommonComponent';
35
+ export * from './figOverImageCommonComponent';
36
+ export * from './uploadImageSectionComponent';
37
+ export * from './colorPopupComponent';
38
+ export * from './customizeHighlightPropertiesComponent';
@@ -0,0 +1,401 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ import { additionalSettingsPanel } from "./additionalSettingsPanel";
3
+ import { answerNumerationComponent } from "./answerNumerationComponent";
4
+ import { autoScoredAdditionalSettings } from "./autoScoredAdditionalSettings";
5
+ import { autoScoredScoringSectionMultipleResponsesType } from "./autoScoredScoringSectionMultipleResponsesType";
6
+ import { autoScoredSetCorrectAnswerSection } from "./autoScoredSetCorrectAnswerSection";
7
+ import { ckEditorToolbar } from "./ckEditorToolbar";
8
+ import { commonComponents } from "./commonComponents";
9
+ import { equationEditorFlyout } from "./equationEditorFlyout";
10
+ import { optionsWrapperComponent } from "./optionsWrapperComponent";
11
+ import { scoringSectionBase } from "./scoringSectionBase";
12
+ const css = Cypress.env('css');
13
+
14
+ let options = ['seed', 'sprout', 'plant', 'flower'];
15
+
16
+ const selectors = {
17
+ optionLabelLabel: () => cy.get('.order-list-option-label'),
18
+ includeLabelsLabel: () => cy.get('[data-ngie-testid*="include"] .MuiFormControlLabel-label'),
19
+ includeLabelsCheckbox: () => cy.get('[data-ngie-testid*="include"] input'),
20
+ topLabelLabel: () => cy.get('[class*="__TopLabelWrapper"] [class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]'),
21
+ bottomLabelLabel: () => cy.get('[class*="__BottomLabelWrapper"] [class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]'),
22
+ topLabelInputField: () => cy.get('.additional-option-placeholder-input .text-field').eq(0),
23
+ bottomLabelInputField: () => cy.get('.additional-option-placeholder-input .text-field').eq(1),
24
+ randomizeOptionsCheckboxLabel: () => cy.get('[data-ngie-testid="randomize-options-checkbox"] .MuiFormControlLabel-label'),
25
+ randomizeOptionsCheckbox: () => cy.get('[data-ngie-testid="randomize-options-checkbox"] input'),
26
+ hideDragHandleCheckboxLabel: () => cy.get('[data-ngie-testid="hide-drag-handle-checkbox"] .MuiFormControlLabel-label'),
27
+ hideDragHandleCheckbox: () => cy.get('[data-ngie-testid="hide-drag-handle-checkbox"] input'),
28
+ optionStyleLabel: () => cy.get('#Option-Style-dropdown-label'),
29
+ optionStyleDropdown: () => cy.get('#Option-Style-select'),
30
+ optionStyleDropdownOptions: () => cy.get('[aria-labelledby*="Option-Style-dropdown-label"] .dropdown-menu-item'),
31
+ //Scoring
32
+ optionNumeration: () => cy.get('[class*="__Index"]'),
33
+ correctAnswerContainerCorrectAnswersLabel: () => cy.get('[class*="Responsestyles__CorrectAnswerLabel"]'),
34
+ correctAnswerContainerAnswerWrapper: () => cy.get('[class*="CorrectAnswers"] [class*="__OptionsWrapper"]'),
35
+ correctAnswerContainerAnswerText: () => cy.get('.question-text-wrapper'),
36
+ }
37
+
38
+ const steps = {
39
+ //Conditional checkboxes
40
+ verifyRandomizeOptionsCheckboxUnchecked: () => {
41
+ listSortingAndOrderingBase.randomizeOptionsCheckbox()
42
+ .should('exist')
43
+ .should('not.be.checked');
44
+ },
45
+
46
+ checkRandomizeOptionsCheckbox: () => {
47
+ listSortingAndOrderingBase.randomizeOptionsCheckbox()
48
+ .click()
49
+ .should('be.checked');
50
+ },
51
+
52
+ uncheckRandomizeOptionsCheckbox: () => {
53
+ listSortingAndOrderingBase.randomizeOptionsCheckbox()
54
+ .click()
55
+ .should('not.be.checked');
56
+ },
57
+
58
+ verifyHideDragHandleCheckboxUnchecked: () => {
59
+ listSortingAndOrderingBase.hideDragHandleCheckbox()
60
+ .should('exist')
61
+ .should('not.be.checked');
62
+ },
63
+
64
+ checkHideDragHandleCheckbox: () => {
65
+ listSortingAndOrderingBase.hideDragHandleCheckbox()
66
+ .click()
67
+ .should('be.checked');
68
+ },
69
+
70
+ uncheckHideDragHandleCheckbox: () => {
71
+ listSortingAndOrderingBase.hideDragHandleCheckbox()
72
+ .click()
73
+ .should('not.be.checked');
74
+ },
75
+
76
+ //Scoring
77
+ /**
78
+ * @param {string[]} numerationArray array of numeration numbers, lowercase, uppercase
79
+ * @description this function verifies the numeration of Correct Answer Container
80
+ */
81
+ verifyCorrectAnswerContainerNumeration: (numerationArray) => {
82
+ numerationArray.forEach((optionNumeration, index) => {
83
+ listSortingAndOrderingBase.correctAnswerContainerAnswerWrapper()
84
+ .eq(index)
85
+ .within(() => {
86
+ listSortingAndOrderingBase.optionNumeration()
87
+ .should('have.text', optionNumeration);
88
+ });
89
+ });
90
+ },
91
+
92
+ /**
93
+ * @param {string[]} optionsTextArray array of options in the correct answer container
94
+ * @param {string[]} numerationArray array of numeration numbers, lowercase, uppercase
95
+ * @description this function verifies the contents of Correct Answer Container
96
+ */
97
+ verifyCorrectAnswerContainerContents: (optionsTextArray, numerationArray) => {
98
+ optionsTextArray.forEach((optionsText, index) => {
99
+ listSortingAndOrderingBase.correctAnswerContainerAnswerWrapper()
100
+ .eq(index)
101
+ .within(() => {
102
+ listSortingAndOrderingBase.correctAnswerContainerAnswerText()
103
+ .should('have.text', optionsText);
104
+ });
105
+ });
106
+ steps.verifyCorrectAnswerContainerNumeration(numerationArray);
107
+ },
108
+
109
+ verifyCorrectAnswerContainerDoesNotExist: () => {
110
+ listSortingAndOrderingBase.correctAnswerContainerCorrectAnswersLabel()
111
+ .should('not.exist');
112
+ listSortingAndOrderingBase.correctAnswerContainerAnswerWrapper()
113
+ .should('not.exist');
114
+ },
115
+
116
+ //Additional settings
117
+ verifyIncludeLablesCheckboxIsUnchecked: () => {
118
+ listSortingAndOrderingBase.includeLabelsCheckbox()
119
+ .should('not.be.checked');
120
+ },
121
+
122
+ checkIncludeLablesCheckbox: () => {
123
+ listSortingAndOrderingBase.includeLabelsCheckbox()
124
+ .click()
125
+ .should('be.checked');
126
+ },
127
+
128
+ uncheckIncludeLablesCheckbox: () => {
129
+ listSortingAndOrderingBase.includeLabelsCheckbox()
130
+ .click()
131
+ .should('not.be.checked');
132
+ },
133
+
134
+ verifyTopLabelInputFieldDisabled: () => {
135
+ listSortingAndOrderingBase.topLabelInputField()
136
+ .should('be.disabled');
137
+ },
138
+
139
+ verifyBottomLabelInputFieldDisabled: () => {
140
+ listSortingAndOrderingBase.bottomLabelInputField()
141
+ .should('be.disabled');
142
+ },
143
+
144
+ verifyTopLabelInputFieldEnabled: () => {
145
+ listSortingAndOrderingBase.topLabelInputField()
146
+ .should('be.enabled');
147
+ },
148
+
149
+ verifyBottomLabelInputFieldEnabled: () => {
150
+ listSortingAndOrderingBase.bottomLabelInputField()
151
+ .should('be.enabled');
152
+ },
153
+
154
+ /**
155
+ * @param {string} topLabel label for options field
156
+ */
157
+ addInputToTopLabelInputField: (topLabel) => {
158
+ listSortingAndOrderingBase.topLabelInputField()
159
+ .type(topLabel)
160
+ .should('have.value', topLabel)
161
+ },
162
+
163
+ clearTopLabelInputField: () => {
164
+ listSortingAndOrderingBase.topLabelInputField()
165
+ .clear();
166
+ },
167
+
168
+ /**
169
+ * @param {string} bottomLabel label for options field
170
+ */
171
+ addInputToBottomLabelInputField: (bottomLabel) => {
172
+ listSortingAndOrderingBase.bottomLabelInputField()
173
+ .type(bottomLabel)
174
+ .should('have.value', bottomLabel)
175
+ },
176
+
177
+ expandOptionStyleDropdown: () => {
178
+ listSortingAndOrderingBase.optionStyleDropdown()
179
+ .click();
180
+ utilities.verifyElementVisibilityState(listSortingAndOrderingBase.optionStyleDropdownOptions(), 'visible')
181
+ },
182
+
183
+ /**
184
+ * @param {array} dropdownOptionsArray array of option style dropdown options
185
+ * @description This function is used to verify the option style dropdown options
186
+ */
187
+ verifyOptionStyleDropdownOptions: (dropdownOptionsArray) => {
188
+ listSortingAndOrderingBase.optionStyleDropdownOptions()
189
+ .each(($el, index) => {
190
+ cy.wrap($el)
191
+ .should('have.text', dropdownOptionsArray[index])
192
+ });
193
+ },
194
+
195
+ /**
196
+ * @param {string} dropdownOption string of the dropdown option to be selected
197
+ */
198
+ selectOptionStyleDropdownOption: (dropdownOption) => {
199
+ steps.expandOptionStyleDropdown()
200
+ listSortingAndOrderingBase.optionStyleDropdownOptions()
201
+ .contains(dropdownOption)
202
+ .click({ force: true });
203
+ },
204
+ }
205
+
206
+ const tests = {
207
+ verifyOptionSectionEditTabFunctionality: () => {
208
+ it('\'Options\' label should be displayed', () => {
209
+ optionsWrapperComponent.steps.verifyOptionsLabel()
210
+ });
211
+
212
+ it('By default, 4 \'Options\' input fields should be displayed with placeholder text and numeration, Drag handle and Delete option icon buttons should be displayed besides each input field', () => {
213
+ for (let index = 0; index < 4; index++) {
214
+ optionsWrapperComponent.steps.verifyOptionsContents(index)
215
+ }
216
+ utilities.verifyElementCount(optionsWrapperComponent.optionsInputField(), 4);
217
+ });
218
+
219
+ it('CSS of Options section', { tags: 'css' }, () => {
220
+ utilities.verifyCSS(optionsWrapperComponent.optionsLabel(), {
221
+ 'color': css.color.sectionHeading,
222
+ 'font-size': css.fontSize.normal,
223
+ 'font-weight': css.fontWeight.semibold
224
+ });
225
+ utilities.verifyCSS(commonComponents.dragHandleButton().eq(0), {
226
+ 'color': css.color.secondaryBtnActive,
227
+ 'font-size': css.fontSize.normal,
228
+ 'font-weight': css.fontWeight.regular
229
+ });
230
+ utilities.verifyCSS(commonComponents.deleteButton().eq(0), {
231
+ 'opacity': '1'
232
+ });
233
+ commonComponents.deleteButton()
234
+ .eq(0)
235
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
236
+ utilities.verifyCSS(optionsWrapperComponent.optionsInputField().eq(0), {
237
+ 'color': css.color.text,
238
+ 'font-size': css.fontSize.default,
239
+ 'font-weight': css.fontWeight.regular
240
+ });
241
+ utilities.verifyCSS(optionsWrapperComponent.optionNumeration().eq(0), {
242
+ 'color': css.color.labels,
243
+ 'font-size': css.fontSize.default,
244
+ 'font-weight': css.fontWeight.semibold
245
+ });
246
+ utilities.verifyCSS(optionsWrapperComponent.addOptionButton(), {
247
+ 'color': css.color.secondaryBtnActive,
248
+ 'font-size': css.fontSize.default,
249
+ 'font-weight': css.fontWeight.regular
250
+ });
251
+ });
252
+
253
+ it('On hovering over the drag handle of the option, \'Drag to reorder\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the drag handle', () => {
254
+ commonComponents.steps.verifyDragHandleButtonTooltip();
255
+ });
256
+
257
+ 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', () => {
258
+ commonComponents.steps.verifyDeleteButtonTooltip()
259
+ });
260
+
261
+ it('When user clicks on the \'Delete\' option button then the respective options input field should get deleted, option numeration should change accordingly', () => {
262
+ optionsWrapperComponent.steps.deleteOption(2);
263
+ commonComponents.steps.verifyDeleteButtonEnabled();
264
+ for (let index = 0; index < 3; index++) {
265
+ optionsWrapperComponent.steps.verifyOptionsContents(index)
266
+ }
267
+ utilities.verifyElementCount(optionsWrapperComponent.optionsInputField(), 3)
268
+ });
269
+
270
+ it('When number of options are less than 3, the Delete option icon buttons should be displayed in disabled state', () => {
271
+ optionsWrapperComponent.steps.deleteOption(0);
272
+ commonComponents.steps.verifyDeleteButtonDisabled()
273
+ });
274
+
275
+ it('When the user hovers over the disabled \'Delete\' icon buttons 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\' icon button', () => {
276
+ commonComponents.steps.verifyDisabledDeleteButtonTooltip();
277
+ });
278
+
279
+ it('CSS of disabled delete button', { tags: 'css' }, () => {
280
+ commonComponents.deleteButton()
281
+ .eq(0)
282
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon)
283
+ utilities.verifyCSS(commonComponents.deleteButton().eq(0), {
284
+ 'opacity': '0.5'
285
+ });
286
+ });
287
+
288
+ it('Accessbility of disabled delete button', { tags: 'a11y' }, () => {
289
+ cy.checkAccessibility(commonComponents.deleteButton())
290
+ });
291
+
292
+ it('\'Add option\' button should be present', () => {
293
+ optionsWrapperComponent.steps.verifyAddOptionButton();
294
+ });
295
+
296
+ it('When user adds a option using the \'Add option\' button then added option should be displayed with drag handle, placeholder text, option numeration and delete button', () => {
297
+ optionsWrapperComponent.steps.addOption();
298
+ commonComponents.steps.verifyDeleteButtonEnabled();
299
+ for (let index = 0; index < 3; index++) {
300
+ optionsWrapperComponent.steps.verifyOptionsContents(index)
301
+ }
302
+ utilities.verifyElementCount(optionsWrapperComponent.optionsInputField(), 3)
303
+ });
304
+
305
+ it('When user focus in and out of any of the \'Option\' input field without typing anything, an error message should be thrown', () => {
306
+ optionsWrapperComponent.steps.focusInAndFocusOutOfOptionsInputField(0)
307
+ optionsWrapperComponent.steps.verifyOptionsInputFieldErrorMessage(0)
308
+ });
309
+
310
+ commonComponents.tests.verifyCSSAnda11yOfErrorMessage();
311
+
312
+ it('When user enters text in Option input field the \'Error: Option is required.\' error message should disappear.', () => {
313
+ optionsWrapperComponent.steps.addInputToOptionsInputField([options[0]]);
314
+ optionsWrapperComponent.steps.verifyOptionsInputFieldErrorMessageDoesNotExist(0);
315
+ });
316
+
317
+ it('When user adds an image to the options input field then it should be displayed in the options input field', () => {
318
+ optionsWrapperComponent.steps.focusInOptionsInputField(1);
319
+ ckEditorToolbar.steps.selectImageOptionFromCKEditorToolbar()
320
+ ckEditorToolbar.steps.addImageToInputField();
321
+ optionsWrapperComponent.steps.verifyImageAndAltTextInOptionsInputField(1);
322
+ });
323
+
324
+ it('When user adds an equation to the options input field then it should be displayed in the options input field', () => {
325
+ optionsWrapperComponent.steps.focusInOptionsInputField(2);
326
+ ckEditorToolbar.steps.selectEquationEditorOptionFromCKEditorToolbar();
327
+ equationEditorFlyout.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
328
+ optionsWrapperComponent.steps.verifyEquationInOptionsInputField(2);
329
+ });
330
+
331
+ it('When user adds a link to the options input field then it should be displayed in the options input field', () => {
332
+ optionsWrapperComponent.steps.addOption()
333
+ optionsWrapperComponent.steps.focusInOptionsInputField(3);
334
+ ckEditorToolbar.steps.selectLinkOptionFromCKEditorToolbar();
335
+ ckEditorToolbar.steps.addLinkToInputField()
336
+ optionsWrapperComponent.steps.verifyLinkInOptionsInputField(3);
337
+ });
338
+
339
+ it('When user adds Bold text to the options input field then it should be displayed in the options input field', () => {
340
+ optionsWrapperComponent.steps.addOption()
341
+ optionsWrapperComponent.steps.focusInOptionsInputField(4);
342
+ ckEditorToolbar.steps.selectBoldOptionFromCKEditorToolbar();
343
+ optionsWrapperComponent.steps.addBoldTextInputToOptionsInputField(4);
344
+ optionsWrapperComponent.steps.verifyBoldOption(4);
345
+ });
346
+ },
347
+
348
+ verifyManualScoringEditTabFunctionality: () => {
349
+ it('User should be able to select \'Manually scored\' scoring type from scoring type dropdown', () => {
350
+ scoringSectionBase.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored')
351
+ });
352
+
353
+ it('When the user has selected \'Manually Scored\' option from the Scoring Type dropdown then the \'Set Correct Answer\' section should not be displayed; \'All or Nothing\', \'Partial - equal weights\' and \'Partial - different weights\' radio buttons should not be displayed; \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed; and inside Additional Settings accordion Check Answer section i.e. \'Allow students to check answer\' checkbox should not be displayed', () => {
354
+ utilities.verifyElementVisibilityState(autoScoredSetCorrectAnswerSection.setCorrectAnswerLabel(), 'notExist');
355
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckbox(), 'notExist');
356
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.partialEqualWeightsCheckbox(), 'notExist');
357
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.partialDifferentWeightsCheckbox(), 'notExist');
358
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField(), 'notExist');
359
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.penaltyPointsLabel(), 'notExist');
360
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckbox(), 'notExist');
361
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel(), 'notExist');
362
+ utilities.verifyElementVisibilityState(listSortingAndOrderingBase.randomizeOptionsCheckbox(), 'notExist');
363
+ utilities.verifyElementVisibilityState(listSortingAndOrderingBase.hideDragHandleCheckbox(), 'notExist');
364
+ scoringSectionBase.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField()
365
+ additionalSettingsPanel.steps.expandAdditonalSettings()
366
+ utilities.verifyElementVisibilityState(autoScoredAdditionalSettings.checkAnswerLabel(), 'notExist');
367
+ utilities.verifyElementVisibilityState(autoScoredAdditionalSettings.allowStudentsToCheckAnswerLabel(), 'notExist');
368
+ });
369
+
370
+ scoringSectionBase.tests.verifyPointsFieldErrorState(10);
371
+
372
+ scoringSectionBase.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
373
+ },
374
+
375
+ /**
376
+ * @param {string[]} answerNumerationDropdownOptions array of answer numeration dropdown options
377
+ * @description this function verifies the functionality of Answer numeration in the Set correct answer section
378
+ */
379
+ verifyAnswerNumerationFunctionalityInSetCorrectAnswerSection: (answerNumerationDropdownOptions) => {
380
+ it(`When the user selects ${answerNumerationDropdownOptions[0]} option from the Answer Numeration dropdown, then numeration should not be displayed in the Set correct answer section`, () => {
381
+ utilities.verifyInnerText(answerNumerationComponent.answerNumerationDropdown(), `${answerNumerationDropdownOptions[0]}`)
382
+ utilities.verifyElementVisibilityState(listSortingAndOrderingBase.optionNumeration(), 'notExist');
383
+ });
384
+
385
+ it(`When the user selects ${answerNumerationDropdownOptions[1]} option from the Answer Numeration dropdown, then numeration should not be displayed in the Set correct answer section`, () => {
386
+ answerNumerationComponent.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[1]}`);
387
+ utilities.verifyElementVisibilityState(listSortingAndOrderingBase.optionNumeration(), 'notExist');
388
+ });
389
+
390
+ it(`When the user selects ${answerNumerationDropdownOptions[2]} option from the Answer Numeration dropdown, then numeration should not be displayed in the Set correct answer section`, () => {
391
+ answerNumerationComponent.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[2]}`);
392
+ utilities.verifyElementVisibilityState(listSortingAndOrderingBase.optionNumeration(), 'notExist');
393
+ });
394
+ }
395
+ }
396
+
397
+ export const listSortingAndOrderingBase = {
398
+ ...selectors,
399
+ steps,
400
+ tests
401
+ }
@@ -0,0 +1,116 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ import { commonComponents } from "./commonComponents";
3
+ const css = Cypress.env('css');
4
+
5
+ const selectors = {
6
+ maximumRecorderLengthInputField: () => cy.get('input[aria-label="Maximum recorder length"]'),
7
+ maximumRecorderLengthLabel: () => cy.get('.max-recording-length-input-label'),
8
+ maximumRecorderLengthInputFieldSecsSuffix: () => cy.get('[class*="max-recording"][class*="suffix"]'),
9
+ }
10
+
11
+ const steps = {
12
+ /**
13
+ * @description Sets the maximum recording length in the input field.
14
+ * @param {string} recordingLength - The maximum recording length to set in seconds.
15
+ * @example
16
+ * setMaximumRecorderLength(600); // Sets the maximum recording length to '10:00'
17
+ */
18
+ setMaximumRecorderLength: (recordingLength) => {
19
+ maximumRecorderLengthComponent.maximumRecorderLengthInputField()
20
+ .clear()
21
+ .type(recordingLength)
22
+ },
23
+
24
+ /**
25
+ * @description Verifies that the maximum recording length input field has the expected value.
26
+ * @param {string} value - The expected value to be compared with the input field's value attribute.
27
+ */
28
+ verifyMaximumRecorderLength: (value) => {
29
+ maximumRecorderLengthComponent.maximumRecorderLengthInputField()
30
+ .should('have.attr', 'value', value);
31
+ },
32
+
33
+ clearMaximumRecorderLengthInputField: () => {
34
+ maximumRecorderLengthComponent.maximumRecorderLengthInputField()
35
+ .clear()
36
+ .blur();
37
+ },
38
+ }
39
+
40
+ const tests = {
41
+ verifyMaximumRecorderLengthSectionCSS: () => {
42
+ it('CSS of \'Maximum recorder length\' section', { tags: 'css' }, () => {
43
+ utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), {
44
+ 'color': css.color.labels,
45
+ 'font-size': css.fontSize.normal,
46
+ 'font-weight': css.fontWeight.semibold
47
+ });
48
+ utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthInputField(), {
49
+ 'color': css.color.text,
50
+ 'font-size': css.fontSize.default,
51
+ 'font-weight': css.fontWeight.regular
52
+ });
53
+ utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthInputFieldSecsSuffix(), {
54
+ 'color': css.color.text,
55
+ 'font-size': css.fontSize.default,
56
+ 'font-weight': css.fontWeight.regular
57
+ });
58
+ });
59
+ },
60
+
61
+ verifyMaximumRecorderLengthLabelAndInputField: () => {
62
+ it('\'Maximum recorder length\' label, input field and \'Secs\' text should be displayed. By default 900 seconds(15 minutes) should be displayed in \'Maximum recorder length\' field', () => {
63
+ utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), 'Maximum recorder length');
64
+ utilities.verifyElementVisibilityState(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), 'visible');
65
+ utilities.verifyElementVisibilityState(maximumRecorderLengthComponent.maximumRecorderLengthInputField(), 'visible');
66
+ maximumRecorderLengthComponent.steps.verifyMaximumRecorderLength(900);
67
+ utilities.verifyElementVisibilityState(maximumRecorderLengthComponent.maximumRecorderLengthInputFieldSecsSuffix(), 'visible');
68
+ //https://redmine.zeuslearning.com/issues/540899
69
+ utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthInputFieldSecsSuffix(), 'Secs');
70
+ });
71
+ },
72
+
73
+ verifyMaximumRecorderLengthInputFieldErrorMessages: () => {
74
+ it('When the user focuses in and out of the empty \'Maximum recorder length\' input field, \'Error: Maximum recorder length is required.\' validation error should be displayed below the \'Maximum recorder length\' input field', () => {
75
+ maximumRecorderLengthComponent.steps.clearMaximumRecorderLengthInputField();
76
+ utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Maximum recorder length is required.');
77
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
78
+ });
79
+
80
+ commonComponents.tests.verifyCSSAnda11yOfErrorMessage();
81
+
82
+ it('When the user updates the \'Maximum recorder length\' value, then the validation message \'Error: Maximum recorder length is required.\' should disappear.', () => {
83
+ maximumRecorderLengthComponent.steps.setMaximumRecorderLength('1000');
84
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
85
+ });
86
+
87
+ it('When the user has set \'Maximum recorder length\' to \'0\' (zero), a validation message \'Error: Value must be greater than 0 secs.\' should be displayed', () => {
88
+ maximumRecorderLengthComponent.steps.setMaximumRecorderLength('0');
89
+ maximumRecorderLengthComponent.steps.verifyMaximumRecorderLength('0');
90
+ utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Value must be greater than 0 secs.');
91
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
92
+ });
93
+
94
+ commonComponents.tests.verifyCSSAnda11yOfErrorMessage();
95
+
96
+ it('When the user updates the \'Maximum recorder length\' value, then the validation message \'Error: Value must be greater than 0 secs.\' should disappear', () => {
97
+ maximumRecorderLengthComponent.steps.setMaximumRecorderLength('1000');
98
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
99
+ });
100
+ },
101
+
102
+ verifyMaximumRecorderLengthCharacterAcceptanceCriteria: () => {
103
+ it('When user adds decimal values or alphanumeric values then only numeric values should be displayed in the maximum recording length input field', () => {
104
+ maximumRecorderLengthComponent.steps.setMaximumRecorderLength('.100.0');
105
+ maximumRecorderLengthComponent.steps.verifyMaximumRecorderLength('1000');
106
+ maximumRecorderLengthComponent.steps.setMaximumRecorderLength('!@#abcde584');
107
+ maximumRecorderLengthComponent.steps.verifyMaximumRecorderLength('584');
108
+ });
109
+ }
110
+ }
111
+
112
+ export const maximumRecorderLengthComponent = {
113
+ ...selectors,
114
+ steps,
115
+ tests
116
+ }