itemengine-cypress-automation 1.0.183 → 1.0.184

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +79 -0
  2. package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +345 -0
  3. package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +429 -0
  4. package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
  5. package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +489 -0
  6. package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +313 -0
  7. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
  8. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +1 -1
  9. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
  10. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
  11. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +5 -8
  12. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +417 -28
  13. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
  14. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +29 -1
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
  17. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
  25. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
  26. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -4
  27. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +1 -0
  29. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
  30. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  31. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
  32. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
  33. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
  34. package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
  35. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
  36. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +11 -3
  37. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
  38. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
  39. package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +230 -0
  40. package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
  41. package/cypress/e2e/ILC/ListOrderingDropdown/previewContentsForAllViews.smoke.js +201 -0
  42. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +216 -0
  43. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +214 -0
  44. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +251 -0
  45. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
  46. package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +128 -0
  47. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +279 -0
  48. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +109 -0
  49. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +278 -0
  50. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +278 -0
  51. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +335 -0
  52. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +250 -0
  53. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +161 -0
  54. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +216 -0
  55. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +252 -0
  56. package/cypress/e2e/ILC/ListOrderingNew/additionalSettings.js +118 -0
  57. package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +243 -0
  58. package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
  59. package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +155 -0
  60. package/cypress/e2e/ILC/ListOrderingNew/editTabScoring.js +195 -0
  61. package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +78 -0
  62. package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  63. package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -0
  64. package/cypress/e2e/ILC/ListOrderingNew/specifyCorrectAnswerSection.js +112 -0
  65. package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +244 -0
  66. package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
  67. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +1 -0
  68. package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
  69. package/cypress/e2e/ILC/NumberLine/LayoutSection.js +181 -0
  70. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
  71. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +57 -1
  72. package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +33 -0
  73. package/cypress/e2e/ILC/NumberLine/numberLineSection.js +46 -0
  74. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
  75. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
  76. package/cypress/e2e/ILC/NumberLine/toolSettings.js +2 -1
  77. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +696 -0
  78. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +173 -0
  79. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/layoutSection.js +183 -0
  80. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +73 -0
  81. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/previewTabContentsForAllViews.smoke.js +204 -0
  82. package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +288 -0
  83. package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +153 -0
  84. package/cypress/e2e/ILC/NumberLineLabel/gradingViewAndCorrectAnswerView.smoke.js +164 -0
  85. package/cypress/e2e/ILC/NumberLineLabel/previewContentsForAllViews.smoke.js +120 -0
  86. package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
  87. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +49 -1
  88. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
  89. package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
  90. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
  91. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -1
  92. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -1
  93. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -1
  94. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +0 -1
  95. package/cypress/e2e/ILC/TextSelection/additionalSettings.js +125 -0
  96. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -1
  97. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +1 -2
  98. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +5 -4
  99. package/cypress/e2e/ILC/TextSelection/headerSection.js +73 -0
  100. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +6 -7
  101. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +179 -0
  102. package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +89 -0
  103. package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +436 -0
  104. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +277 -0
  105. package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +222 -0
  106. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +260 -0
  107. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +380 -0
  108. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
  109. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
  110. package/cypress/fixtures/constants.js +1 -1
  111. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
  112. package/cypress/fixtures/theme/ilc.json +20 -18
  113. package/cypress/pages/audioPlayerPage.js +274 -504
  114. package/cypress/pages/brainingCampManipulativePage.js +1 -1
  115. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
  116. package/cypress/pages/components/autoScoredStudentViewSettings.js +5 -5
  117. package/cypress/pages/components/commonComponents.js +1 -0
  118. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  119. package/cypress/pages/components/equationEditorFlyout.js +3 -2
  120. package/cypress/pages/components/essayResponseCommonComponents.js +8 -2
  121. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -0
  122. package/cypress/pages/components/imageCanvasComponent.js +2 -1
  123. package/cypress/pages/components/index.js +3 -0
  124. package/cypress/pages/components/layoutSectionComponent.js +1191 -0
  125. package/cypress/pages/components/numberLineCommonComponent.js +36 -0
  126. package/cypress/pages/components/optionsWrapperComponent.js +13 -2
  127. package/cypress/pages/components/playbackControlsBaseComponent.js +20 -13
  128. package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
  129. package/cypress/pages/components/toolSettingsComponent.js +6 -0
  130. package/cypress/pages/contentBlocksPage.js +18 -2
  131. package/cypress/pages/createItemPage.js +75 -8
  132. package/cypress/pages/dialogBoxBase.js +2 -2
  133. package/cypress/pages/drawingResponsePage.js +24 -4
  134. package/cypress/pages/feedbackScalePage.js +3 -0
  135. package/cypress/pages/graphingPage.js +19 -1
  136. package/cypress/pages/gridFillPage.js +25 -8
  137. package/cypress/pages/index.js +2 -1
  138. package/cypress/pages/itemPreviewSettingsPage.js +4 -0
  139. package/cypress/pages/listOrderingPage.js +435 -557
  140. package/cypress/pages/matchingPage.js +1 -1
  141. package/cypress/pages/multipleSelectionPage.js +23 -1
  142. package/cypress/pages/numberLineLabelPage.js +333 -0
  143. package/cypress/pages/numberLinePage.js +1370 -132
  144. package/cypress/pages/rulerPage.js +6 -2
  145. package/cypress/pages/textSelectionPage.js +461 -23
  146. package/package.json +1 -1
