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,308 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ import { commonComponents } from "./commonComponents";
3
+ const css = Cypress.env('css');
4
+
5
+ const selectors = {
6
+ scoringLabel: () => cy.get('.edit-scoring-label'),
7
+ scoringTypeLabel: () => cy.get('#Scoring-Type-dropdown-label'),
8
+ scoringTypeDropdown: () => cy.get('#Scoring-Type-select'),
9
+ scoringTypeDropdownList: () => cy.get('.dropdown-list-ul[aria-labelledby*="Scoring-Type-dropdown-label"]'),
10
+ scoringTypeDropdownListOptions: () => cy.get('[aria-labelledby*="Scoring-Type-dropdown-label"] li'),
11
+ minimumScoreIfAttemptedLabel: () => cy.get('[class*="min-score-points-label"]'),
12
+ minimumScoreIfAttemptedInputField: () => cy.get('.min-score-points-input-field input[type="text"]'),
13
+ pointsLabel: () => cy.get('.points-label'),
14
+ pointsInputField: () => cy.get('.points-input-field input[type="text"]'),
15
+ pleaseEnterPointsErrorMessage: () => cy.get('[class*="ErrorBlockstyles__ErrorText"]'),
16
+ pointsWrapper: () => cy.get('.set-correct-answer-points-wrapper'),
17
+ }
18
+
19
+ const steps = {
20
+ allotPoints: (points) => {
21
+ scoringSectionBase.pointsInputField()
22
+ .clear()
23
+ .type(points)
24
+ .should('have.value', points)
25
+ .blur();
26
+ },
27
+
28
+ verifyDefaultPointsLabelAndInputField: () => {
29
+ scoringSectionBase.pointsLabel()
30
+ .verifyInnerText('Points');
31
+ scoringSectionBase.pointsInputField()
32
+ .should('have.value', '')
33
+ .and('be.visible');
34
+ },
35
+
36
+ verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField: () => {
37
+ scoringSectionBase.minimumScoreIfAttemptedLabel()
38
+ .verifyInnerText('Minimum score awarded (if attempted)');
39
+ scoringSectionBase.minimumScoreIfAttemptedInputField()
40
+ .should('have.value', '')
41
+ .and('be.visible');
42
+ },
43
+
44
+ verifyNonScoredPointsField: () => {
45
+ scoringSectionBase.pointsInputField()
46
+ .should('have.value', '0')
47
+ .and('be.disabled');
48
+ scoringSectionBase.minimumScoreIfAttemptedInputField()
49
+ .should('not.exist');
50
+ },
51
+
52
+ selectAScoringTypeFromScoringTypeDropdown: (scoringType) => {
53
+ scoringSectionBase.scoringTypeDropdown()
54
+ .should('be.visible')
55
+ .click();
56
+ scoringSectionBase.scoringTypeDropdownListOptions()
57
+ .contains(scoringType, { matchCase: false })
58
+ .click();
59
+ scoringSectionBase.scoringTypeDropdown()
60
+ .verifyInnerText(scoringType);
61
+ },
62
+
63
+ //V3 - This function should be updated in all files
64
+ allotMinimumScoreAwardedIfAttempted: (points) => {
65
+ scoringSectionBase.minimumScoreIfAttemptedInputField()
66
+ .type(points)
67
+ .should('have.value', points);
68
+ },
69
+
70
+ //V3 - This function should be updated in all files
71
+ verifyPointsFieldValue: (points) => {
72
+ scoringSectionBase.pointsInputField()
73
+ .should('have.value', points);
74
+ },
75
+
76
+ //V3 - This function should be updated in all files
77
+ clearPointsField: () => {
78
+ scoringSectionBase.pointsInputField()
79
+ .clear()
80
+ .should('have.value', '');
81
+ },
82
+
83
+ //V3 - This function should be updated in all files
84
+ clearMinimumScoreIfAttemptedPointsField: () => {
85
+ scoringSectionBase.minimumScoreIfAttemptedInputField()
86
+ .clear()
87
+ .should('have.value', '');
88
+ },
89
+
90
+ //V3 - This function should be updated in all files
91
+ verifyPointsFieldErrorMessage: () => {
92
+ scoringSectionBase.pointsWrapper()
93
+ .within(() => {
94
+ commonComponents.errorMessage()
95
+ .verifyInnerText('Error: Please enter points.');
96
+ });
97
+ },
98
+
99
+ //V3 - This function should be updated in all files
100
+ verifyPointsFieldErrorMessageIsNotDisplayed: () => {
101
+ scoringSectionBase.pointsWrapper()
102
+ .within(() => {
103
+ commonComponents.errorMessage()
104
+ .should('not.exist');
105
+ });
106
+ },
107
+
108
+ //V3 - This function should be updated in all files
109
+ /**
110
+ * @param {number} index index of points field
111
+ * @description this function focuses in and out of points field
112
+ */
113
+ focusInAndFocusOutOfPointsInputField: (index) => {
114
+ scoringSectionBase.pointsInputField()
115
+ .eq(index)
116
+ .focus()
117
+ .blur();
118
+ }
119
+ }
120
+
121
+ const tests = {
122
+ /**
123
+ * @param {string} scoringType autoScored|manuallyScored
124
+ * @description autoScored should be passed for TEI with ['Auto scored', 'Manually scored', 'Non scored'] scoring types, manuallyScored should be passed for manually scored TEI with ['Manually scored', 'Non scored']
125
+ */
126
+ verifyScoringTypeLabelAndDropdown: (scoringType) => {
127
+ const scoringTypeArray = scoringType === 'autoScored' ? ['Auto scored', 'Manually scored', 'Non scored'] : ['Manually scored', 'Non scored'];
128
+ it(`\'Scoring\' label should be displayed and \'Scoring type\' label and dropdown should be displayed and in \'Scoring type\' dropdown \'${scoringTypeArray[0]}\' option should be selected by default`, () => {
129
+ scoringSectionBase.scoringLabel()
130
+ .verifyInnerText('Scoring');
131
+ scoringSectionBase.scoringTypeLabel()
132
+ .verifyInnerText('Scoring type');
133
+ scoringSectionBase.scoringTypeDropdown()
134
+ .verifyInnerText(scoringTypeArray[0])
135
+ .and('be.visible');
136
+ });
137
+
138
+ it(`Clicking on Scoring Type dropdown should open a list of scoring types - ${scoringTypeArray}`, () => {
139
+ let dropdownOptions = scoringTypeArray;
140
+ scoringSectionBase.scoringTypeDropdown()
141
+ .click();
142
+ scoringSectionBase.scoringTypeDropdownListOptions()
143
+ .eq(0)
144
+ .should('be.visible');
145
+ dropdownOptions.forEach((option, count) => {
146
+ scoringSectionBase.scoringTypeDropdownListOptions()
147
+ .eq(count)
148
+ .verifyInnerText(option);
149
+ });
150
+ });
151
+
152
+ it('CSS of Scoring type dropdown in active state', { tags: 'css' }, () => {
153
+ scoringSectionBase.scoringTypeDropdownListOptions()
154
+ .eq(0)
155
+ .verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular)
156
+ .should('have.css', 'background-color', css.color.liTextSelectedBg);
157
+ scoringSectionBase.scoringTypeDropdownListOptions()
158
+ .eq(1)
159
+ .should('have.css', 'background-color', css.color.transparent);
160
+ });
161
+
162
+ it('Accessibility of Scoring type dropdown in active state', { tags: 'a11y' }, () => {
163
+ cy.checkAccessibility(commonComponents.dropdownList())
164
+ });
165
+
166
+ it('Clicking outside the Scoring type dropdown menu should close the dropdown menu', () => {
167
+ scoringSectionBase.scoringLabel()
168
+ .click();
169
+ scoringSectionBase.scoringTypeDropdownList()
170
+ .should('not.exist');
171
+ });
172
+
173
+ it('CSS of Scoring section label and dropdown', { tags: 'css' }, () => {
174
+ utilities.verifyCSS(scoringSectionBase.scoringLabel(), {
175
+ 'color': css.color.sectionHeading,
176
+ 'font-size': css.fontSize.default,
177
+ 'font-weight': css.fontWeight.semibold
178
+ });
179
+ utilities.verifyCSS(scoringSectionBase.scoringTypeLabel(), {
180
+ 'color': css.color.labels,
181
+ 'font-size': css.fontSize.normal,
182
+ 'font-weight': css.fontWeight.semibold
183
+ });
184
+ utilities.verifyCSS(scoringSectionBase.scoringTypeDropdown().find('.dropdown-label-text'), {
185
+ 'color': css.color.liText,
186
+ 'font-size': css.fontSize.default,
187
+ 'font-weight': css.fontWeight.regular
188
+ });
189
+ });
190
+ },
191
+
192
+ verifyPointsFieldErrorState: (allocatedPoints) => {
193
+ it('When the user focuses in and out of the empty points input field, \'Please enter points.\' validation text should be displayed below the Points input field', () => {
194
+ scoringSectionBase.pointsInputField()
195
+ .focus()
196
+ .blur();
197
+ scoringSectionBase.pleaseEnterPointsErrorMessage()
198
+ .verifyInnerText('Error: Please enter points.')
199
+ .and('be.visible');
200
+ });
201
+
202
+ it('CSS of points field error message', { tags: 'css' }, () => {
203
+ scoringSectionBase.pointsLabel()
204
+ .parents('.points-wrapper')
205
+ .within(() => {
206
+ commonComponents.errorMessage()
207
+ .verifyCSS(css.color.errorText, css.fontSize.small, css.fontWeight.regular);
208
+ });
209
+ });
210
+
211
+ it('Accessibility of points field error message', { tags: 'a11y' }, () => {
212
+ cy.checkAccessibility(commonComponents.errorMessage())
213
+ });
214
+
215
+ it('When the user enters point in Points input field then the \'Please enter points.\' validation text should disappear', () => {
216
+ scoringSectionBase.pointsInputField()
217
+ .type(allocatedPoints)
218
+ .should('have.value', allocatedPoints);
219
+ scoringSectionBase.pleaseEnterPointsErrorMessage()
220
+ .should('not.exist');
221
+ });
222
+ },
223
+
224
+ /**
225
+ * @param {number} allocatedPoints points entered in the points input field
226
+ * @param {number} minimumPoints points entered in the minimum score awarded (if attempted) input field
227
+ * @param {number} maxPoints maximum points that can be achieved for the question
228
+ * @description this function verifies the error conditions of minimum score awarded (if attempted) input field
229
+ */
230
+ verifyMinimumScoreIfAttemptedFieldErrorState: (allocatedPoints, minimumPoints, maxPoints) => {
231
+ it('When the user focuses in and out of the empty Minimum score awarded (if attempted) input field, any validation text should not be displayed', () => {
232
+ scoringSectionBase.minimumScoreIfAttemptedInputField()
233
+ .click()
234
+ .blur();
235
+ scoringSectionBase.pleaseEnterPointsErrorMessage()
236
+ .should('not.exist');
237
+ });
238
+
239
+ it('If the user enters points more than the allocated points in \'Minimum score awarded (if attempted)\' input field, an error message \'Error: Minimum score cannot be greater than allocated points.: *points in points field*\' should be displayed', () => {
240
+ cy.log('Pre step: allocating points')
241
+ scoringSectionBase.steps.allotPoints(allocatedPoints);
242
+ scoringSectionBase.minimumScoreIfAttemptedInputField()
243
+ .clear()
244
+ .type(minimumPoints)
245
+ .should('have.value', minimumPoints)
246
+ .blur();
247
+ cy.get('body')
248
+ .click();
249
+ commonComponents.errorMessage()
250
+ .verifyInnerText(`Error: Minimum score cannot be greater than allocated points.: ${maxPoints}`);
251
+ });
252
+
253
+ it('The error message should disappear once the user removes the entered points from the Minimum score awarded (if attempted) input field', () => {
254
+ scoringSectionBase.minimumScoreIfAttemptedInputField()
255
+ .clear()
256
+ cy.get('body')
257
+ .click();
258
+ commonComponents.errorMessage()
259
+ .should('not.exist');
260
+ });
261
+ },
262
+
263
+ //V3- need to update this for all files
264
+ verifyPointsLabelAndInputField: () => {
265
+ it('When the user selects \'Auto Scored\' option from the Scoring type dropdown, then \'Points\' label and input field should be displayed', () => {
266
+ scoringSectionBase.steps.verifyDefaultPointsLabelAndInputField();
267
+ });
268
+
269
+ it('CSS of \'Points\' label and input field', { tags: 'css' }, () => {
270
+ scoringSectionBase.pointsLabel()
271
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
272
+ scoringSectionBase.pointsInputField()
273
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
274
+ });
275
+
276
+ it('Accessibility of \'Points\' label and input field', { tags: 'a11y' }, () => {
277
+ cy.checkAccessibility(scoringSectionBase.pointsInputField().parents('.points-wrapper'));
278
+ });
279
+ },
280
+
281
+ //V3- need to update this for all files
282
+ verifyMinimumScoreAwardedLabelAndInputField: () => {
283
+ it('When the user selects \'Auto Scored\' option from the Scoring type dropdown, then \'Minimum score awarded (if attempted)\' label and input field should be displayed', () => {
284
+ scoringSectionBase.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField();
285
+ });
286
+
287
+ it('User should be able to enter points in \'Minimum score awarded (if attempted)\' input field', () => {
288
+ scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted(3);
289
+ });
290
+
291
+ it('CSS of \'Minimum score awarded (if attempted)\' label and input field', { tags: 'css' }, () => {
292
+ scoringSectionBase.minimumScoreIfAttemptedLabel()
293
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
294
+ scoringSectionBase.minimumScoreIfAttemptedInputField()
295
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
296
+ });
297
+
298
+ it('Accessibility of \'Minimum score awarded (if attempted)\' label and input field', { tags: 'a11y' }, () => {
299
+ cy.checkAccessibility(scoringSectionBase.minimumScoreIfAttemptedInputField().parents('.points-container'));
300
+ });
301
+ },
302
+ }
303
+
304
+ export const scoringSectionBase = {
305
+ ...selectors,
306
+ steps,
307
+ tests
308
+ }
@@ -0,0 +1,79 @@
1
+ import { dialogBoxBase } from "../dialogBoxBase";
2
+ import { commonComponents } from "./commonComponents";
3
+ import { scoringSectionBase } from "./scoringSectionBase";
4
+
5
+ const selector = {
6
+ ...dialogBoxBase,
7
+ setPointsPopupOptions: () => cy.get('#alert-dialog-description .question-text-wrapper'),
8
+ setPointsPopupPointsLabel: () => cy.get('[class*="ListOrderingstyles__PointsLabel"]')
9
+ }
10
+
11
+ const steps = {
12
+ cancelSetPointsPopup: () => {
13
+ setPointsPopupBase.buttonReject()
14
+ .click();
15
+ setPointsPopupBase.dialogBox()
16
+ .should('not.exist');
17
+ },
18
+
19
+ saveSetPointsPopup: () => {
20
+ setPointsPopupBase.buttonAccept()
21
+ .click();
22
+ setPointsPopupBase.dialogBox()
23
+ .should('not.exist');
24
+ },
25
+
26
+ /**
27
+ * @param {number[]} pointsArray array of points to be added to Set points popup
28
+ * @description this function enters points to the points Input field of Set points popup
29
+ */
30
+ allotPointsToSetPointsPopupPointsInputField: (pointsArray) => {
31
+ pointsArray.forEach((points, index) => {
32
+ setPointsPopupBase.dialogBox()
33
+ .within(() => {
34
+ scoringSectionBase.pointsInputField()
35
+ .eq(index)
36
+ .clear()
37
+ .type(points)
38
+ .should('have.value', points);
39
+ });
40
+ });
41
+ },
42
+
43
+ /**
44
+ * @param {number[]} pointsArray array of points to be verified in Set points popup
45
+ * @description this function checks points to the points Input field of Set points popup
46
+ */
47
+ verifyPointsAllotedInSetPointsPopup: (pointsArray) => {
48
+ pointsArray.forEach((points, index) => {
49
+ setPointsPopupBase.dialogBox()
50
+ .within(() => {
51
+ scoringSectionBase.pointsInputField()
52
+ .eq(index)
53
+ .should('have.value', points);
54
+ });
55
+ });
56
+ },
57
+
58
+ /**
59
+ * @param index points field option index
60
+ * @description this function verifies points field error message
61
+ */
62
+ verifyPointsErrorMessageInSetPointsPopup: (index) => {
63
+ setPointsPopupBase.dialogBox()
64
+ .within(() => {
65
+ scoringSectionBase.pointsInputField()
66
+ .eq(index)
67
+ .parents('[class*="OptionContainerstyle__PointsWrapper"]')
68
+ .within(() => {
69
+ commonComponents.errorMessage()
70
+ .should('have.text', 'Error: Please enter points.');
71
+ });
72
+ });
73
+ }
74
+ }
75
+
76
+ export const setPointsPopupBase = {
77
+ ...selector,
78
+ steps
79
+ }
@@ -0,0 +1,79 @@
1
+ const selectors = {
2
+ specialCharactersLabel: () => cy.get('.special-character-label'),
3
+ displaySpecialCharactersLabel: () => cy.get('[data-ngie-testid="display-special-characters-checkbox"] .MuiFormControlLabel-label'),
4
+ displaySpecialCharactersCheckbox: () => cy.get('[data-ngie-testid="display-special-characters-checkbox"] input'),
5
+ customSpecialCharactersLabel: () => cy.get('.special-character-wrapper [class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]'),
6
+ customSpecialCharactersInputField: () => cy.get('input[aria-label="Custom Special Characters"]'),
7
+ setCorrectAnsResponseFieldSpecialCharactersButton: () => cy.get('.custon-special-character-button')
8
+ }
9
+
10
+ const steps = {
11
+ checkDisplaySpecialCharactersCheckbox: () => {
12
+ specialAndCustomSpecialCharactersComponent.displaySpecialCharactersCheckbox()
13
+ .click()
14
+ .should('be.checked');
15
+ },
16
+
17
+ /**
18
+ * Click on the special characters button in a response field in the set correct answer section.
19
+ * @param {number} responseFieldIndex - The index of the response field to click the button.
20
+ */
21
+ clickOnSpecialCharactersButtonSetCorrectAnswerSection: (responseFieldIndex) => {
22
+ specialAndCustomSpecialCharactersComponent.setCorrectAnsResponseFieldSpecialCharactersButton()
23
+ .eq(responseFieldIndex)
24
+ .should('be.visible')
25
+ .click();
26
+ },
27
+
28
+ /**
29
+ * Enter text into the custom special characters input field.
30
+ * @param {string} symbols - The symbols to enter into the input field.
31
+ */
32
+ enterTextInCustomSpecialCharactersInputField: (symbols) => {
33
+ specialAndCustomSpecialCharactersComponent.customSpecialCharactersInputField()
34
+ .type(symbols)
35
+ .should('have.value', symbols);
36
+ }
37
+ }
38
+
39
+ const tests = {
40
+ verifyAdditionalSettingsCustomSpecialCharactersSection: () => {
41
+ it('\'Special characters\' label and \'Display special characters\' label and checkbox should be displayed', () => {
42
+ specialAndCustomSpecialCharactersComponent.specialCharactersLabel()
43
+ .verifyInnerText('Special characters')
44
+ .should('be.visible');
45
+ specialAndCustomSpecialCharactersComponent.displaySpecialCharactersLabel()
46
+ .verifyInnerText('Display special characters')
47
+ .should('be.visible');
48
+ specialAndCustomSpecialCharactersComponent.displaySpecialCharactersCheckbox()
49
+ .should('not.be.checked')
50
+ .and('exist');
51
+ });
52
+
53
+ it('\'Custom special characters\' label and \'Custom special characters\' input field should be displayed, by default the input field should be disabled', () => {
54
+ specialAndCustomSpecialCharactersComponent.customSpecialCharactersLabel()
55
+ .verifyInnerText('Custom special characters');
56
+ specialAndCustomSpecialCharactersComponent.customSpecialCharactersInputField()
57
+ .should('be.disabled');
58
+ });
59
+
60
+ it('When the \'Custom special characters\' functionality is disabled then the \'Special characters\' button should not be displayed in the set correct answer response field', () => {
61
+ specialAndCustomSpecialCharactersComponent.setCorrectAnsResponseFieldSpecialCharactersButton()
62
+ .should('not.exist');
63
+ });
64
+
65
+ it('When user checks the \'Display special characters\' checkbox then the \'Custom special characters\' input field should be enabled', () => {
66
+ specialAndCustomSpecialCharactersComponent.displaySpecialCharactersCheckbox()
67
+ .click()
68
+ .should('be.checked');
69
+ specialAndCustomSpecialCharactersComponent.customSpecialCharactersInputField()
70
+ .should('be.enabled');
71
+ });
72
+ }
73
+ }
74
+
75
+ export const specialAndCustomSpecialCharactersComponent = {
76
+ ...selectors,
77
+ steps,
78
+ tests
79
+ }
@@ -0,0 +1,58 @@
1
+ import { specialOrMathCharacters } from "../../fixtures/specialAndMathCharacters"
2
+ import { dialogBoxBase } from "../dialogBoxBase";
3
+
4
+ const selectors = {
5
+ specialCharactersFlyoutIcon: () => cy.get('.character-wrapper')
6
+ }
7
+
8
+ const steps = {
9
+ verifySpecialCharactersFlyoutHeaderContents: () => {
10
+ dialogBoxBase.dialogBox()
11
+ .should('be.visible');
12
+ dialogBoxBase.dialogBoxTitle()
13
+ .verifyInnerText('Special characters')
14
+ .should('be.visible');
15
+ dialogBoxBase.buttonClose()
16
+ .should('be.visible');
17
+ },
18
+
19
+ clickingOnSpecialCharactersSymbolsFromFlyout: () => {
20
+ specialCharactersFlyoutComponent.specialCharactersFlyoutIcon()
21
+ .each(($el) => {
22
+ cy.wrap($el)
23
+ .click();
24
+ });
25
+ },
26
+
27
+ /**
28
+ * Verify the special characters flyout icons.
29
+ * @param {string[]} customSpecialCharactersArray - An array of expected special characters to verify.
30
+ */
31
+ verifySpecialCharactersFlyoutIcons: (customSpecialCharactersArray) => {
32
+ specialCharactersFlyoutComponent.specialCharactersFlyoutIcon()
33
+ .each(($el, index) => {
34
+ cy.wrap($el)
35
+ .should('have.text', `${customSpecialCharactersArray[index]}`)
36
+ });
37
+ }
38
+ }
39
+
40
+ const tests = {
41
+ verifySpecialCharactersFlyoutSymbols: () => {
42
+ it(`All the ${specialOrMathCharacters['specialCharacters'].popupTitle} symbols should be displayed in the flyout`, () => {
43
+ let symbolsArray = Object.values(specialOrMathCharacters['specialCharacters'].characters);
44
+ specialCharactersFlyoutComponent.specialCharactersFlyoutIcon()
45
+ .each(($element, count) => {
46
+ cy.wrap($element)
47
+ .should('be.visible')
48
+ .verifyInnerText(symbolsArray[count].symbol);
49
+ });
50
+ });
51
+ }
52
+ }
53
+
54
+ export const specialCharactersFlyoutComponent = {
55
+ ...selectors,
56
+ steps,
57
+ tests
58
+ }
@@ -0,0 +1,28 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ const css = Cypress.env('css');
3
+
4
+ const selectors = {
5
+ studentResponseAreaAndLayoutLabel: () => cy.get('.additional-settings-heading-label').eq(0),
6
+ }
7
+
8
+ const tests = {
9
+ verifyStudentResponseAreaAndLayoutLabelAndCSS: () => {
10
+ it('\'Student response area and layout\' label should be displayed', () => {
11
+ utilities.verifyInnerText(studentResponseAndLayoutComponent.studentResponseAreaAndLayoutLabel(), 'Student response area and layout');
12
+ utilities.verifyElementVisibilityState(studentResponseAndLayoutComponent.studentResponseAreaAndLayoutLabel(), 'visible');
13
+ });
14
+
15
+ it('CSS of \'Student response area and layout\' section', { tags: 'css' }, () => {
16
+ utilities.verifyCSS(studentResponseAndLayoutComponent.studentResponseAreaAndLayoutLabel(), {
17
+ 'color': css.color.labels,
18
+ 'font-size': css.fontSize.default,
19
+ 'font-weight': css.fontWeight.semibold
20
+ });
21
+ });
22
+ }
23
+ }
24
+
25
+ export const studentResponseAndLayoutComponent = {
26
+ ...selectors,
27
+ tests
28
+ }