itemengine-cypress-automation 1.0.119 → 1.0.121

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +13 -1
  2. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +2 -0
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -2
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +1 -4
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +273 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js +116 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +136 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +224 -0
  12. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +120 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +158 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -1
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -4
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +246 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +332 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +409 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +80 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +213 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +2 -2
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +1 -1
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +2 -2
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +68 -68
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +3 -289
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -23
  32. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +191 -0
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +190 -0
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +284 -0
  35. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
  36. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +113 -0
  37. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +217 -0
  38. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +234 -0
  39. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +217 -0
  40. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +217 -0
  41. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsBasic.js +136 -0
  42. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +197 -0
  43. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +169 -0
  44. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +197 -0
  45. package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +219 -0
  46. package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAnswerFunctionalityForAllViews.smoke.js +115 -0
  47. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +142 -0
  48. package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +152 -0
  49. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +39 -0
  50. package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +2 -12
  51. package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +497 -0
  52. package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +503 -0
  53. package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +233 -0
  54. package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +291 -0
  55. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +332 -0
  56. package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +2 -12
  57. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +9 -8
  58. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +4 -4
  59. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -2
  60. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +5 -2
  61. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +334 -0
  62. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +419 -0
  63. package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +166 -0
  64. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +166 -0
  65. package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +51 -0
  66. package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +99 -0
  67. package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +71 -0
  68. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +155 -0
  69. package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +66 -0
  70. package/cypress/e2e/migration/migration.js +6 -5
  71. package/cypress/e2e/migration/migration2.js +4 -3
  72. package/cypress/e2e/migration/migration3.js +4 -3
  73. package/cypress/e2e/migration/migration4.js +4 -3
  74. package/cypress/e2e/migration/migration5.js +4 -3
  75. package/cypress/fixtures/theme/ilc.json +3 -1
  76. package/cypress/pages/audioResponsePage.js +2 -1
  77. package/cypress/pages/components/additionalSettingsPanel.js +27 -0
  78. package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
  79. package/cypress/pages/components/autoScoredScoringSection.js +1 -1
  80. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
  81. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  82. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
  83. package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
  84. package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
  85. package/cypress/pages/components/createQuestionBasePage.js +8 -2
  86. package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
  87. package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
  88. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
  89. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
  90. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
  91. package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
  92. package/cypress/pages/components/index.js +3 -3
  93. package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
  94. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
  95. package/cypress/pages/components/questionInputFieldComponent.js +49 -23
  96. package/cypress/pages/components/scoringSectionBase.js +1 -1
  97. package/cypress/pages/createItemPage.js +67 -2
  98. package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
  99. package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
  100. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
  101. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
  102. package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
  103. package/cypress/pages/fillInTheGapsTextPage.js +52 -199
  104. package/cypress/pages/index.js +5 -5
  105. package/cypress/pages/multipleSelectionPage.js +1 -0
  106. package/cypress/pages/shortTextResponsePage.js +575 -33
  107. package/cypress/pages/singleSelectionGridPage.js +1 -2
  108. package/cypress/pages/singleSelectionPage.js +5 -6
  109. package/cypress/pages/textEntryMathPage.js +46 -22
  110. package/cypress/pages/textEntryMathWithImagePage.js +212 -0
  111. package/cypress/pages/uploadResponsePage.js +74 -21
  112. package/cypress/support/migrationHelpers/extractLrnQuestionData.js +73 -2
  113. package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -0
  114. package/cypress/support/migrationHelpers/verifyIeQuestionData.js +49 -2
  115. package/package.json +1 -1
  116. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
  117. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
  118. package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
  119. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
  120. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
  121. package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
  122. package/cypress/pages/fillInTheGapsScoring.js +0 -5872
  123. package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -0,0 +1,332 @@
