itemengine-cypress-automation 1.0.120 → 1.0.122-updateILCRepo28Feb-2c3e0e3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) 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/fixtures/theme/ilc.json +3 -1
  71. package/cypress/pages/audioResponsePage.js +2 -1
  72. package/cypress/pages/components/additionalSettingsPanel.js +27 -0
  73. package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
  74. package/cypress/pages/components/autoScoredScoringSection.js +1 -1
  75. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
  76. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  77. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
  78. package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
  79. package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
  80. package/cypress/pages/components/createQuestionBasePage.js +8 -2
  81. package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
  82. package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
  83. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
  84. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
  85. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
  86. package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
  87. package/cypress/pages/components/index.js +3 -3
  88. package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
  89. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
  90. package/cypress/pages/components/questionInputFieldComponent.js +49 -23
  91. package/cypress/pages/components/scoringSectionBase.js +1 -1
  92. package/cypress/pages/createItemPage.js +67 -2
  93. package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
  94. package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
  95. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
  96. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
  97. package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
  98. package/cypress/pages/fillInTheGapsTextPage.js +52 -199
  99. package/cypress/pages/index.js +5 -5
  100. package/cypress/pages/multipleSelectionPage.js +1 -0
  101. package/cypress/pages/shortTextResponsePage.js +575 -33
  102. package/cypress/pages/singleSelectionGridPage.js +1 -2
  103. package/cypress/pages/singleSelectionPage.js +5 -6
  104. package/cypress/pages/textEntryMathPage.js +46 -22
  105. package/cypress/pages/textEntryMathWithImagePage.js +212 -0
  106. package/cypress/pages/uploadResponsePage.js +74 -21
  107. package/package.json +2 -2
  108. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
  109. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
  110. package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
  111. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
  112. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
  113. package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
  114. package/cypress/pages/fillInTheGapsScoring.js +0 -5872
  115. package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -0,0 +1,233 @@