@@ -0,0 +1,194 @@
1
+ import { listOrderingPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const penaltyScoringTypeArray = ['No penalty points', 'Penalty points for the entire question', 'Penalty points for each incorrect option'];
6
+
7
+ describe('Create item page - List ordering: Minimum scoring, Penalty scoring, Rounding - Edit tab', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Scoring section: Minimum scoring - Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
16
+ cy.barsPreLoaderWait();
17
+ listOrderingPage.steps.allotPoints(10);
18
+ });
19
+
20
+ listOrderingPage.tests.verifyMinimumScoringDropdown();
21
+
22
+ listOrderingPage.tests.verifyMinimumPointsLabelAndInputField();
23
+
24
+ listOrderingPage.tests.verifyMinimumPointsFieldErrorState();
25
+ });
26
+
27
+ describe('Scoring section: Penalty scoring - Edit tab', () => {
28
+ abortEarlySetup();
29
+ before(() => {
30
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
31
+ cy.barsPreLoaderWait();
32
+ listOrderingPage.steps.allotPoints(10);
33
+ listOrderingPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
34
+ });
35
+
36
+ listOrderingPage.tests.verifyPenaltyScoringDropdown(penaltyScoringTypeArray);
37
+
38
+ listOrderingPage.tests.verifyPenaltyPointsLabelAndInputField();
39
+
40
+ listOrderingPage.tests.verifyPenaltyPointsErrorState();
41
+
42
+ it('When the user selects \'Penalty points for each incorrect option\' from the penalty scoring dropdown, \'Automatically set penalty for each incorrect option to total points / no. of incorrect options\' label and checkbox should be displayed, by default the checkbox should be unchecked. Two radio buttons with labels - \'Specify total penalty points\' and \'Specify points for each incorrect option\' should be displayed. By default, \'Specify total penalty points\' radio button should be checked', () => {
43
+ listOrderingPage.steps.expandPenaltyScoringDropdown();
44
+ listOrderingPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect option');
45
+ utilities.verifyInnerText(listOrderingPage.automaticallySetPenaltyPointsCheckboxLabel(), 'Automatically set penalty for each incorrect option to total points / no. of incorrect options');
46
+ utilities.verifyInnerText(listOrderingPage.specifyTotalPenaltyPointsRadioButtonLabel(), 'Specify total penalty points');
47
+ utilities.verifyInnerText(listOrderingPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), 'Specify points for each incorrect option');
48
+ listOrderingPage.steps.verifyAutomaticallySetPenaltyPointsCheckboxUncheckedState();
49
+ listOrderingPage.steps.verifySpecifyTotalPenaltyPointsRadioButtonCheckedState();
50
+ listOrderingPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonUncheckedState();
51
+ });
52
+
53
+ it('When \'Specify total penalty points\' is selected, a penalty points detail section with \'Total penalty points\' label and empty input field, \'Penalty points for each incorrect option: -\' label should be displayed', () => {
54
+ utilities.verifyInnerText(listOrderingPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Total penalty points');
55
+ listOrderingPage.steps.verifyTotalPenaltyPointsValue('');
56
+ utilities.verifyInnerText(listOrderingPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect option: -');
57
+ });
58
+
59
+ it('When the user allots total penalty points, then \'points for each incorrect option\' should get updated as per the count of incorrect options available', () => {
60
+ listOrderingPage.steps.allotTotalPenaltyPoints(5);
61
+ listOrderingPage.steps.verifyPenaltyPointsForEachIncorrectOption(1.67);
62
+ });
63
+
64
+ it('When the user deletes an option, then \'points for each incorrect option\' should get updated accordingly', () => {
65
+ listOrderingPage.steps.deleteOption(0);
66
+ listOrderingPage.steps.verifyPenaltyPointsForEachIncorrectOption(2.5);
67
+ });
68
+
69
+ it('When the user adds a new option, then \'points for each incorrect option\' should get updated accordingly', () => {
70
+ listOrderingPage.steps.addOption();
71
+ listOrderingPage.steps.verifyPenaltyPointsForEachIncorrectOption(1.67);
72
+ });
73
+
74
+ it('CSS of the penalty points section - Total penalty points', { tags: 'css' }, () => {
75
+ utilities.verifyCSS(listOrderingPage.automaticallySetPenaltyPointsCheckboxLabel(), {
76
+ 'color': css.color.labelText,
77
+ 'font-size': css.fontSize.default,
78
+ 'font-weight': css.fontWeight.regular
79
+ });
80
+ utilities.verifyCSS(listOrderingPage.automaticallySetPenaltyPointsCheckbox().parent().find('svg'), {
81
+ 'fill': css.color.uncheckedCheckbox
82
+ });
83
+ utilities.verifyCSS(listOrderingPage.specifyTotalPenaltyPointsRadioButton().parent().find('svg'), {
84
+ 'fill': css.color.activeButtons
85
+ });
86
+ utilities.verifyCSS(listOrderingPage.specifyPointsForEachIncorrectOptionRadioButton().parent().find('svg path'), {
87
+ 'fill': css.color.uncheckedCheckbox
88
+ });
89
+ utilities.verifyCSS(listOrderingPage.specifyTotalPenaltyPointsRadioButtonLabel(), {
90
+ 'color': css.color.labelText,
91
+ 'font-size': css.fontSize.default,
92
+ 'font-weight': css.fontWeight.regular
93
+ });
94
+ utilities.verifyCSS(listOrderingPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), {
95
+ 'color': css.color.labelText,
96
+ 'font-size': css.fontSize.default,
97
+ 'font-weight': css.fontWeight.regular
98
+ });
99
+ utilities.verifyCSS(listOrderingPage.penaltyPointsDetailsSectionInputFieldLabel(), {
100
+ 'color': css.color.labelText,
101
+ 'font-size': css.fontSize.default,
102
+ 'font-weight': css.fontWeight.regular
103
+ });
104
+ utilities.verifyCSS(listOrderingPage.totalPenaltyPointsInputField(), {
105
+ 'color': css.color.text,
106
+ 'font-size': css.fontSize.default,
107
+ 'font-weight': css.fontWeight.regular
108
+ });
109
+ utilities.verifyCSS(listOrderingPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
110
+ 'color': css.color.labelText,
111
+ 'font-size': css.fontSize.default,
112
+ 'font-weight': css.fontWeight.regular
113
+ });
114
+ });
115
+
116
+ it('Accessibility of the penalty points section - Total penalty points', { tags: 'a11y' }, () => {
117
+ cy.checkAccessibility(listOrderingPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
118
+ });
119
+
120
+ it('When the user selects \'Specify points for each incorrect answer\', a penalty points detail section with \'Penalty points for each incorrect option:\' label and empty input field, \'Total penalty points: -\' label should be displayed', () => {
121
+ cy.log('Pre-step: Clearing the total penalty points input field')
122
+ listOrderingPage.steps.clearTotalPenaltyPointsInputField();
123
+ listOrderingPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify points for each incorrect option');
124
+ utilities.verifyInnerText(listOrderingPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Penalty points for each incorrect option');
125
+ listOrderingPage.steps.verifyPenaltyPointsForEachIncorrectOptionValue('');
126
+ utilities.verifyInnerText(listOrderingPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Total penalty points: -');
127
+ });
128
+
129
+ it('When the user allots Penalty points for each incorrect option, then \'Total penalty points\' should get updated as per the count of incorrect options available', () => {
130
+ listOrderingPage.steps.allotPenaltyPointsForEachIncorrectOption(1);
131
+ listOrderingPage.steps.verifyTotalPenaltyPoints(3);
132
+ });
133
+
134
+ it('When the user adds a new option, then \'Total penalty points\' should get updated accordingly', () => {
135
+ listOrderingPage.steps.addOption();
136
+ listOrderingPage.steps.verifyTotalPenaltyPoints(4);
137
+ });
138
+
139
+ it('When the user deletes an option, then \'points for each incorrect option\' should get updated accordingly', () => {
140
+ listOrderingPage.steps.deleteOption(0);
141
+ listOrderingPage.steps.verifyTotalPenaltyPoints(3);
142
+ });
143
+
144
+ it('CSS of the penalty points section - Penalty points for each incorrect option', { tags: 'css' }, () => {
145
+ utilities.verifyCSS(listOrderingPage.penaltyPointsDetailsSectionInputFieldLabel(), {
146
+ 'color': css.color.labelText,
147
+ 'font-size': css.fontSize.default,
148
+ 'font-weight': css.fontWeight.regular
149
+ });
150
+ utilities.verifyCSS(listOrderingPage.penaltyPointsForEachIncorrectOptionInputField(), {
151
+ 'color': css.color.text,
152
+ 'font-size': css.fontSize.default,
153
+ 'font-weight': css.fontWeight.regular
154
+ });
155
+ utilities.verifyCSS(listOrderingPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
156
+ 'color': css.color.labelText,
157
+ 'font-size': css.fontSize.default,
158
+ 'font-weight': css.fontWeight.regular
159
+ });
160
+ });
161
+
162
+ it('Accessibility of the penalty points section - Penalty points for each incorrect option', { tags: 'a11y' }, () => {
163
+ cy.checkAccessibility(listOrderingPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
164
+ });
165
+
166
+ it('When the user switches to the \'Specify total penalty points\' option, the total penalty points input field should be filled as per the total penalty points in \'Specify points for each incorrect option\'', () => {
167
+ listOrderingPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify total penalty points');
168
+ listOrderingPage.steps.verifyTotalPenaltyPointsValue(3);
169
+ utilities.verifyInnerText(listOrderingPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect option: 1');
170
+ });
171
+
172
+ it('When the user checks the \'Automatically set penalty for each incorrect option to total points / no. of incorrect options\' checkbox, both radio buttons should get disabled, \'Specify points for each incorrect option\' should get checked, in the penalty points details section, \'Penalty points for each incorrect option: #\' and \'Total penalty points: #\' should be displayed as per the alloted points and available incorrect options', () => {
173
+ listOrderingPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
174
+ listOrderingPage.steps.verifySpecifyTotalPenaltyPointsDisabledState();
175
+ listOrderingPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonSelectedAndDisabledState();
176
+ utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 0), 'Penalty points for each incorrect option: 3.33');
177
+ utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 1), 'Total penalty points: 9.99');
178
+ });
179
+ });
180
+
181
+ describe('Scoring section: Rounding - Edit tab', () => {
182
+ abortEarlySetup();
183
+ before(() => {
184
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
185
+ cy.barsPreLoaderWait();
186
+ listOrderingPage.steps.allotPoints(10);
187
+ listOrderingPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
188
+ });
189
+
190
+ listOrderingPage.tests.verifyRoundingDropdown();
191
+
192
+ listOrderingPage.tests.verifyRoundNegativeScoreToZeroLabelAndCheckbox();
193
+ });
194
+ });
@@ -0,0 +1,176 @@
1
+ import { listOrderingPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import { ckEditorToolbar, equationEditorFlyout } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
6
+ const views = utilities.getViews(previewContentViews);
7
+ var itemReferenceID = "";
8
+ const css = Cypress.env('css');
9
+
10
+ describe('Create item page - List ordering - Preview contents in all views', () => {
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ });
14
+
15
+ views.forEach((view) => {
16
+ describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ switch (view) {
20
+ case 'Question preview':
21
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
22
+ cy.barsPreLoaderWait();
23
+ listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
24
+ listOrderingPage.steps.allotPoints(10);
25
+ cy.log('Add image to option input field')
26
+ listOrderingPage.steps.focusInOptionsInputField(0);
27
+ ckEditorToolbar.steps.selectImageOptionFromCKEditorToolbar();
28
+ ckEditorToolbar.steps.addImageToInputField();
29
+ listOrderingPage.steps.enterTextInOptionInputField(0, 'Fox');
30
+ cy.log('Add bold text to option input field')
31
+ listOrderingPage.steps.focusInOptionsInputField(1);
32
+ ckEditorToolbar.steps.selectBoldOptionFromCKEditorToolbar();
33
+ listOrderingPage.steps.enterTextInOptionInputField(1, 'This is a bold option');
34
+ cy.log('Add equation to option input field')
35
+ listOrderingPage.steps.enterTextInOptionInputField(2, 'Solve the following');
36
+ listOrderingPage.steps.focusInOptionsInputField(2);
37
+ ckEditorToolbar.steps.selectEquationEditorOptionFromCKEditorToolbar();
38
+ equationEditorFlyout.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
39
+ listOrderingPage.steps.enterTextInOptionInputField(3, 'alpha');
40
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('This is a bold option', 0);
41
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('Solve the following', 1);
42
+ listOrderingPage.steps.switchToPreviewTab();
43
+ break;
44
+ case 'Item view':
45
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
46
+ break;
47
+ case 'Item preview':
48
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
49
+ listOrderingPage.steps.switchToPreviewTab();
50
+ break;
51
+ case 'Student view':
52
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
53
+ break;
54
+ case 'Grading view':
55
+ cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
56
+ break;
57
+ case 'Correct answer view':
58
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
59
+ break;
60
+ default:
61
+ throw new Error('Invalid view');
62
+ }
63
+ });
64
+
65
+ after(() => {
66
+ if (view === 'Question preview') {
67
+ listOrderingPage.steps.clickOnSaveQuestionButton();
68
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
69
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
70
+ }
71
+ if (view === 'Student view') {
72
+ studentViewPage.steps.submitResponse();
73
+ utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
74
+ }
75
+ });
76
+
77
+ it('Question instructions should be visible', () => {
78
+ utilities.verifyInnerText(listOrderingPage.questionInstructionsText(), 'Arrange options in correct order.');
79
+ utilities.verifyElementVisibilityState(listOrderingPage.questionInstructionsText(), 'visible');
80
+ });
81
+
82
+ if (view !== 'Grading view' && view !== 'Correct answer view') {
83
+ it(`When the user has added image, equation, bold text to the options input fields, then they should be displayed in the options container in ${view}`, () => {
84
+ listOrderingPage.steps.verifyOptionWithImageInPreviewTab(0);
85
+ listOrderingPage.steps.verifyOptionWithBoldTextInPreviewTab(1);
86
+ listOrderingPage.steps.verifyOptionWithEquationTextInPreviewTab(2);
87
+ });
88
+
89
+ it('User should be able to reorder options containing image, bold text and equation options in the list', () => {
90
+ listOrderingPage.steps.clickAndReorderOptionInPreviewTab('This is a bold option', 0);
91
+ listOrderingPage.steps.clickAndReorderOptionInPreviewTab('Solve the following', 1);
92
+ listOrderingPage.steps.verifyTextContentOfOptionInPreviewTab('This is a bold option', 0);
93
+ listOrderingPage.steps.verifyOptionWithBoldTextInPreviewTab(0);
94
+ listOrderingPage.steps.verifyOptionWithEquationTextInPreviewTab(1);
95
+ listOrderingPage.steps.verifyOptionWithImageInPreviewTab(2);
96
+ listOrderingPage.steps.verifyTextContentOfOptionInPreviewTab('alpha', 3);
97
+ });
98
+ } else if (view === 'Grading view') {
99
+ it(`The order of the responses should be as per the submitted response`, () => {
100
+ listOrderingPage.steps.verifyOptionWithBoldTextInGradingView(0);
101
+ listOrderingPage.steps.verifyOptionWithEquationTextInGradingView(1);
102
+ listOrderingPage.steps.verifyOptionWithImageInGradingView(2);
103
+ listOrderingPage.steps.verifyTextContentOfOptionInGradingView('alpha', 3);
104
+ listOrderingPage.steps.verifyCorrectOptionIcon('This is a bold option');
105
+ listOrderingPage.steps.verifyCorrectOptionIcon('Solve the following');
106
+ listOrderingPage.steps.verifyCorrectOptionIcon('Fox');
107
+ listOrderingPage.steps.verifyCorrectOptionIcon('alpha');
108
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
109
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
110
+ });
111
+
112
+ it('The order of the responses should not be editable', () => {
113
+ listOrderingPage.steps.clickAndReorderOptionInGradingView('This is a bold option', 2);
114
+ listOrderingPage.steps.verifyOptionWithBoldTextInGradingView(0);
115
+ listOrderingPage.steps.verifyOptionWithEquationTextInGradingView(1);
116
+ listOrderingPage.steps.verifyOptionWithImageInGradingView(2);
117
+ listOrderingPage.steps.verifyTextContentOfOptionInGradingView('alpha', 3);
118
+ });
119
+ } else {
120
+ it('The order of the options should be as per the correct answer order', () => {
121
+ listOrderingPage.steps.verifyOptionWithBoldTextInGradingView(0);
122
+ listOrderingPage.steps.verifyOptionWithEquationTextInGradingView(1);
123
+ listOrderingPage.steps.verifyOptionWithImageInGradingView(2);
124
+ listOrderingPage.steps.verifyTextContentOfOptionInGradingView('alpha', 3);
125
+ });
126
+ }
127
+
128
+ it('CSS of preview contents', { tags: 'css' }, () => {
129
+ switch (view) {
130
+ case 'Question preview':
131
+ case 'Item preview':
132
+ case 'Item view':
133
+ case 'Item preview':
134
+ case 'Student view':
135
+ utilities.verifyCSS(listOrderingPage.optionPreviewTab(), {
136
+ 'background-color': css.color.defaultBackground,
137
+ 'border': `1px solid ${css.color.draggableOptionBorder}`
138
+ });
139
+ utilities.verifyCSS(listOrderingPage.optionPreviewTab().find('.question-text-wrapper'), {
140
+ 'color': css.color.text,
141
+ 'font-size': css.fontSize.default,
142
+ 'font-weight': css.fontWeight.regular
143
+ });
144
+ utilities.verifyCSS(listOrderingPage.optionPreviewTab().find('.question-text-wrapper'), {
145
+ 'color': css.color.text,
146
+ 'font-size': css.fontSize.default,
147
+ 'font-weight': css.fontWeight.regular
148
+ });
149
+ utilities.verifyCSS(utilities.getNthElement(listOrderingPage.optionPreviewTab(), 1).find('.drag-icon-button path').eq(1), {
150
+ 'color': css.color.secondaryBtn
151
+ });
152
+ break;
153
+ case 'Grading view':
154
+ utilities.verifyCSS(listOrderingPage.optionWrapperGradingView(), {
155
+ 'background-color': css.color.defaultBackground,
156
+ 'border': `1px solid ${css.color.draggableOptionBorder}`
157
+ });
158
+ utilities.verifyCSS(utilities.getNthElement(listOrderingPage.optionGradingView(), 3).find('.question-text-wrapper'), {
159
+ 'color': css.color.text,
160
+ 'font-size': css.fontSize.default,
161
+ 'font-weight': css.fontWeight.regular
162
+ });
163
+ utilities.verifyCSS(listOrderingPage.optionWrapperGradingView().find('[class*="IndexWrapper"]'), {
164
+ 'color': css.color.text,
165
+ 'font-size': css.fontSize.default,
166
+ 'font-weight': css.fontWeight.regular
167
+ });
168
+ }
169
+ });
170
+
171
+ it('Accessibility of preview contents', { tags: 'a11y' }, () => {
172
+ cy.checkAccessibility(listOrderingPage.optionWrapperPreviewTab().parents('[class*="question-preview-wrapper"]'));
173
+ });
174
+ });
175
+ });
176
+ });
@@ -0,0 +1,112 @@
1
+ import { dialogBoxBase, listOrderingPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const options = ['sprout', 'plant', 'flower', 'seed'];
5
+
6
+ describe('Create item page - List ordering: Specify correct answer, Alternative correct answer', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Specify correct answer section - Header and \'Correct\' accordion', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
15
+ cy.barsPreLoaderWait();
16
+ listOrderingPage.steps.addInputToOptionsInputField(options);
17
+ });
18
+
19
+ listOrderingPage.tests.verifyAutoScoredSpecifyCorrectAnswerHeaderSectionContents('list ordering');
20
+
21
+ it('By default, 4 options should be displayed with Drag handle in the correct accordion', () => {
22
+ utilities.verifyElementCount(listOrderingPage.optionSpecifyCorrectAnswerSection(), 4);
23
+ options.forEach((optionText, index) => {
24
+ listOrderingPage.steps.verifyTextContentOfOptionInSpecifyCorrectAnswerSection(optionText, index);
25
+ });
26
+ });
27
+
28
+ listOrderingPage.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty('Correct');
29
+ });
30
+
31
+ describe('Specify correct answer section - \'Alternative\' accordion', () => {
32
+ abortEarlySetup();
33
+ before(() => {
34
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
35
+ cy.barsPreLoaderWait();
36
+ listOrderingPage.steps.addInputToOptionsInputField(options);
37
+ });
38
+
39
+ listOrderingPage.tests.verifyAutoScoredAddAlternativeAnswerButtonAndValidation('list ordering');
40
+
41
+ it('When user tries to \'+Add alternative answer\' after allotting points without re-ordering the options then the warning popup should appear and on closing the warning popup, an error message should be displayed in the \'Specify correct answer\' section', () => {
42
+ listOrderingPage.steps.clickOnAddAlternativeAnswerButton();
43
+ dialogBoxBase.steps.closeWarningPopup();
44
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
45
+ utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.errorMessage(), 1), 'Error: The correct answer sequence matches the option sequence. Please either rearrange the options or select \'Randomize options\' to continue.');
46
+ utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'visible');
47
+ });
48
+
49
+ listOrderingPage.tests.verifyErrorMessageCSSAndA11y();
50
+
51
+ it('When the user checks \'Randomize options\' then the error message should disappear', () => {
52
+ listOrderingPage.steps.checkRandomizeOptionsCheckbox();
53
+ utilities.verifyElementVisibilityState(utilities.getNthElement(listOrderingPage.errorMessage(), 1), 'notExist');
54
+ cy.log('Post step: Allotting points to remove the error message')
55
+ listOrderingPage.steps.allotPoints(10);
56
+ });
57
+
58
+ it('When the user unchecks the \'Randomize options\' checkbox and clicks on \'+Add alternative answer\' the error message should be displayed and on re-ordering the options the error message should disappear', () => {
59
+ listOrderingPage.steps.uncheckRandomizeOptionsCheckbox();
60
+ listOrderingPage.steps.clickOnAddAlternativeAnswerButton();
61
+ dialogBoxBase.steps.closeWarningPopup();
62
+ utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'visible');
63
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('seed', 0);
64
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('sprout', 1);
65
+ listOrderingPage.steps.verifyOptionsOrderInSpecifyCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
66
+ utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'notExist');
67
+ });
68
+
69
+ it('When the user has allotted points to the \'Correct accordion\' and has set correct answer order, then the user should be able to add alternative answer for the question using \'Add alternative answer\' button', () => {
70
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('seed', 0);
71
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('sprout', 1);
72
+ listOrderingPage.steps.addAlternativeAnswerAccordion(1);
73
+ });
74
+
75
+ it('When user has added an alternative answer accordion, then the newly added alternative answer accordion should be in expanded state and the correct answer accordion should be in collapsed state', () => {
76
+ listOrderingPage.steps.verifyCorrectAnswerAccordionIsCollapsed();
77
+ listOrderingPage.steps.verifyAlternateAnswerAccordionIsExpanded(0);
78
+ });
79
+
80
+ it('By default, 4 options should be displayed with Drag handle in the correct accordion', () => {
81
+ utilities.verifyElementCount(listOrderingPage.optionSpecifyCorrectAnswerSection(), 4);
82
+ options.forEach((optionText, index) => {
83
+ listOrderingPage.steps.verifyTextContentOfOptionInSpecifyCorrectAnswerSection(optionText, index);
84
+ });
85
+ });
86
+
87
+ it('User should be able to add another alternative answer for the question using \'Add alternative answer\' button and the name for this new accordion should be \'Alternative 2\'', () => {
88
+ cy.log('Set correct answer and points in alternative 1 accordion');
89
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('seed', 2);
90
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('sprout', 3);
91
+ listOrderingPage.steps.allotPoints(5);
92
+ listOrderingPage.steps.addAlternativeAnswerAccordion(2);
93
+ });
94
+
95
+ listOrderingPage.tests.verifyWarningPopupAndAccordionNavigationWhenNoPointsAddedInAlternativeAccordion();
96
+
97
+ it('User should be able to remove alternative correct answer by clicking on the \'Delete\' icon button alongside alternative answer accordion and the name of the alternative answer accordions should get updated accordingly', () => {
98
+ cy.log('Set correct answer and points in alternative 2 accordion, then switch to alternative 1 accordion and click delete icon button');
99
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('seed', 2);
100
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('sprout', 3);
101
+ listOrderingPage.steps.allotPoints(5);
102
+ listOrderingPage.steps.deleteAlternativeAnswerAccordion(1);
103
+ listOrderingPage.steps.verifyAlternativeAnswerAccordionNotExists(2);
104
+ listOrderingPage.steps.verifyAlternativeAnswerAccordionLabel(0);
105
+ });
106
+
107
+ it('When correct answers and points are set in alternative answer and user clicks on correct answer accordion, then correct answer accordion should be expanded and the alternative answer accordion should be collapsed', () => {
108
+ listOrderingPage.steps.expandCorrectAnswerAccordion();
109
+ listOrderingPage.steps.verifyAlternateAnswerAccordionIsCollapsed(0);
110
+ });
111
+ });
112
+ });