1
+ import { shortTextResponsePage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const labels = [shortTextResponsePage.displayWordCountLabel, shortTextResponsePage.spellCheckLabel, shortTextResponsePage.autoScaleTheResponseFieldHeightLabel];
7
+ const checkboxes = [shortTextResponsePage.displayWordCountCheckbox, shortTextResponsePage.spellCheckCheckbox, shortTextResponsePage.autoScaleTheResponseFieldHeightCheckbox];
8
+
9
+ describe('Create Item page - Short text response : Student view settings', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Student view settings : Edit tab contents', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ cy.log('Navigating to short text response question type');
18
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
19
+ cy.barsPreLoaderWait();
20
+ });
21
+
22
+ shortTextResponsePage.tests.verifyStudentViewSettingsLabelAndCSS();
23
+
24
+ it('\'Accepted student input\' label, menu and its options - \'Text\', \'Number\', \'Integer\' should be displayed and \'Text\' option should be active', () => {
25
+ utilities.verifyInnerText(shortTextResponsePage.acceptedStudentInputLabel(), 'Accepted student input');
26
+ utilities.verifyElementVisibilityState(shortTextResponsePage.acceptedStudentInputLabel(), 'visible');
27
+ shortTextResponsePage.steps.verifyAcceptedStudentTypeMenuButtons(0);
28
+ shortTextResponsePage.steps.verifyAcceptedStudentTypeActiveButton(0, 'Text');
29
+ });
30
+
31
+ it('\'Display character count\' and \'Display word count\' label and checkboxes should be displayed and by default both checkboxes should be unchecked', () => {
32
+ utilities.verifyInnerText(shortTextResponsePage.displayCharacterCountLabel(), 'Display character count');
33
+ utilities.verifyElementVisibilityState(shortTextResponsePage.displayCharacterCountLabel(), 'visible');
34
+ utilities.verifyInnerText(shortTextResponsePage.displayWordCountLabel(), 'Display word count');
35
+ utilities.verifyElementVisibilityState(shortTextResponsePage.displayWordCountLabel(), 'visible');
36
+ utilities.verifyElementVisibilityState(shortTextResponsePage.displayWordCountCheckbox(), 'exist');
37
+ utilities.verifyElementVisibilityState(shortTextResponsePage.displayCharacterCountCheckbox(), 'exist');
38
+ shortTextResponsePage.steps.verifyDisplayWordCountCheckboxUnchecked();
39
+ shortTextResponsePage.steps.verifyDisplayCharacterCountCheckboxUnchecked();
40
+ });
41
+
42
+ it('When \'Character\' is selected in set limit section by default, then \'Display character count\' should be enabled and \'Display word count\' should be disabled', () => {
43
+ shortTextResponsePage.steps.verifyCharacterRadioButtonSelected();
44
+ utilities.verifyElementNotDisabled(shortTextResponsePage.displayCharacterCountLabel());
45
+ utilities.verifyElementDisabledClass(shortTextResponsePage.displayWordCountLabel());
46
+ });
47
+
48
+ it('User should be able to check \'Display character count\' checkbox', () => {
49
+ shortTextResponsePage.steps.checkDisplayCharacterCountCheckbox();
50
+ });
51
+
52
+ it('When user selects \'Word\' in set Count section, then \'Display character count\' should be disabled and \'Display word count\' should be enabled', () => {
53
+ shortTextResponsePage.steps.selectWordRadioButton();
54
+ utilities.verifyElementNotDisabled(shortTextResponsePage.displayWordCountLabel());
55
+ utilities.verifyElementDisabledClass(shortTextResponsePage.displayCharacterCountLabel());
56
+ });
57
+
58
+ it('User should be able to check \'Display word count\' checkbox', () => {
59
+ shortTextResponsePage.steps.checkDisplayWordCountCheckbox();
60
+ });
61
+
62
+ it('\'Spell check\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
63
+ utilities.verifyInnerText(shortTextResponsePage.spellCheckLabel(), 'Spell check');
64
+ utilities.verifyElementVisibilityState(shortTextResponsePage.spellCheckLabel(), 'visible');
65
+ utilities.verifyElementVisibilityState(shortTextResponsePage.spellCheckCheckbox(), 'exist');
66
+ shortTextResponsePage.steps.verifySpellCheckCheckboxUnchecked();
67
+ });
68
+
69
+ it('User should be able to check \'Spell check\' checkbox', () => {
70
+ shortTextResponsePage.steps.checkSpellCheckCheckbox();
71
+ });
72
+
73
+ it('\'Auto scale the response field height (no scrolling)\' label and checkbox should be displayed and by default checkbox should be unchecked', () => {
74
+ utilities.verifyInnerText(shortTextResponsePage.autoScaleTheResponseFieldHeightLabel(), 'Auto scale the response field height (no scrolling)');
75
+ utilities.verifyElementVisibilityState(shortTextResponsePage.autoScaleTheResponseFieldHeightLabel(), 'visible');
76
+ utilities.verifyElementVisibilityState(shortTextResponsePage.autoScaleTheResponseFieldHeightCheckbox(), 'exist');
77
+ shortTextResponsePage.steps.verifyAutoScaleTheResponseFieldHeightCheckboxUnchecked();
78
+ });
79
+
80
+ it('User should be able to check \'Auto scale the response field height (no scrolling)\' checkbox', () => {
81
+ shortTextResponsePage.steps.checkAutoScaleTheResponseFieldHeightCheckbox();
82
+ });
83
+
84
+ it('\'Allow student to check answer\' label and checkbox should be displayed and it should be unchecked by default', () => {
85
+ utilities.verifyInnerText(shortTextResponsePage.allowStudentToCheckAnswerLabel(), 'Allow student to check answer');
86
+ shortTextResponsePage.steps.verifyAllowStudentsToCheckAnswerCheckboxUnchecked();
87
+ });
88
+
89
+ it('When the user checks the \'Allow student to check answer\' checkbox, then \'Maximum check answer attempts\' dropdown should be displayed', () => {
90
+ shortTextResponsePage.steps.checkAllowStudentsToCheckAnswerCheckbox();
91
+ utilities.verifyElementVisibilityState(shortTextResponsePage.maximumCheckAnswerAttemptsDropdown(), 'visible');
92
+ });
93
+
94
+ shortTextResponsePage.tests.verifyMaxCheckAnswerAttemptsDropdown();
95
+
96
+ shortTextResponsePage.tests.verifyAllowStudentsToCheckAnswerContentsCSSAndA11y();
97
+
98
+ it('CSS of student view settings section', { tags: 'css' }, () => {
99
+ utilities.verifyCSS(shortTextResponsePage.acceptedStudentInputLabel(), {
100
+ 'color': css.color.labels,
101
+ 'font-size': css.fontSize.normal,
102
+ 'font-weight': css.fontWeight.semibold
103
+ });
104
+ labels.forEach((label) => {
105
+ utilities.verifyCSS(label(), {
106
+ 'color': css.color.labelText,
107
+ 'font-size': css.fontSize.normal,
108
+ 'font-weight': css.fontWeight.regular
109
+ });
110
+ });
111
+ checkboxes.forEach((checkbox) => {
112
+ utilities.verifyCSS(checkbox().parent().find('.checkbox-icon-border-rect'), {
113
+ 'fill': css.color.activeButtons
114
+ });
115
+ });
116
+ utilities.verifyCSS(shortTextResponsePage.displayCharacterCountLabel().parents('label'), {
117
+ 'opacity': '0.4'
118
+ });
119
+ utilities.verifyCSS(shortTextResponsePage.displayCharacterCountLabel(), {
120
+ 'color': css.color.labelText,
121
+ 'font-size': css.fontSize.normal,
122
+ 'font-weight': css.fontWeight.regular
123
+ });
124
+ });
125
+
126
+ it('Accessibility of student view settings section', { tags: 'a11y' }, () => {
127
+ cy.checkAccessibility(shortTextResponsePage.spellCheckLabel().parents('.student-view-settings-container'));
128
+ });
129
+ });
130
+
131
+ describe('Student view settings : Display character count, Display word count - Preview tab functionality', () => {
132
+ abortEarlySetup();
133
+ before(() => {
134
+ cy.log('Navigating to drawing response question type');
135
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
136
+ cy.barsPreLoaderWait();
137
+ shortTextResponsePage.steps.switchToPreviewTab();
138
+ });
139
+
140
+ it('When \'Display character count\' checkbox is unchecked, then \'Character\' label and count should not be displayed in preview tab', () => {
141
+ shortTextResponsePage.steps.verifyDisplayCharacterCountCheckboxUnchecked();
142
+ shortTextResponsePage.steps.switchToPreviewTab();
143
+ utilities.verifyElementVisibilityState(shortTextResponsePage.characterWordCountLabelPreviewTab(), 'hidden');
144
+ });
145
+
146
+ it('When \'Display character count\' checkbox is checked, then on switching to preview tab \'Character\' label and count should be displayed and count should be zero by default', () => {
147
+ shortTextResponsePage.steps.switchToEditTab();
148
+ shortTextResponsePage.steps.checkDisplayCharacterCountCheckbox();
149
+ shortTextResponsePage.steps.switchToPreviewTab();
150
+ utilities.verifyInnerText(shortTextResponsePage.characterWordCountLabelPreviewTab(), 'Characters: 0');
151
+ utilities.verifyElementVisibilityState(shortTextResponsePage.characterWordCountLabelPreviewTab(), 'visible');
152
+ });
153
+
154
+ it('When user enters text in response field, then character count should be updated', () => {
155
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flowers are blooming');
156
+ utilities.verifyInnerText(shortTextResponsePage.characterWordCountLabelPreviewTab(), 'Characters: 20');
157
+ });
158
+
159
+ it('When user selects word in set limit section and checks \'Display word count\' checkbox , then \'Word\' label and count should be displayed in preview tab', () => {
160
+ shortTextResponsePage.steps.switchToEditTab();
161
+ shortTextResponsePage.steps.selectWordRadioButton();
162
+ shortTextResponsePage.steps.checkDisplayWordCountCheckbox();
163
+ shortTextResponsePage.steps.switchToPreviewTab();
164
+ utilities.verifyInnerText(shortTextResponsePage.characterWordCountLabelPreviewTab(), 'Words: 0');
165
+ utilities.verifyElementVisibilityState(shortTextResponsePage.characterWordCountLabelPreviewTab(), 'visible');
166
+ });
167
+
168
+ it('When user enters text in response field, then character count should be updated', () => {
169
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flowers are blooming');
170
+ utilities.verifyInnerText(shortTextResponsePage.characterWordCountLabelPreviewTab(), 'Words: 3');
171
+ });
172
+ });
173
+
174
+ describe('Student view settings : Spell check - Specify correct answer section', () => {
175
+ abortEarlySetup();
176
+ before(() => {
177
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
178
+ cy.barsPreLoaderWait();
179
+ });
180
+
181
+ it('When the \'Spell check\' functionality is disabled, the response field should have \'spellcheck\' attribute set as \'false\' in specify correct answer section', () => {
182
+ shortTextResponsePage.steps.verifySpellCheckOfResponseFieldDisabledSpecifyCorrectAnswerSection();
183
+ });
184
+
185
+ it('When the \'Spell check\' functionality is enabled, the response field should have \'spellcheck\' attribute set as \'true\' in specify correct answer section', () => {
186
+ shortTextResponsePage.steps.checkSpellCheckCheckbox();
187
+ shortTextResponsePage.steps.verifySpellCheckOfResponseFieldEnabledSpecifyCorrectAnswerSection();
188
+ });
189
+ });
190
+
191
+ describe('Student view settings : Spell check - Preview tab functionality', () => {
192
+ abortEarlySetup();
193
+ before(() => {
194
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
195
+ cy.barsPreLoaderWait();
196
+ shortTextResponsePage.steps.switchToPreviewTab();
197
+ });
198
+
199
+ it('When the \'Spell check\' functionality is disabled, the response field should have \'spellcheck\' attribute set as \'false\' in preview tab', () => {
200
+ shortTextResponsePage.steps.verifySpellCheckOfResponseFieldPreviewTabDisabled();
201
+ });
202
+
203
+ it('When the \'Spell check\' functionality is enabled, the response field should have \'spellcheck\' attribute set as \'true\' in the preview tab', () => {
204
+ shortTextResponsePage.steps.switchToEditTab();
205
+ shortTextResponsePage.steps.checkSpellCheckCheckbox();
206
+ shortTextResponsePage.steps.switchToPreviewTab();
207
+ shortTextResponsePage.steps.verifySpellCheckOfResponseFieldPreviewTabEnabled();
208
+ });
209
+ });
210
+
211
+ describe('Student view settings : Auto scale the response field height (no scrolling) - Specify correct answer section', () => {
212
+ abortEarlySetup();
213
+ before(() => {
214
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
215
+ cy.barsPreLoaderWait();
216
+ shortTextResponsePage.steps.allotPoints(10);
217
+ shortTextResponsePage.steps.selectWordRadioButton();
218
+ shortTextResponsePage.steps.setMaximumLimit(50);
219
+ });
220
+
221
+ it('When the \'Auto scale the response field height (no scrolling)\' checkbox is unchecked, then entering long text into the input field should display the entire text in the response input field on a single scrollable line and height of the response input field should remain unchanged in specify correct answer section', () => {
222
+ shortTextResponsePage.steps.verifyAutoScaleTheResponseFieldHeightCheckboxUnchecked();
223
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('As the sun dipped below the horizon, casting a warm glow across the landscape, the travelers gathered around the crackling campfire, swapping stories of their adventures under the starlit sky.');
224
+ shortTextResponsePage.steps.verifyAutoScaleHeightOfResponseFieldFunctionalitySpecifyCorrectAnswerSection('Disabled');
225
+ });
226
+
227
+ it('When \'Auto scale the response field height (no scrolling)\' checkbox is checked, then entering a long text in the input field should display the entire text in the response input field, and the height of the response input field should automatically resize according to the entered text in specify correct answer section.', () => {
228
+ shortTextResponsePage.steps.checkAutoScaleTheResponseFieldHeightCheckbox();
229
+ shortTextResponsePage.steps.verifyAutoScaleHeightOfResponseFieldFunctionalitySpecifyCorrectAnswerSection('Enabled');
230
+ });
231
+ });
232
+
233
+ describe('Student view settings : Auto scale the response field height (no scrolling) - Preview tab functionality', () => {
234
+ abortEarlySetup();
235
+ before(() => {
236
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
237
+ cy.barsPreLoaderWait();
238
+ shortTextResponsePage.steps.allotPoints(10);
239
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct');
240
+ shortTextResponsePage.steps.selectWordRadioButton();
241
+ shortTextResponsePage.steps.setMaximumLimit(50);
242
+ });
243
+
244
+ it('When the \'Auto scale the response field height (no scrolling)\' checkbox is unchecked, then entering long text into the input field should display the entire text in the response input field on a single scrollable line and height of the response input field should remain unchanged in the preview tab', () => {
245
+ shortTextResponsePage.steps.verifyAutoScaleTheResponseFieldHeightCheckboxUnchecked();
246
+ shortTextResponsePage.steps.switchToPreviewTab();
247
+ shortTextResponsePage.steps.verifyAutoScaleHeightOfResponseFieldFunctionalityPreviewTab('Disabled');
248
+ });
249
+
250
+ it('When \'Auto scale the response field height (no scrolling)\' checkbox is checked, then entering a long text in the input field should display the entire text in the response input field, and the height of the response input field should automatically resize according to the entered text in the preview tab.', () => {
251
+ shortTextResponsePage.steps.switchToEditTab();
252
+ shortTextResponsePage.steps.checkAutoScaleTheResponseFieldHeightCheckbox();
253
+ shortTextResponsePage.steps.switchToPreviewTab();
254
+ shortTextResponsePage.steps.verifyAutoScaleHeightOfResponseFieldFunctionalityPreviewTab('Enabled');
255
+ });
256
+ });
257
+
258
+ describe('Allow students to check answer: Preview tab', () => {
259
+ abortEarlySetup();
260
+ before(() => {
261
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
262
+ cy.barsPreLoaderWait();
263
+ shortTextResponsePage.steps.allotPoints(10);
264
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct');
265
+ });
266
+
267
+ it('When the user has specified correct answer and points then on checking the \'Allow students to check answer\' checkbox the Check answer button should be displayed in the preview tab', () => {
268
+ shortTextResponsePage.steps.checkAllowStudentToCheckAnswerCheckbox();
269
+ shortTextResponsePage.steps.switchToPreviewTab();
270
+ utilities.verifyInnerText(shortTextResponsePage.checkAnswerButton(), 'Check answer');
271
+ });
272
+
273
+ it('When the user enters answer in response field and checks the answer then correct icon should be displayed beside the response field and the check answer button should be in enabled state', () => {
274
+ shortTextResponsePage.steps.switchToPreviewTab();
275
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Correct');
276
+ shortTextResponsePage.steps.checkAnswer();
277
+ shortTextResponsePage.steps.verifyCorrectIcon();
278
+ shortTextResponsePage.steps.verifyCheckAnswerButtonEnabled();
279
+ });
280
+
281
+ it('When the user selects an option from the Maximum check answer attempts dropdown then the user should be able to check answer only those many times in the preview tab', () => {
282
+ shortTextResponsePage.steps.switchToEditTab();
283
+ shortTextResponsePage.steps.expandMaxCheckAnswerAttemptsDropdown();
284
+ shortTextResponsePage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('1');
285
+ shortTextResponsePage.steps.switchToPreviewTab();
286
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower');
287
+ shortTextResponsePage.steps.checkAnswer();
288
+ shortTextResponsePage.steps.verifyCheckAnswerButtonDisabled();
289
+ });
290
+
291
+ it('When the user reaches maximum check answer attempts, then the \'Check Answer\' button should become disabled', () => {
292
+ utilities.verifyElementDisabled(shortTextResponsePage.checkAnswerButton());
293
+ });
294
+
295
+ it('CSS of disabled \'Check Answer\' button', { tags: 'css' }, () => {
296
+ utilities.verifyCSS(shortTextResponsePage.checkAnswerButton(), {
297
+ 'color': css.color.primaryBtnDisabled,
298
+ 'font-size': css.fontSize.default,
299
+ 'font-weight': css.fontWeight.semibold
300
+ });
301
+ });
302
+
303
+ it('Accessibility of disabled Check Answer button', { tags: 'a11y' }, () => {
304
+ cy.checkAccessibility(shortTextResponsePage.checkAnswerButton().parents('.check-answer-and-status-wrapper'));
305
+ });
306
+
307
+ it('When the user updates the value of \'Maximum check answer attempts\' dropdown, it should get reflected on the Preview tab', () => {
308
+ shortTextResponsePage.steps.switchToEditTab();
309
+ shortTextResponsePage.steps.expandMaxCheckAnswerAttemptsDropdown();
310
+ shortTextResponsePage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('3');
311
+ shortTextResponsePage.steps.switchToPreviewTab();
312
+ shortTextResponsePage.steps.verifyCheckAnswerButtonEnabled();
313
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower');
314
+ shortTextResponsePage.steps.checkAnswer();
315
+ shortTextResponsePage.steps.verifyCheckAnswerButtonEnabled();
316
+ });
317
+
318
+ it('When the user selects \'No limit\' option from the dropdown then user should be able to check answer multiple times', () => {
319
+ shortTextResponsePage.steps.switchToEditTab();
320
+ shortTextResponsePage.steps.expandMaxCheckAnswerAttemptsDropdown();
321
+ shortTextResponsePage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('no limit');
322
+ shortTextResponsePage.steps.switchToPreviewTab();
323
+ shortTextResponsePage.steps.verifyCheckAnswerButtonEnabled();
324
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower');
325
+ shortTextResponsePage.steps.checkAnswer();
326
+ shortTextResponsePage.steps.verifyCheckAnswerButtonEnabled();
327
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Correct');
328
+ shortTextResponsePage.steps.checkAnswer();
329
+ shortTextResponsePage.steps.verifyCheckAnswerButtonEnabled();
330
+ });
331
+ });
332
+ });
@@ -158,10 +158,7 @@ describe('Create Item page - Single selection: Student view settings', () => {
158
158
  singleSelectionPage.steps.allotPoints(20);
159
159
  });
