itemengine-cypress-automation 1.0.247-06SeptUpdates-b1623d7.0 → 1.0.248-23rdSeptUpdates-8103a8f.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  2. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -1
  3. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +349 -0
  4. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +348 -0
  5. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +415 -0
  6. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingPenaltyScoring.js +54 -0
  7. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightBasic.js +254 -0
  8. package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightBasic.js +255 -0
  9. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +4 -0
  10. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +2 -0
  11. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +3 -0
  12. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +4 -0
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +2 -0
  14. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +2 -0
  15. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +2 -0
  16. package/cypress/e2e/ILC/ImageHighlight/toolsFunctionalityEditTab.js +2 -2
  17. package/cypress/e2e/ILC/ListOrderingNew/styleAndLayoutCustomizationSameList.js +270 -0
  18. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialDifferentWeightsBasic.js +95 -0
  19. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +236 -0
  20. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialEqualWeightsBasic.js +150 -0
  21. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/setPointsPopup.js +88 -0
  22. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/specifyCorrectAnswerSection.js +97 -0
  23. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/studentViewSettings.js +134 -0
  24. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/additionalSettings.js +131 -0
  25. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/editTabBasicSection.js +167 -0
  26. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/editTabScoring.js +202 -0
  27. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/headerSection.js +76 -0
  28. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/manuallyAndNonScoredEditTab.js +72 -0
  29. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/minimumScoringPenaltyPointsAndRoundingDropdown.js +197 -0
  30. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/optionsOrientationSection.js +180 -0
  31. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/specifyCorrectAnswerSection.js +95 -0
  32. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/studentViewSettings.js +130 -0
  33. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDraggableOptionProperties.js +223 -0
  34. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDraggableOptionsPanel.js +121 -0
  35. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDropzoneConnectorStyle.js +68 -0
  36. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationOptionAlignment.js +71 -0
  37. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationOptionPlacement.js +64 -0
  38. package/cypress/e2e/ILC/MatchingDropdown/styleAndLayoutCustomization.js +270 -0
  39. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +7 -7
  40. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +7 -7
  41. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +7 -7
  42. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +7 -7
  43. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +7 -7
  44. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +8 -8
  45. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +4 -4
  46. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +7 -7
  47. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +7 -7
  48. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +8 -8
  49. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +4 -4
  50. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +4 -4
  51. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViewsFormulaTemplate.smoke.js +272 -0
  52. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +6 -6
  53. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  54. package/cypress/pages/audioPlayerPage.js +4 -4
  55. package/cypress/pages/audioResponsePage.js +9 -1
  56. package/cypress/pages/chartsBarPage.js +3 -3
  57. package/cypress/pages/components/connectorStyleStyleAndLayoutCustomizationComponent.js +51 -0
  58. package/cypress/pages/components/gridQuestionCommonComponent.js +1 -1
  59. package/cypress/pages/components/index.js +1 -10
  60. package/cypress/pages/components/listOrderingCommonStyleAndLayoutComponent.js +604 -0
  61. package/cypress/pages/components/optionsWrapperComponent.js +1 -1
  62. package/cypress/pages/components/setPointsPopupBase.js +6 -6
  63. package/cypress/pages/dragAndDropIntoCategoriesPage.js +1 -1
  64. package/cypress/pages/essayResponseBasicPage.js +4 -4
  65. package/cypress/pages/essayResponseMathPage.js +4 -4
  66. package/cypress/pages/fillInTheGapsDragAndDropPage.js +2 -2
  67. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +2 -2
  68. package/cypress/pages/index.js +0 -1
  69. package/cypress/pages/itemPreviewPage.js +1 -2
  70. package/cypress/pages/itemPreviewSettingsPage.js +3 -3
  71. package/cypress/pages/listOrderingPage.js +384 -10
  72. package/cypress/pages/matchingPage.js +512 -13
  73. package/cypress/pages/multipleSelectionPage.js +2 -2
  74. package/cypress/pages/numberLineLabelPage.js +3 -3
  75. package/cypress/pages/shortTextResponsePage.js +0 -37
  76. package/cypress/pages/singleSelectionPage.js +2 -2
  77. package/cypress/pages/textEntryMathPage.js +41 -9
  78. package/cypress/pages/textSelectionPage.js +2 -2
  79. package/cypress/pages/uploadResponsePage.js +2 -3
  80. package/cypress/pages/videoResponsePage.js +9 -2
  81. package/package.json +1 -1
  82. package/cypress/fixtures/specialAndMathCharacters.js +0 -120
  83. package/cypress/pages/components/autoScoredAdditionalSettings.js +0 -183
  84. package/cypress/pages/components/autoScoredPreviewBase.js +0 -92
  85. package/cypress/pages/components/autoScoredScoringSection.js +0 -199
  86. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +0 -377
  87. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +0 -297
  88. package/cypress/pages/components/autoScoredStudentViewSettingsForPredefinedOptions.js +0 -84
  89. package/cypress/pages/components/listSortingAndOrderingBase.js +0 -401
  90. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +0 -91
  91. package/cypress/pages/components/scoringSectionBase.js +0 -354
  92. package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +0 -80
  93. package/cypress/pages/components/specialCharactersFlyoutComponent.js +0 -59
  94. package/cypress/pages/listSortingPage.js +0 -1198