1
+ import { shortTextResponsePage } from "../../../pages";
2
+ import utilities from "../../../support/helpers/utilities";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create Item page - Short text response ', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Answer input field verification: Edit tab functionality', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ it('\'Answer\' label and one empty input field should be displayed', () => {
19
+ utilities.verifyInnerText(shortTextResponsePage.answerLabelSpecifyCorrectAnswerSection(), 'Answer');
20
+ utilities.verifyElementVisibilityState(shortTextResponsePage.answerLabelSpecifyCorrectAnswerSection(), 'visible');
21
+ utilities.verifyInnerText(shortTextResponsePage.answerInputFieldSpecifyCorrectAnswerSection(), '');
22
+ utilities.verifyElementVisibilityState(shortTextResponsePage.answerInputFieldSpecifyCorrectAnswerSection(), 'visible');
23
+ utilities.verifyElementCount(shortTextResponsePage.answerInputFieldSpecifyCorrectAnswerSection(), 1);
24
+ });
25
+
26
+ it('CSS of answer input field', { tags: 'css' }, () => {
27
+ utilities.verifyCSS(shortTextResponsePage.answerLabelSpecifyCorrectAnswerSection(), {
28
+ 'color': css.color.labels,
29
+ 'font-size': css.fontSize.normal,
30
+ 'font-weight': css.fontWeight.semibold,
31
+ });
32
+ utilities.verifyCSS(shortTextResponsePage.answerInputFieldSpecifyCorrectAnswerSection(), {
33
+ 'color': css.color.text,
34
+ 'font-size': css.fontSize.default,
35
+ 'font-weight': css.fontWeight.regular,
36
+ });
37
+ });
38
+
39
+ it('Accessibility of response accordion', { tags: 'a11y' }, () => {
40
+ cy.checkAccessibility(shortTextResponsePage.answerInputFieldSpecifyCorrectAnswerSection().parents('.correct-answer-accordion'));
41
+ });
42
+ });
43
+
44
+ describe('Accepted student input - Specify correct answer section', () => {
45
+ abortEarlySetup();
46
+ before(() => {
47
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
48
+ cy.barsPreLoaderWait();
49
+ shortTextResponsePage.steps.allotPoints(5);
50
+ });
51
+
52
+ it('When \'Text\' is selected in accepted student input, then user should be able to enter alphanumeric characters and special symbols in the answer input field', () => {
53
+ shortTextResponsePage.steps.verifyAcceptedStudentTypeActiveButton(0, 'Text');
54
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Hi23(^^)');
55
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('Hi23(^^)');
56
+ });
57
+
58
+ it('When user selects \'Number\' in accepted student input, then text inside the answer input field should only include numbers part from the previously entered input', () => {
59
+ shortTextResponsePage.steps.selectAcceptedStudentInputType(0, 'Number');
60
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('23');
61
+ });
62
+
63
+ it('User should not be able to enter characters or special symbols i.e. answer input field should only contain numbers', () => {
64
+ shortTextResponsePage.steps.clearSpecifyCorrectAnswerInputField();
65
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('ABc^12');
66
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('12');
67
+ });
68
+
69
+ it('User should be able to enter negative numbers, decimal numbers and zero in answer input field', () => {
70
+ shortTextResponsePage.steps.clearSpecifyCorrectAnswerInputField();
71
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('-5');
72
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('-5');
73
+ shortTextResponsePage.steps.clearSpecifyCorrectAnswerInputField();
74
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('29.54');
75
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('29.54');
76
+ shortTextResponsePage.steps.clearSpecifyCorrectAnswerInputField();
77
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('0');
78
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('0');
79
+ });
80
+
81
+ it('When user selects \'Integer\' in accepted student input, then text inside the answer input field should only include whole numbers part from the previously entered input', () => {
82
+ shortTextResponsePage.steps.selectAcceptedStudentInputType(0, 'Integer');
83
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('2954');
84
+ });
85
+
86
+ it('When \'Integer\' is selected in accepted student input, then user should not be able to add characters or special symbols i.e. input field should only include whole numbers', () => {
87
+ shortTextResponsePage.steps.clearSpecifyCorrectAnswerInputField();
88
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('29hi*5k4.5');
89
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('29545');
90
+ });
91
+
92
+ it('User should be able to add zero in input field', () => {
93
+ shortTextResponsePage.steps.clearSpecifyCorrectAnswerInputField();
94
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('0');
95
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('0');
96
+ });
97
+
98
+ it('User should not be able to add negative number i.e. input field should only include positive whole numbers', () => {
99
+ shortTextResponsePage.steps.clearSpecifyCorrectAnswerInputField();
100
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('-44');
101
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('44');
102
+ });
103
+
104
+ it('When user selects \'Text\' in accepted student input again, then answer input field should contain text from previously added input', () => {
105
+ shortTextResponsePage.steps.selectAcceptedStudentInputType(0, 'Text');
106
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('44');
107
+ });
108
+
109
+ it('When user adds alternate answer input field, then accepted student input should be applied on both the response answer input fields in the response accordion', () => {
110
+ shortTextResponsePage.steps.addAlternativeAnswerAccordion(1);
111
+ shortTextResponsePage.steps.clearSpecifyCorrectAnswerInputField();
112
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Hi12');
113
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('Hi12');
114
+ });
115
+ });
116
+
117
+ describe('Accepted student input - Preview tab functionality', () => {
118
+ abortEarlySetup();
119
+ before(() => {
120
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
121
+ cy.barsPreLoaderWait();
122
+ });
123
+
124
+ it('When \'Text\' is selected in accepted student input in edit tab, then user should be able to enter alphanumeric characters and special symbols in the preview tab', () => {
125
+ shortTextResponsePage.steps.verifyAcceptedStudentTypeActiveButton(0, 'Text');
126
+ shortTextResponsePage.steps.switchToPreviewTab();
127
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower23^^');
128
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('Flower23^^');
129
+ });
130
+
131
+ it('When user enters numerical values in the response input field, then warning message \'Only text can be typed.\' should appear', () => {
132
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('23');
133
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('');
134
+ shortTextResponsePage.steps.verifyWarningMessage('Only text can be typed.');
135
+ });
136
+
137
+ it('CSS of warning message', { tags: 'css' }, () => {
138
+ utilities.verifyCSS(shortTextResponsePage.warningMessage(), {
139
+ 'color': css.color.warningMessage,
140
+ 'font-size': css.fontSize.normal,
141
+ 'font-weight': css.fontWeight.regular
142
+ });
143
+ utilities.verifyCSS(shortTextResponsePage.warningMessageContainer().find('svg'), {
144
+ 'color': css.color.warningMessage,
145
+ });
146
+ utilities.verifyCSS(shortTextResponsePage.warningMessageContainer(), {
147
+ 'border': `1px solid ${css.color.warningContainerBorder}`
148
+ });
149
+ utilities.verifyCSS(shortTextResponsePage.warningMessageContainer(), {
150
+ 'background-color': css.color.warningContainerBackground
151
+ });
152
+ });
153
+
154
+ it('Accessibility of error message', { tags: 'a11y' }, () => {
155
+ cy.checkAccessibility(shortTextResponsePage.warningMessage());
156
+ });
157
+
158
+ it('When user enters alphanumeric text in response field then warning message should disappear', () => {
159
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Alphanumeric text');
160
+ shortTextResponsePage.steps.focusOutOfResponseInputFieldPreviewTab();
161
+ shortTextResponsePage.steps.verifyWarningMessageNotExist();
162
+ });
163
+
164
+ it('When user selects \'Number\' in accepted student input in edit tab, then user should be able to enter numbers inside response input field in preview tab', () => {
165
+ shortTextResponsePage.steps.switchToEditTab();
166
+ shortTextResponsePage.steps.selectAcceptedStudentInputType(0, 'Number');
167
+ shortTextResponsePage.steps.switchToPreviewTab();
168
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('232&');
169
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('232');
170
+ });
171
+
172
+ it('User should be able to enter decimal numbers inside response input field in preview tab', () => {
173
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('23.2');
174
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('23.2');
175
+ });
176
+
177
+ it('User should be able to enter negative numbers inside response input field in preview tab', () => {
178
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('-6');
179
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('-6');
180
+ });
181
+
182
+ it('User should be able to enter zero inside response input field in preview tab', () => {
183
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('0');
184
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('0');
185
+ });
186
+
187
+ it('When user enters alphanumeric values in the response input field, then and warning message \'Only number can be typed.\' should appear', () => {
188
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower');
189
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('');
190
+ shortTextResponsePage.steps.verifyWarningMessage('Only number can be typed.');
191
+ });
192
+
193
+ it('When user enters numeric text in response field then warning message should disappear', () => {
194
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('82.5');
195
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('82.5');
196
+ shortTextResponsePage.steps.verifyWarningMessageNotExist();
197
+ });
198
+
199
+ it('When user selects \'Integer\' in accepted student input in edit tab, then user should be able to add only whole numbers inside response input field', () => {
200
+ shortTextResponsePage.steps.switchToEditTab();
201
+ shortTextResponsePage.steps.selectAcceptedStudentInputType(0, 'Integer');
202
+ shortTextResponsePage.steps.switchToPreviewTab();
203
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('232');
204
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('232');
205
+ });
206
+
207
+ it('When user has selected \'Integer\' in accepted student input, then user should not be able to add decimal numbers in the response input field', () => {
208
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('22.4');
209
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('224');
210
+ });
211
+
212
+ it('When user has selected \'Integer\' in accepted student input, then user should not be able to add negative number inside response input field i.e. input field should only include positive whole numbers.', () => {
213
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('-5');
214
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('5');
215
+ });
216
+
217
+ it('User should be able to enter zero inside response input field in preview tab', () => {
218
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('0');
219
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('0');
220
+ });
221
+
222
+ it('When user enters alphanumeric values in the response input field, then warning message \'Only integer can be typed.\' should appear', () => {
223
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower.*');
224
+ shortTextResponsePage.steps.verifyWarningMessage('Only integer can be typed.');
225
+ });
226
+
227
+ it('When user enters integer text in response field then warning message should disappear', () => {
228
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('82');
229
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('82');
230
+ shortTextResponsePage.steps.verifyWarningMessageNotExist();
231
+ });
232
+ });
233
+ });
@@ -0,0 +1,291 @@
1
+ import { specialCharacters } from "../../../fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters";
2
+ import { dialogBoxBase, shortTextResponsePage } from "../../../pages";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+ const specialCharactersCategories = Object.values(specialCharacters.map((icon) => icon.categoryName));
8
+ const customSpecialCharacters = ['A', '1', '#'];
9
+
10
+ describe('Create item page - Fill in the gaps over image - text - Special characters section', () => {
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ });
14
+
15
+ describe('Special characters section - edit tab', () => {
16
+ const newSelectedCategoryList = specialCharacters.slice(1);
17
+ abortEarlySetup();
18
+ before(() => {
19
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
20
+ cy.barsPreLoaderWait();
21
+ });
22
+
23
+ it('\'Special characters\' section label and unchecked \'Enable special characters\' checkbox and label should be displayed', () => {
24
+ utilities.verifyElementVisibilityState(shortTextResponsePage.specialCharactersLabel(), 'visible');
25
+ utilities.verifyInnerText(shortTextResponsePage.specialCharactersLabel(), 'Special characters');
26
+ utilities.verifyElementVisibilityState(shortTextResponsePage.enableSpecialCharactersLabel(), 'visible');
27
+ utilities.verifyInnerText(shortTextResponsePage.enableSpecialCharactersLabel(), 'Enable special characters');
28
+ utilities.verifyElementVisibilityState(shortTextResponsePage.enableSpecialCharactersCheckbox(), 'exist');
29
+ shortTextResponsePage.steps.verifyEnableSpecialCharactersCheckboxUnchecked();
30
+ });
31
+
32
+ it('When the user checks the \'Enable special characters\' checkbox, \'Group by language\' and \'Show only custom special characters\' labels and radio buttons should be displayed. By default \'Group by language\' radio button should be checked', () => {
33
+ shortTextResponsePage.steps.checkEnableSpecialCharactersCheckbox();
34
+ utilities.verifyElementVisibilityState(shortTextResponsePage.groupByLanguageRadioButton(), 'exist');
35
+ utilities.verifyElementVisibilityState(shortTextResponsePage.groupByLanguageLabel(), 'visible');
36
+ utilities.verifyInnerText(shortTextResponsePage.groupByLanguageLabel(), 'Group by language');
37
+ utilities.verifyElementVisibilityState(shortTextResponsePage.showOnlyCustomSpecialCharactersRadioButton(), 'exist');
38
+ utilities.verifyElementVisibilityState(shortTextResponsePage.showOnlyCustomSpecialCharactersLabel(), 'visible');
39
+ utilities.verifyInnerText(shortTextResponsePage.showOnlyCustomSpecialCharactersLabel(), 'Show only custom special characters');
40
+ shortTextResponsePage.steps.verifyGroupedByLanguageRadioButtonIsSelected();
41
+ });
42
+
43
+ it('\'Select special character languages\' label should be displayed. A \'Preview\' hyperlink should be displayed next to the label', () => {
44
+ utilities.verifyElementVisibilityState(shortTextResponsePage.selectSpecialCharacterLanguagesLabel(), 'visible');
45
+ utilities.verifyInnerText(shortTextResponsePage.selectSpecialCharacterLanguagesLabel(), 'Select special character languages');
46
+ utilities.verifyElementVisibilityState(shortTextResponsePage.customizeSpecialCharactersPreviewButton(), 'visible');
47
+ utilities.verifyInnerText(shortTextResponsePage.customizeSpecialCharactersPreviewButton(), 'Preview');
48
+ });
49
+
50
+ it(`A total of ${specialCharactersCategories.length} options should be displayed - ${specialCharactersCategories.join('')}. By default all language options should be in selected state`, () => {
51
+ shortTextResponsePage.steps.verifyCustomizeSpecialCharactersCategoryTiles(specialCharactersCategories);
52
+ shortTextResponsePage.steps.verifySelectedCustomizeSpecialCharactersCategoryTiles(specialCharactersCategories);
53
+ });
54
+
55
+ it('When the user clicks on the \'Preview\' hyperlink, a special characters popup should be displayed with all the special characters segregated according to all the language options. The user should be able to close the popup by clicking on the \'Close[X]\' button', () => {
56
+ shortTextResponsePage.steps.clickOnCustomizeSpecialCharactersPreviewButton();
57
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
58
+ //Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
59
+ //shortTextResponsePage.steps.verifySpecialCharactersPreviewPopupInEditTab(specialCharacters);
60
+ cy.log('Post-step: Closing preview popup')
61
+ dialogBoxBase.steps.closeWarningPopup();
62
+ });
63
+
64
+ it('When the user deselects any language option and opens the special characters popup by clicking on the \'Preview\' hyperlink, then the popup contents should get updated accordingly', () => {
65
+ shortTextResponsePage.steps.clickOnSpecialCharactersCategoryTile(specialCharacters[0].categoryName);
66
+ shortTextResponsePage.steps.verifySpecialCharacterCategoryTileIsNotSelected(specialCharacters[0].categoryName);
67
+ shortTextResponsePage.steps.clickOnCustomizeSpecialCharactersPreviewButton();
68
+ //Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
69
+ //shortTextResponsePage.steps.verifySpecialCharactersPreviewPopupInEditTab(specialCharacters);
70
+ cy.log('Post-step: Closing preview popup')
71
+ dialogBoxBase.steps.closeWarningPopup();
72
+ });
73
+
74
+ it('When the user checks the \'Show only custom special characters\' radio button, \'Custom special characters\' label and input field should be displayed. A \'Preview\' hyperlink should be displayed next to the label', () => {
75
+ shortTextResponsePage.steps.selectShowOnlyCustomSpecialCharactersRadioButton();
76
+ utilities.verifyElementVisibilityState(shortTextResponsePage.customSpecialCharactersInputField(), 'visible');
77
+ utilities.verifyInnerText(shortTextResponsePage.customSpecialCharactersLabel(), 'Custom special characters');
78
+ utilities.verifyElementVisibilityState(shortTextResponsePage.customSpecialCharactersLabel(), 'visible');
79
+ utilities.verifyElementVisibilityState(shortTextResponsePage.customizeSpecialCharactersPreviewButton(), 'visible');
80
+ });
81
+
82
+ it('When the user specifies custom special characters, then on clicking on the \'Preview\' hyperlink, only the specified custom special characters should be displayed in the popup', () => {
83
+ shortTextResponsePage.steps.addInputToCustomSpecialCharactersInputField(`${customSpecialCharacters.join('')}`);
84
+ shortTextResponsePage.steps.clickOnCustomizeSpecialCharactersPreviewButton();
85
+ shortTextResponsePage.steps.verifyCustomSpecialCharactersDisplayedInPreviewPopupEditTab(customSpecialCharacters);
86
+ cy.log('Post-step: Closing preview popup')
87
+ dialogBoxBase.steps.closeWarningPopup();
88
+ });
89
+
90
+ it('CSS of special characters section', { tags: 'css' }, () => {
91
+ utilities.verifyCSS(shortTextResponsePage.specialCharactersLabel(), {
92
+ 'color': css.color.labels,
93
+ 'font-size': css.fontSize.default,
94
+ 'font-weight': css.fontWeight.semibold
95
+ });
96
+ //checked state of enable special characters checkbox
97
+ utilities.verifyCSS(shortTextResponsePage.enableSpecialCharactersCheckbox().parent().find('rect').eq(1), {
98
+ 'fill': css.color.activeButtons
99
+ });
100
+ utilities.verifyCSS(shortTextResponsePage.groupByLanguageLabel(), {
101
+ 'color': css.color.labelText,
102
+ 'font-size': css.fontSize.normal,
103
+ 'font-weight': css.fontWeight.regular
104
+ });
105
+ //selected state of radio button
106
+ utilities.verifyCSS(shortTextResponsePage.showOnlyCustomSpecialCharactersRadioButton().parents('span').find('svg'), {
107
+ 'fill': css.color.activeButtons
108
+ });
109
+ utilities.verifyCSS(shortTextResponsePage.customSpecialCharactersLabel(), {
110
+ 'color': css.color.labels,
111
+ 'font-size': css.fontSize.normal,
112
+ 'font-weight': css.fontWeight.semibold
113
+ });
114
+ utilities.verifyCSS(shortTextResponsePage.customSpecialCharactersInputField(), {
115
+ 'color': css.color.text,
116
+ 'font-size': css.fontSize.default,
117
+ 'font-weight': css.fontWeight.regular
118
+ });
119
+ utilities.verifyCSS(shortTextResponsePage.customSpecialCharactersInputField().parent().find('fieldset'), {
120
+ 'border': `1px solid ${css.color.figDefaultComponentBorder}`
121
+ });
122
+ utilities.verifyCSS(shortTextResponsePage.customizeSpecialCharactersPreviewButton(), {
123
+ 'color': css.color.activeButtons,
124
+ 'font-size': css.fontSize.normal,
125
+ 'font-weight': css.fontWeight.regular
126
+ });
127
+ cy.log('Selecting group by language radio button');
128
+ shortTextResponsePage.steps.selectGroupByLanguageRadioButton();
129
+ utilities.verifyCSS(shortTextResponsePage.selectSpecialCharacterLanguagesLabel(), {
130
+ 'color': css.color.labels,
131
+ 'font-size': css.fontSize.normal,
132
+ 'font-weight': css.fontWeight.semibold
133
+ });
134
+ //Category tiles in selected state
135
+ utilities.verifyCSS(shortTextResponsePage.specialCharacterTileIcon().eq(1).find('svg'), {
136
+ 'fill': css.color.defaultBackground
137
+ });
138
+ utilities.verifyCSS(shortTextResponsePage.TickIcon().last().find('path[data-name*="Rectangle"]'), {
139
+ 'fill': css.color.defaultBackground
140
+ });
141
+ utilities.verifyCSS(shortTextResponsePage.TickIcon().last().find('path[data-name*="feather-check"]'), {
142
+ 'fill': css.color.activeButtons
143
+ });
144
+ utilities.verifyCSS(shortTextResponsePage.specialCharacterTileSectionCategoriesDragIcon().eq(1).find('path'), {
145
+ 'fill': css.color.activeButtons
146
+ });
147
+ utilities.verifyCSS(shortTextResponsePage.specialCharacterTileSectionCategoriesDragIcon().eq(1).parent(), {
148
+ 'background-color': css.color.defaultBackground
149
+ });
150
+ utilities.verifyCSS(shortTextResponsePage.specialCharacterTileCategoryName().eq(1), {
151
+ 'color': css.color.whiteText,
152
+ 'font-size': css.fontSize.small,
153
+ 'font-weight': css.fontWeight.regular
154
+ });
155
+ utilities.verifyCSS(shortTextResponsePage.specialCharacterTiles().eq(1), {
156
+ 'background-color': css.color.primaryBtnBg
157
+ });
158
+ //Category tiles in de-selected state
159
+ utilities.verifyCSS(shortTextResponsePage.specialCharacterTileIcon().eq(0).find('svg'), {
160
+ 'fill': css.color.secondaryBtn
161
+ });
162
+ utilities.verifyCSS(shortTextResponsePage.specialCharacterTileSectionCategoriesDragIcon().eq(0).find('path'), {
163
+ 'fill': css.color.secondaryBtn
164
+ });
165
+ utilities.verifyCSS(shortTextResponsePage.specialCharacterTileSectionCategoriesDragIcon().eq(0).parent(), {
166
+ 'fill': css.color.waveformCursorColor
167
+ });
168
+ utilities.verifyCSS(shortTextResponsePage.specialCharacterTileCategoryName().eq(0), {
169
+ 'color': css.color.secondaryBtn,
170
+ 'font-size': css.fontSize.small,
171
+ 'font-weight': css.fontWeight.regular
172
+ });
173
+ utilities.verifyCSS(shortTextResponsePage.specialCharacterTiles().eq(0), {
174
+ 'background-color': css.color.defaultBackground
175
+ });
176
+ cy.log('Opening preview popup and expanding one category accordion');
177
+ shortTextResponsePage.steps.clickOnCustomizeSpecialCharactersPreviewButton();
178
+ shortTextResponsePage.steps.clickOnSpecialCharactersPreviewPopupCategoryAccordionExpandIcon(0);
179
+ utilities.verifyCSS(dialogBoxBase.dialogBoxTitle(), {
180
+ 'color': css.color.flyoutTitle,
181
+ 'font-size': css.fontSize.heading,
182
+ 'font-weight': css.fontWeight.semibold
183
+ });
184
+ utilities.verifyCSS(shortTextResponsePage.specialCharactersPreviewPopupCategoryLabel().eq(0), {
185
+ 'color': css.color.accordionLabel,
186
+ 'font-size': css.fontSize.default,
187
+ 'font-weight': css.fontWeight.bold
188
+ });
189
+ utilities.verifyCSS(shortTextResponsePage.specialCharactersPreviewPopupCategoryAccordionExpandIcon().last().find('svg'), {
190
+ 'fill': css.color.activeButtons
191
+ });
192
+ utilities.verifyCSS(shortTextResponsePage.specialCharactersPreviewPopupSymbol().eq(0).find('svg'), {
193
+ 'fill': css.color.waveformCursorColor
194
+ });
195
+ });
196
+
197
+ it('Accessibility of Customize special characters', { tags: 'a11y' }, () => {
198
+ cy.checkAccessibility(dialogBoxBase.dialogBox());
199
+ cy.log('Closing preview popup');
200
+ dialogBoxBase.steps.closeWarningPopup();
201
+ cy.checkAccessibility(shortTextResponsePage.specialCharactersLabel().parents('.edit-question-edit-tab-wrapper'));
202
+ cy.log('Selecting show only custom special characters radio button');
203
+ shortTextResponsePage.steps.selectShowOnlyCustomSpecialCharactersRadioButton();
204
+ cy.checkAccessibility(shortTextResponsePage.specialCharactersLabel().parent());
205
+ });
206
+ });
207
+
208
+ describe('Special characters section - preview tab', () => {
209
+ const newSelectedCategoryList = specialCharacters.slice(1);
210
+ abortEarlySetup();
211
+ before(() => {
212
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
213
+ cy.barsPreLoaderWait();
214
+ shortTextResponsePage.steps.switchToPreviewTab();
215
+ });
216
+
217
+ it('When \'Enable special characters\' checkbox is unchecked and user focuses on the preview tab response field, then \'Special characters\' button should not be displayed', () => {
218
+ shortTextResponsePage.steps.focusInAnswerInputFieldPreviewTab();
219
+ utilities.verifyElementVisibilityState(shortTextResponsePage.specialCharactersButtonPreviewTab(), 'notExist');
220
+ });
221
+
222
+ it('When \'Enable special characters\' checkbox is checked and user focuses on the preview tab response field, then \'Special characters\' button should be displayed', () => {
223
+ shortTextResponsePage.steps.switchToEditTab();
224
+ shortTextResponsePage.steps.checkEnableSpecialCharactersCheckbox();
225
+ shortTextResponsePage.steps.switchToPreviewTab();
226
+ shortTextResponsePage.steps.focusInAnswerInputFieldPreviewTab();
227
+ utilities.verifyElementVisibilityState(shortTextResponsePage.specialCharactersButtonPreviewTab(), 'visible');
228
+ utilities.verifyInnerText(shortTextResponsePage.specialCharactersButtonPreviewTab(), 'é');
229
+ utilities.verifyElementCount(shortTextResponsePage.specialCharactersButtonPreviewTab(), '1');
230
+ });
231
+
232
+ it('When user clicks on response area special characters button, then special characters popup should be displayed with its default contents and all category accordions should be in collapsed state', () => {
233
+ shortTextResponsePage.steps.openSpecialCharactersPopupPreviewTab();
234
+ //Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
235
+ //shortTextResponsePage.steps.verifySpecialCharactersPopupCategorySymbols(specialCharacters);
236
+ });
237
+
238
+ it('When user clicks on the \'Close\' button then the \'Special characters\' popup should be closed', () => {
239
+ shortTextResponsePage.steps.closeSpecialCharactersPopupPreviewTab();
240
+ utilities.verifyElementVisibilityState(shortTextResponsePage.specialCharactersPopupTitlePreviewTab(), 'notExist');
241
+ });
242
+
243
+ it('When the user has deselected any language option and opens the special characters popup in the preview tab, then the popup contents should get updated accordingly', () => {
244
+ shortTextResponsePage.steps.switchToEditTab();
245
+ shortTextResponsePage.steps.clickOnSpecialCharactersCategoryTile(specialCharacters[0].categoryName);
246
+ shortTextResponsePage.steps.verifySpecialCharacterCategoryTileIsNotSelected(specialCharacters[0].categoryName);
247
+ shortTextResponsePage.steps.switchToPreviewTab();
248
+ shortTextResponsePage.steps.focusInAnswerInputFieldPreviewTab();
249
+ shortTextResponsePage.steps.openSpecialCharactersPopupPreviewTab();
250
+ //Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
251
+ //shortTextResponsePage.steps.verifySpecialCharactersPopupCategorySymbols(specialCharacters);
252
+ });
253
+
254
+ it('When the user has specified custom special characters and opens the special characters popup in the preview tab, then only the specified custom special characters should be displayed in the popup', () => {
255
+ shortTextResponsePage.steps.closeSpecialCharactersPopupPreviewTab();
256
+ shortTextResponsePage.steps.switchToEditTab();
257
+ shortTextResponsePage.steps.selectShowOnlyCustomSpecialCharactersRadioButton();
258
+ shortTextResponsePage.steps.addInputToCustomSpecialCharactersInputField(`${customSpecialCharacters.join('')}`);
259
+ shortTextResponsePage.steps.switchToPreviewTab();
260
+ shortTextResponsePage.steps.focusInAnswerInputFieldPreviewTab();
261
+ shortTextResponsePage.steps.openSpecialCharactersPopupPreviewTab();
262
+ shortTextResponsePage.steps.verifyCustomSpecialCharactersInSpecialCharactersPopupPreviewTab(customSpecialCharacters);
263
+ });
264
+
265
+ it('When user clicks on a special character symbol in special characters popup in the preview tab, then the that symbol should be displayed in the response area input field', () => {
266
+ shortTextResponsePage.steps.clickOnCustomSpecialCharacterSymbolInSpecialCharactersPopupPreviewTab(customSpecialCharacters[0]);
267
+ shortTextResponsePage.steps.closeSpecialCharactersPopupPreviewTab();
268
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab(`${customSpecialCharacters[0]}`)
269
+ });
270
+
271
+ it('CSS of \'Special characters\' popup', { tags: 'css' }, () => {
272
+ cy.log('Pre-step: Switching to edit tab and selecting group by language radio button');
273
+ shortTextResponsePage.steps.switchToEditTab();
274
+ shortTextResponsePage.steps.selectGroupByLanguageRadioButton();
275
+ shortTextResponsePage.steps.switchToPreviewTab();
276
+ shortTextResponsePage.steps.focusInAnswerInputFieldPreviewTab();
277
+ shortTextResponsePage.steps.openSpecialCharactersPopupPreviewTab();
278
+ utilities.verifyCSS(shortTextResponsePage.specialCharactersPopupTitlePreviewTab(), {
279
+ 'color': css.color.flyoutTitle,
280
+ 'font-size': css.fontSize.heading,
281
+ 'font-weight': css.fontWeight.bold,
282
+ });
283
+ utilities.verifyCSS(shortTextResponsePage.specialCharactersPopupCategoryAccordionChevronButtonPreviewTab().last().find('svg'), {
284
+ 'fill': css.color.activeButtons
285
+ });
286
+ utilities.verifyCSS(shortTextResponsePage.specialCharactersPopupSymbolPreviewTab().last().find('path'), {
287
+ 'fill': css.color.activeButtons
288
+ });
289
+ });
290
+ });
291
+ });