160
160
 
161
- it('\'Allow student to check answer\' label and checkbox should be displayed and it should be unchecked by default', () => {
162
- utilities.verifyInnerText(singleSelectionPage.allowStudentToCheckAnswerLabel(), 'Allow student to check answer');
163
- singleSelectionPage.steps.verifyAllowStudentsToCheckAnswerCheckboxUnchecked();
164
- });
161
+ singleSelectionPage.tests.verifyAllowStudentsToCheckAnswerLabelAndCheckboxCSS();
165
162
 
166
163
  it('When user checks the \'Allow student to check answer\' checkbox then \'Disable previous incorrect options\' checkbox and \'Maximum check answer attempts\' dropdown should be displayed', () => {
167
164
  singleSelectionPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
@@ -178,14 +175,7 @@ describe('Create Item page - Single selection: Student view settings', () => {
178
175
  singleSelectionPage.steps.checkDisablePreviousIncorrectOptionCheckbox();
179
176
  });
180
177
 
181
- it('\'Maximum check answer attempts\' should have \'No limit\' selected by default and on expanding the dropdown options 1 to 10 should also be displayed', () => {
182
- utilities.verifyInnerText(singleSelectionPage.maximumCheckAnswerAttemptsDropdownLabel(), 'Maximum check answer attempts');
183
- utilities.verifyInnerText(singleSelectionPage.maximumCheckAnswerAttemptsDropdown(), maxCheckAnswerAttemptsOptions[0]);
184
- singleSelectionPage.steps.expandMaxCheckAnswerAttemptsDropdown();
185
- maxCheckAnswerAttemptsOptions.forEach((option, index) => {
186
- utilities.verifyInnerText(utilities.getNthElement(singleSelectionPage.maximumCheckAnswerAttemptsDropdownListOptions(), index), option)
187
- });
188
- });
178
+ singleSelectionPage.tests.verifyMaxCheckAnswerAttemptsDropdown();
189
179
 
190
180
  it('CSS of \'Allow students to check answer\' section', { tags: 'css' }, () => {
191
181
  utilities.verifyCSS(singleSelectionPage.allowStudentToCheckAnswerLabel(), {
@@ -57,7 +57,7 @@ describe('Create item page - Text entry math: Question instructions, Add structu
57
57
 
58
58
  it('The user should be able to edit text in the question input field', () => {
59
59
  textEntryMathPage.steps.addInputToQuestionInputField('Lorem Ipsum');
60
- utilities.verifyInnerText(textEntryMathPage.questionInputField(), '1Responseclose2Responseclose​​​​​​​Lorem Ipsum');
60
+ utilities.verifyInnerText(textEntryMathPage.questionInputField(), '1Response\nclose\n2Response\nclose\n​​​​​​​Lorem Ipsum\n');
61
61
  });
62
62
 
63
63
  it('When the user focuses in the question input field, the CKEditor toolbar should be displayed with a \'+Response\' button and when the user clicks on \'+Response\' button, then a response token should be added in the question input field', () => {
@@ -95,13 +95,13 @@ describe('Create item page - Text entry math: Question instructions, Add structu
95
95
  });
96
96
  utilities.verifyCSS(textEntryMathPage.questionInputField(), {
97
97
  'color': css.color.text,
98
- 'font-size': css.fontSize.normal,
98
+ 'font-size': css.fontSize.default,
99
99
  'font-weight': css.fontWeight.regular
100
100
  });
101
101
  utilities.verifyCSS(textEntryMathPage.responseTokenNumeration(), {
102
102
  'color': css.color.text,
103
103
  'font-size': css.fontSize.default,
104
- 'font-weight': css.fontWeight.semibold
104
+ 'font-weight': css.fontWeight.regular
105
105
  });
106
106
  utilities.verifyCSS(textEntryMathPage.responseTokenResponseLabel(), {
107
107
  'color': css.color.text,
@@ -182,29 +182,30 @@ describe('Create item page - Text entry math: Question instructions, Add structu
182
182
  });
183
183
 
184
184
  it('The default question input field content should be displayed in the preview tab question', () => {
185
- utilities.verifyInnerText(textEntryMathPage.questionContainerPreviewTab(), 'This is Dummy \n\n\n\n\nand\n\n\n\n\n.');
186
- utilities.verifyElementCount(textEntryMathPage.responseFieldPreviewTab(), 2);
185
+ utilities.verifyInnerText(textEntryMathPage.questionContainerPreviewTab(), '');
186
+ utilities.verifyElementCount(textEntryMathPage.responseFieldPreviewTab(), 0);
187
187
  });
188
188
 
189
189
  it('When user edits the question input field in edit tab, then the changes should be reflected in preview tab', () => {
190
190
  textEntryMathPage.steps.switchToEditTab();
191
191
  textEntryMathPage.steps.addInputToQuestionInputField('Lorem Ipsum');
192
192
  textEntryMathPage.steps.switchToPreviewTab();
193
- utilities.verifyInnerText(textEntryMathPage.questionContainerPreviewTab(), 'This is Dummy \n\n\n\n\nand\n\n\n\n\n.Lorem Ipsum');
193
+ utilities.verifyInnerText(textEntryMathPage.questionContainerPreviewTab(), 'Lorem Ipsum');
194
194
  });
195
195
 
196
196
  it('When the user adds a response token in the question input field, then in preview tab the additional response field should be displayed', () => {
197
197
  textEntryMathPage.steps.switchToEditTab();
198
198
  textEntryMathPage.steps.addResponseToken();
199
+ textEntryMathPage.steps.addResponseToken();
199
200
  textEntryMathPage.steps.switchToPreviewTab();
200
- utilities.verifyElementCount(textEntryMathPage.responseFieldPreviewTab(), 3);
201
+ utilities.verifyElementCount(textEntryMathPage.responseFieldPreviewTab(), 2);
201
202
  });
202
203
 
203
204
  it('When the user removes a response token in the question input field, then in preview tab response field should also be removed', () => {
204
205
  textEntryMathPage.steps.switchToEditTab();
205
206
  textEntryMathPage.steps.deleteAResponseToken(0);
206
207
  textEntryMathPage.steps.switchToPreviewTab();
207
- utilities.verifyElementCount(textEntryMathPage.responseFieldPreviewTab(), 2);
208
+ utilities.verifyElementCount(textEntryMathPage.responseFieldPreviewTab(), 1);
208
209
  });
209
210
  });
210
211
  });
@@ -120,12 +120,12 @@ describe('Create item page - Text entry math: Scoring section', () => {
120
120
  utilities.verifyCSS(textEntryMathPage.responseAccordionPointsLabel(), {
121
121
  'color': css.color.labels,
122
122
  'font-size': css.fontSize.normal,
123
- 'font-weight': css.fontWeight.semibold
123
+ 'font-weight': css.fontWeight.regular
124
124
  });
125
125
  utilities.verifyCSS(textEntryMathPage.responseAccordionPointsScore(), {
126
- 'color': css.color.text,
127
- 'font-size': css.fontSize.default,
128
- 'font-weight': css.fontWeight.regular
126
+ 'color': css.color.labels,
127
+ 'font-size': css.fontSize.normal,
128
+ 'font-weight': css.fontWeight.bold
129
129
  });
130
130
  });
131
131
  });
@@ -14,6 +14,8 @@ describe('Create item page - Text entry math: Minimum scoring, Penalty scoring,
14
14
  before(() => {
15
15
  textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
16
16
  cy.barsPreLoaderWait();
17
+ textEntryMathPage.steps.addResponseToken();
18
+ textEntryMathPage.steps.addResponseToken();
17
19
  textEntryMathPage.steps.allotPoints(10);
18
20
  });
19
21
 
@@ -29,6 +31,8 @@ describe('Create item page - Text entry math: Minimum scoring, Penalty scoring,
29
31
  before(() => {
30
32
  textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
31
33
  cy.barsPreLoaderWait();
34
+ textEntryMathPage.steps.addResponseToken();
35
+ textEntryMathPage.steps.addResponseToken();
32
36
  textEntryMathPage.steps.allotPoints(10);
33
37
  textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
34
38
  textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
@@ -48,7 +52,7 @@ describe('Create item page - Text entry math: Minimum scoring, Penalty scoring,
48
52
  textEntryMathPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect option');
49
53
  utilities.verifyInnerText(textEntryMathPage.automaticallySetPenaltyPointsCheckboxLabel(), 'Automatically set penalty for each incorrect option to total points / no. of incorrect options');
50
54
  utilities.verifyInnerText(textEntryMathPage.specifyTotalPenaltyPointsRadioButtonLabel(), 'Specify total penalty points');
51
- utilities.verifyInnerText(textEntryMathPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), 'Specify points for each incorrect option');
55
+ utilities.verifyInnerText(textEntryMathPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), 'Specify points for each incorrect option');
52
56
  textEntryMathPage.steps.verifyAutomaticallySetPenaltyPointsCheckboxUncheckedState();
53
57
  textEntryMathPage.steps.verifySpecifyTotalPenaltyPointsRadioButtonCheckedState();
54
58
  textEntryMathPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonUncheckedState();
@@ -80,7 +84,7 @@ describe('Create item page - Text entry math: Minimum scoring, Penalty scoring,
80
84
  it('CSS of the penalty points section - Total penalty points', { tags: 'css' }, () => {
81
85
  utilities.verifyCSS(textEntryMathPage.automaticallySetPenaltyPointsCheckboxLabel(), {
82
86
  'color': css.color.labelText,
83
- 'font-size': css.fontSize.default,
87
+ 'font-size': css.fontSize.regular,
84
88
  'font-weight': css.fontWeight.regular
85
89
  });
86
90
  utilities.verifyCSS(textEntryMathPage.automaticallySetPenaltyPointsCheckbox().parent().find('svg'), {
@@ -191,6 +195,8 @@ describe('Create item page - Text entry math: Minimum scoring, Penalty scoring,
191
195
  before(() => {
192
196
  textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
193
197
  cy.barsPreLoaderWait();
198
+ textEntryMathPage.steps.addResponseToken();
199
+ textEntryMathPage.steps.addResponseToken();
194
200
  textEntryMathPage.steps.allotPoints(10);
195
201
  textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
196
202
  });
@@ -1,5 +1,6 @@
1
1
  import { textEntryMathPage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
3
4
 
4
5
  describe('Create Item page - Text entry math: Specify correct answer, Alternative correct answer', () => {
5
6
  before(() => {
@@ -25,8 +26,10 @@ describe('Create Item page - Text entry math: Specify correct answer, Alternativ
25
26
  cy.log('Navigating to Text entry math question type');
26
27
  textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
27
28
  cy.barsPreLoaderWait();
29
+ textEntryMathPage.steps.addResponseToken();
30
+ textEntryMathPage.steps.addResponseToken();
28
31
  });
29
-
32
+
30
33
  textEntryMathPage.tests.verifyAutoScoredAddAlternativeAnswerButtonAndValidation('text entry math');
31
34
 
32
35
  it('When user has added points and given input in response accordion answer input field in the \'Correct\' accordion, then the user should be able to add alternative answer for the question using \'Add alternative answer\' button', () => {
@@ -59,7 +62,7 @@ describe('Create Item page - Text entry math: Specify correct answer, Alternativ
59
62
  textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(1, 'a-b');
60
63
  textEntryMathPage.steps.allotPoints(5);
61
64
  textEntryMathPage.steps.deleteAlternativeAnswerAccordion(1);
62
- textEntryMathPage.steps.verifyAlternativeAnswerAccordionNotExists(2);
65
+ utilities.verifyElementVisibilityState(textEntryMathPage.alternativeAnswerAccordion().contains('Alternative 2'), 'notExist');
63
66
  textEntryMathPage.steps.verifyAlternativeAnswerAccordionLabel(1);
64
67
  });
65
68