@@ -1,401 +0,0 @@
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.medium
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.verifyErrorMessageCSSAndA11y();
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 student 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.expandAdditionalSettings()
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
- }
@@ -1,91 +0,0 @@
1
- import { createQuestionBasePage } from "./createQuestionBasePage";
2
- const css = Cypress.env('css');
3
- //Note: deprecated file
4
- const selectors = {
5
- showCorrectAnswerCheckbox: () => cy.get('input[aria-label="Show correct answer"]'),
6
- showCorrectAnswerCheckboxLabel: () => cy.get('.showAnswer-options-label').eq(1),
7
- previewScoreText: () => cy.get('[class*="PreviewTabstyles__ScoreWrapper"]'),
8
- gradingViewRadioButton: () => cy.get('.edit-question-preview-wrapper .ngie-radio-group-wrapper .radio-option-wrapper input').eq(1),
9
- studentViewRadioButton: () => cy.get('.edit-question-preview-wrapper .ngie-radio-group-wrapper .radio-option-wrapper input').eq(0),
10
- studentViewRadioButtonLabel: () => cy.get('.edit-question-preview-wrapper .ngie-radio-group-wrapper .radio-option-wrapper label').eq(0),
11
- gradingViewRadioButtonLabel: () => cy.get('.edit-question-preview-wrapper .ngie-radio-group-wrapper .radio-option-wrapper label').eq(1),
12
- previewScoreLabel: () => cy.get('[class*="PreviewTabstyles__ScoreLabelWrapper"]')
13
- }
14
-
15
- const steps = {
16
- //V3 - This function should be updated in all files
17
- checkShowCorrectAnswerCheckbox: () => {
18
- previewScoringAndShowCorrectAnswerComponent.gradingViewRadioButton()
19
- .click()
20
- .should('be.checked');
21
- },
22
-
23
- //V3 - This function should be updated in all files
24
- uncheckShowCorrectAnswerCheckbox: () => {
25
- cy.log('Deselect the show correct checkbox')
26
- previewScoringAndShowCorrectAnswerComponent.studentViewRadioButton()
27
- .click()
28
- .should('be.checked');
29
- },
30
-
31
- //V3 - This function should be updated in all files
32
- verifyDefaultShowCorrectAnswerCheckboxAndLabel: () => {
33
- previewScoringAndShowCorrectAnswerComponent.previewScoreLabel()
34
- .verifyInnerText('Score:');
35
- },
36
-
37
- //V3 - This function should be updated in all files
38
- /**
39
- * @param {number} scoredPoints points scored by the user
40
- * @param {number} totalPoints maximum points that can be achieved by the user
41
- * @description this function verifies score displayed in the preview tab
42
- */
43
- verifyPreviewTabScoreText: (scoredPoints, totalPoints) => {
44
- previewScoringAndShowCorrectAnswerComponent.previewScoreText()
45
- .should('have.text', `${scoredPoints}/${totalPoints}`);
46
- }
47
- }
48
-
49
- const tests = {
50
- verifyShowCorrectAnswerAndPointsNotDisplayedInPreviewTab: (scoringType) => {
51
- it('Show correct answer checkbox as well as points besides it should not be displayed', () => {
52
- previewScoringAndShowCorrectAnswerComponent.showCorrectAnswerCheckbox()
53
- .should('not.exist');
54
- previewScoringAndShowCorrectAnswerComponent.previewScoreText()
55
- .verifyInnerText(scoringType);
56
- });
57
- },
58
-
59
- verifyShowCorrectAnswerLabelAndCheckboxExistAndPreviewScoreNotExistInPreviewTab: () => {
60
- it('Show correct answer checkbox should be displayed and it should be unchecked by default and points should not be displayed beside it ', () => {
61
- previewScoringAndShowCorrectAnswerComponent.gradingViewRadioButton()
62
- .should('not.be.checked');
63
- previewScoringAndShowCorrectAnswerComponent.studentViewRadioButton()
64
- .should('be.checked');
65
- previewScoringAndShowCorrectAnswerComponent.previewScoreText()
66
- .verifyInnerText('Non scored');
67
- });
68
- },
69
-
70
- //TODO: Need to dicuss this as this is not required everywhere(only the tabs css)
71
- verifyCSSOfPreviewAndEditTabAndScoringContents: () => {
72
- it('CSS of Preview tab', { tags: 'css' }, () => {
73
- //CSS of inactive edit tab
74
- createQuestionBasePage.editTab()
75
- .verifyCSS(css.color.sectionHeading, css.fontSize.default, css.fontWeight.bold);
76
- //CSS of active preview tab
77
- createQuestionBasePage.previewTab()
78
- .verifyCSS(css.color.activeButtons, css.fontSize.default, css.fontWeight.bold);
79
- previewScoringAndShowCorrectAnswerComponent.previewScoreText()
80
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
81
- previewScoringAndShowCorrectAnswerComponent.previewScoreLabel()
82
- .verifyCSS(css.color.text, css.fontSize.normal, css.fontWeight.regular);
83
- });
84
- }
85
- }
86
-
87
- export const previewScoringAndShowCorrectAnswerComponent = {
88
- ...selectors,
89
- steps,
90
- tests
91
- }