itemengine-cypress-automation 1.0.129 → 1.0.131-smokeTestFixes6March-aa053ff.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +2 -4
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +2 -4
  3. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +3 -7
  4. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +210 -0
  5. package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +91 -0
  6. package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +392 -0
  7. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -1
  8. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
  9. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +2 -1
  10. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -1
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +2 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +152 -0
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +196 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +195 -0
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +288 -0
  17. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/manuallyAndNonScored.js +141 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +245 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +413 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +218 -0
  21. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +245 -0
  22. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +163 -0
  23. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +224 -0
  24. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +196 -0
  25. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +224 -0
  26. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +83 -0
  27. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +653 -0
  28. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +180 -0
  29. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabScoringSection.js +229 -0
  30. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +90 -0
  31. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/switchingCasesBetweenOptionsLayout.js +50 -0
  32. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +204 -0
  33. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +204 -0
  34. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +298 -0
  35. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingPenaltyScoring.js +63 -0
  36. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +111 -0
  37. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +231 -0
  38. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsBasic.js +90 -0
  39. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  40. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +232 -0
  41. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +231 -0
  42. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsBasic.js +138 -0
  43. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +213 -0
  44. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +186 -0
  45. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
  46. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +161 -0
  47. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +328 -0
  48. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +144 -0
  49. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabScoringSection.js +250 -0
  50. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +75 -0
  51. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  52. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +74 -0
  53. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +188 -0
  54. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +8 -8
  55. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
  56. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +4 -2
  57. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +1 -52
  58. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +3 -211
  59. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +39 -3
  60. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -8
  61. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
  62. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -50
  63. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +325 -0
  64. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +1 -146
  65. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  66. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +78 -0
  67. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +265 -0
  68. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +75 -0
  69. package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  70. package/cypress/e2e/ILC/FillInTheGapsTextNew/responseAnswersAndAcceptedStudentInput.js +56 -0
  71. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +40 -2
  72. package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +249 -0
  73. package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +64 -0
  74. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +128 -0
  75. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +889 -0
  76. package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +168 -0
  77. package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +203 -0
  78. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +222 -0
  79. package/cypress/e2e/ILC/SimpleCalculator/calculatorFunctionality.js +349 -0
  80. package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +132 -0
  81. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +35 -7
  82. package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +213 -0
  83. package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +41 -0
  84. package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +377 -0
  85. package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +161 -0
  86. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +250 -0
  87. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  88. package/cypress/fixtures/theme/ilc.json +6 -1
  89. package/cypress/fixtures/uploadResponseFileType.js +5 -0
  90. package/cypress/pages/audioResponsePage.js +1 -1
  91. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +13 -13
  92. package/cypress/pages/components/customizeSpecialCharacterComponent.js +24 -6
  93. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  94. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +42 -4
  95. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +149 -5
  96. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +954 -77
  97. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  98. package/cypress/pages/components/questionInstructionsComponent.js +2 -1
  99. package/cypress/pages/contentBlocksPage.js +515 -0
  100. package/cypress/pages/drawingResponsePage.js +2 -2
  101. package/cypress/pages/fillInTheGapsDragAndDropPage.js +359 -3
  102. package/cypress/pages/fillInTheGapsDropdownPage.js +21 -1
  103. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +5 -57
  104. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -24
  105. package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -435
  106. package/cypress/pages/fillInTheGapsTextPage.js +9 -2
  107. package/cypress/pages/graphingPage.js +484 -0
  108. package/cypress/pages/index.js +4 -1
  109. package/cypress/pages/simpleCalculatorPage.js +310 -0
  110. package/cypress/pages/uploadResponsePage.js +260 -92
  111. package/package.json +2 -2
  112. package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +0 -242
  113. package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +0 -99
  114. package/cypress/e2e/ILC/Passage/passageEditTab.js +0 -241
  115. package/cypress/e2e/ILC/Passage/passageHeaderSection.js +0 -73
  116. package/cypress/e2e/ILC/Passage/passagePreviewTab.js +0 -246
@@ -0,0 +1,213 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { uploadResponsePage } from "../../../pages";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const labels =[uploadResponsePage.allowStudentToAddFileDescriptionLabel, uploadResponsePage.allowStudentToEditFileNameLabel, uploadResponsePage.displayPerFileSizeLimitToStudentLabel];
7
+
8
+ describe('Create question page - Upload Response: Additional Settings', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Student view settings - Edit tab', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
17
+ cy.barsPreLoaderWait();
18
+ });
19
+
20
+ uploadResponsePage.tests.verifyStudentViewSettingsLabelAndCSS();
21
+
22
+ it('\'Upload controls\' label and three options should be displayed with their labels and by default all of them should be selected', () => {
23
+ utilities.verifyInnerText(uploadResponsePage.uploadControlsLabel(), 'Upload controls');
24
+ utilities.verifyElementVisibilityState(uploadResponsePage.uploadControlsLabel(), 'visible');
25
+ uploadResponsePage.steps.verifyUploadControlsButton();
26
+ });
27
+
28
+ it('User should be able to unselect Upload controls options', () => {
29
+ uploadResponsePage.steps.unselectUploadControlsOption(0);
30
+ uploadResponsePage.steps.unselectUploadControlsOption(1);
31
+ uploadResponsePage.steps.unselectUploadControlsOption(2);
32
+ });
33
+
34
+ it('\'Display per file size limit to student\' label and checkbox should be displayed and by default checkbox should be checked', () => {
35
+ utilities.verifyInnerText(uploadResponsePage.displayPerFileSizeLimitToStudentLabel(), 'Display per file size limit to student');
36
+ utilities.verifyElementVisibilityState(uploadResponsePage.displayPerFileSizeLimitToStudentLabel(), 'visible');
37
+ utilities.verifyElementVisibilityState(uploadResponsePage.displayPerFileSizeLimitToStudentCheckbox(), 'exist');
38
+ uploadResponsePage.steps.verifyDisplayPerFileSizeLimitToStudentCheckboxChecked();
39
+ });
40
+
41
+ it('User should be able to uncheck \'Display per file size limit to student\' checkbox', () => {
42
+ uploadResponsePage.steps.uncheckDisplayPerFileSizeLimitToStudentCheckbox();
43
+ });
44
+
45
+ it('\'Allow student to edit file name\' label and checkbox should be displayed and by default checkbox should be checked', () => {
46
+ utilities.verifyInnerText(uploadResponsePage.allowStudentToEditFileNameLabel(), 'Allow student to edit file name');
47
+ utilities.verifyElementVisibilityState(uploadResponsePage.allowStudentToEditFileNameLabel(), 'visible');
48
+ utilities.verifyElementVisibilityState(uploadResponsePage.allowStudentToEditFileNameCheckbox(), 'exist');
49
+ uploadResponsePage.steps.verifyAllowStudentToEditFileNameCheckboxChecked();
50
+ });
51
+
52
+ it('User should be able to uncheck \'Allow student to edit file name\' checkbox', () => {
53
+ uploadResponsePage.steps.uncheckAllowStudentToEditFileNameCheckbox();
54
+ });
55
+
56
+ it('\'Allow student to add file description\' label and checkbox should be displayed and by default checkbox should be checked', () => {
57
+ utilities.verifyInnerText(uploadResponsePage.allowStudentToAddFileDescriptionLabel(), 'Allow student to add file description');
58
+ utilities.verifyElementVisibilityState(uploadResponsePage.allowStudentToAddFileDescriptionLabel(), 'visible');
59
+ utilities.verifyElementVisibilityState(uploadResponsePage.allowStudentToAddFileDescriptionCheckbox(), 'exist');
60
+ uploadResponsePage.steps.verifyAllowStudentToAddFileDescriptionCheckboxChecked();
61
+ });
62
+
63
+ it('User should be able to uncheck \'Allow student to add file description\' checkbox', () => {
64
+ uploadResponsePage.steps.uncheckAllowStudentToAddFileDescriptionCheckbox();
65
+ });
66
+
67
+ it('CSS of \'Student view settings\' section', { tags: 'css' }, () => {
68
+ utilities.verifyCSS(uploadResponsePage.uploadControlsLabel(), {
69
+ 'color': css.color.labels,
70
+ 'font-size': css.fontSize.normal,
71
+ 'font-weight': css.fontWeight.semibold
72
+ });
73
+ labels.forEach((label) => {
74
+ utilities.verifyCSS(label(), {
75
+ 'color': css.color.labelText,
76
+ 'font-size': css.fontSize.normal,
77
+ 'font-weight': css.fontWeight.regular
78
+ });
79
+ });
80
+ utilities.verifyCSS(utilities.getNthElement(uploadResponsePage.uploadControlsOptionLabel(), 0), {
81
+ 'color': css.color.closeIcon,
82
+ 'font-size': css.fontSize.normal,
83
+ 'font-weight': css.fontWeight.bold
84
+ });
85
+ });
86
+
87
+ it('Accessibility of \'Student view settings\' section', { tags: 'a11y' }, () => {
88
+ cy.checkAccessibility(uploadResponsePage.uploadControlsLabel().parents('.student-view-settings-container'))
89
+ });
90
+ });
91
+
92
+ describe('Upload controls - Preview tab', () => {
93
+ abortEarlySetup();
94
+ before(() => {
95
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
96
+ cy.barsPreLoaderWait();
97
+ });
98
+
99
+ it('When the \'Capture photos\' option is selected then in the preview tab, the upload response area text should have \'Capture an image\' option', () => {
100
+ uploadResponsePage.steps.switchToPreviewTab();
101
+ uploadResponsePage.steps.verifyUploadOptionVisibleInUploadResponseArea('Capture photo');
102
+ });
103
+
104
+ it('When the user unselects the \'Capture photos\' option, then in the Preview tab the upload response area text should not have \'capture an image\' option', () => {
105
+ cy.log('Switching to Edit tab.');
106
+ uploadResponsePage.steps.switchToEditTab();
107
+ uploadResponsePage.steps.unselectUploadControlsOption(0);
108
+ cy.log('Switching to Preview tab.');
109
+ uploadResponsePage.steps.switchToPreviewTab();
110
+ uploadResponsePage.steps.verifyUploadOptionNotVisibleInUploadResponseArea('Capture photo');
111
+ });
112
+
113
+ it('When the \'Google Drive\' option is selected then in the preview tab, the upload response area text should have \'Google drive\' option', () => {
114
+ uploadResponsePage.steps.switchToPreviewTab();
115
+ uploadResponsePage.steps.verifyUploadOptionVisibleInUploadResponseArea('Google Drive');
116
+ });
117
+
118
+ it('When the user unselects the \'Google Drive\' option, then in the Preview tab the upload response area text should have not \'Google drive\' option', () => {
119
+ cy.log('Switching to Edit tab.');
120
+ uploadResponsePage.steps.switchToEditTab();
121
+ uploadResponsePage.steps.unselectUploadControlsOption(1);
122
+ cy.log('Switching to Preview tab.');
123
+ uploadResponsePage.steps.switchToPreviewTab();
124
+ uploadResponsePage.steps.verifyUploadOptionNotVisibleInUploadResponseArea('Google Drive');
125
+ });
126
+
127
+ it('When the \'Drag and drop files\' option is selected then in the preview tab, the upload response area text should be \'Drag and drop files here\'', () => {
128
+ uploadResponsePage.steps.switchToPreviewTab();
129
+ utilities.verifyElementVisibilityState(uploadResponsePage.uploadCloudIcon(), 'visible');
130
+ utilities.verifyInnerText(uploadResponsePage.dragAndDropFilesText(), 'Drag & Drop files here');
131
+ });
132
+
133
+ it('When the user unselects the \'Drag and drop files\' option, then in the Preview tab the upload response area text should be \'Upload file here\'', () => {
134
+ cy.log('Switching to Edit tab.');
135
+ uploadResponsePage.steps.switchToEditTab();
136
+ uploadResponsePage.steps.unselectUploadControlsOption(2);
137
+ uploadResponsePage.steps.switchToPreviewTab();
138
+ utilities.verifyElementVisibilityState(uploadResponsePage.uploadCloudIcon(), 'visible');
139
+ utilities.verifyInnerText(uploadResponsePage.dragAndDropFilesText(), 'Upload file here');
140
+ });
141
+ });
142
+
143
+ describe('Display per file size limit to student - Preview tab', () => {
144
+ abortEarlySetup();
145
+ before(() => {
146
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
147
+ cy.barsPreLoaderWait();
148
+ });
149
+
150
+ it('When the \'Display per file size limit to student\' checkbox is checked then in the preview tab, then \'Maximum file size: #MB\' should be displayed', () => {
151
+ uploadResponsePage.steps.verifyDisplayPerFileSizeLimitToStudentCheckboxChecked();
152
+ uploadResponsePage.steps.switchToPreviewTab();
153
+ utilities.verifyElementVisibilityState(uploadResponsePage.maximumFileSize(), 'visible');
154
+ uploadResponsePage.steps.verifyMaximumFileSizePreviewTab('20MB');
155
+ });
156
+
157
+ it('When the user unchecks \'Display per file size limit to student\' checkbox, then in the Preview tab Maximum file size: #MB should not be displayed', () => {
158
+ cy.log('Switching to Edit tab.');
159
+ uploadResponsePage.steps.switchToEditTab();
160
+ uploadResponsePage.steps.uncheckDisplayPerFileSizeLimitToStudentCheckbox();
161
+ uploadResponsePage.steps.switchToPreviewTab();
162
+ utilities.verifyElementVisibilityState(uploadResponsePage.maximumFileSize(), 'notExist');
163
+ });
164
+ });
165
+
166
+ describe('Allow student to edit file name - Preview tab', () => {
167
+ abortEarlySetup();
168
+ before(() => {
169
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
170
+ cy.barsPreLoaderWait();
171
+ });
172
+
173
+ it('When the \'Allow student to edit file name\' checkbox is checked then in the preview tab, then edit icon should be displayed', () => {
174
+ uploadResponsePage.steps.verifyAllowStudentToEditFileNameCheckboxChecked();
175
+ uploadResponsePage.steps.switchToPreviewTab();
176
+ uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
177
+ utilities.verifyElementVisibilityState(utilities.getNthElement(uploadResponsePage.editDisplayTextIcon(), 0), 'visible');
178
+ });
179
+
180
+ it('When the user unchecks \'Allow student to edit file name\' checkbox, then in the Preview tab edit icon should be not be displayed', () => {
181
+ cy.log('Switching to Edit tab.');
182
+ uploadResponsePage.steps.switchToEditTab();
183
+ uploadResponsePage.steps.uncheckAllowStudentToEditFileNameCheckbox();
184
+ uploadResponsePage.steps.switchToPreviewTab();
185
+ uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
186
+ utilities.verifyElementVisibilityState(uploadResponsePage.editDisplayTextIcon(), 'hidden');
187
+ });
188
+ });
189
+
190
+ describe('Allow student to add file description - Preview tab', () => {
191
+ abortEarlySetup();
192
+ before(() => {
193
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
194
+ cy.barsPreLoaderWait();
195
+ });
196
+
197
+ it('When the \'Allow student to add file description\' checkbox is checked then in the preview tab, then add description icon should be displayed', () => {
198
+ uploadResponsePage.steps.verifyAllowStudentToEditFileNameCheckboxChecked();
199
+ uploadResponsePage.steps.switchToPreviewTab();
200
+ uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
201
+ utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionIcon(), 'visible');
202
+ });
203
+
204
+ it('When the user unchecks \'Allow student to add file description\' checkbox, then in the Preview tab add description icon should be not be displayed', () => {
205
+ cy.log('Switching to Edit tab.');
206
+ uploadResponsePage.steps.switchToEditTab();
207
+ uploadResponsePage.steps.uncheckAllowStudentToAddFileDescriptionCheckbox();
208
+ uploadResponsePage.steps.switchToPreviewTab();
209
+ uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
210
+ utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionIcon(), 'notExist');
211
+ });
212
+ });
213
+ });
@@ -0,0 +1,41 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { uploadResponsePage } from "../../../pages";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create question page - Upload Response: Additional Settings', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Additional Settings accordion', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
14
+ cy.barsPreLoaderWait();
15
+ });
16
+
17
+ uploadResponsePage.tests.verifyAdditonalSettingsAccordionProperties();
18
+ });
19
+
20
+ describe('Additional settings: Font size contents', () => {
21
+ abortEarlySetup();
22
+ before(() => {
23
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
24
+ cy.barsPreLoaderWait();
25
+ uploadResponsePage.steps.expandAdditonalSettings();
26
+ });
27
+
28
+ uploadResponsePage.tests.verifyFontSizeSectionContents();
29
+ });
30
+
31
+ describe('Additional Settings: Details section', () => {
32
+ abortEarlySetup();
33
+ before(() => {
34
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
35
+ cy.barsPreLoaderWait();
36
+ uploadResponsePage.steps.expandAdditonalSettings();
37
+ });
38
+
39
+ uploadResponsePage.tests.verifyDetailsSection();
40
+ });
41
+ });
@@ -0,0 +1,377 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { uploadResponsePage } from "../../../pages";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ import { supportedFileType } from "../../../fixtures/uploadResponseFileType";;
5
+ const css = Cypress.env('css');
6
+
7
+ const fileSizeLimitOptions = ['5', '10', '15', '20', '100'];
8
+
9
+ describe('Create question page - Upload Response: Question Instructions, Supported file types, Maximum number of files, File size limit section', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Question Instructions input field - Edit tab', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ cy.log('Navigating to upload response question type');
18
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
19
+ });
20
+
21
+ uploadResponsePage.tests.verifyQuestionInstructionsInputFieldEditTab();
22
+
23
+ });
24
+
25
+ describe('Question Instructions input field - Preview tab', () => {
26
+ abortEarlySetup();
27
+ before(() => {
28
+ cy.log('Navigating to upload response question type');
29
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
30
+ });
31
+
32
+ uploadResponsePage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
33
+
34
+ });
35
+
36
+ describe('Supported file types section - Edit tab', () => {
37
+ abortEarlySetup();
38
+ before(() => {
39
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
40
+ });
41
+
42
+ it('\'Supported file types\' accordion should be displayed and it should be collapsed by default and next to \'Supported file types\' accordion menu, text \'14 selected\' should be displayed indicating number of selected file types and user should be able to expand and collapse this accordion', () => {
43
+ utilities.verifyInnerText(uploadResponsePage.supportedFileTypesAccordion(), 'Supported file types');
44
+ uploadResponsePage.steps.verifySupportedFilesTypesAccordionCollapsedState();
45
+ utilities.verifyInnerText(uploadResponsePage.selectedFileTypeCount(), '14 selected');
46
+ utilities.verifyElementVisibilityState(uploadResponsePage.selectedFileTypeCount(), 'visible');
47
+ cy.log('verifying if user is able to expand and collapse the \'Supported file types\' accordion')
48
+ uploadResponsePage.steps.clickOnSupportedFilesTypesAccordion();
49
+ uploadResponsePage.steps.verifySupportedFilesTypesAccordionExpandedState();
50
+ uploadResponsePage.steps.clickOnSupportedFilesTypesAccordion();
51
+ uploadResponsePage.steps.verifySupportedFilesTypesAccordionCollapsedState();
52
+ });
53
+
54
+ it('CSS of Supported file types section', { tags: 'css' }, () => {
55
+ utilities.verifyCSS(uploadResponsePage.supportedFileTypesAccordion(), {
56
+ 'color': css.color.accordionLabel,
57
+ 'font-size': css.fontSize.default,
58
+ 'font-weight': css.fontWeight.bold
59
+ });
60
+ utilities.verifyCSS(uploadResponsePage.selectedFileTypeCount(), {
61
+ 'color': css.color.labels,
62
+ 'font-size': css.fontSize.normal,
63
+ 'font-weight': css.fontWeight.regular
64
+ });
65
+ });
66
+
67
+ it('Accessibility of Supported file types section', { tags: 'a11y' }, () => {
68
+ cy.checkAccessibility(uploadResponsePage.supportedFileTypesAccordionWrapper());
69
+ cy.checkAccessibility(uploadResponsePage.selectedFileTypeCount());
70
+ });
71
+
72
+ it(`When user expands the \'Supported file types\' accordion menu, all the file types should be listed and following file types should be selected - ${supportedFileType.defaultSelectedFileTypeList}`, () => {
73
+ uploadResponsePage.steps.clickOnSupportedFilesTypesAccordion();
74
+ supportedFileType.fileTypeCategoryLabels.forEach((fileTypeCategoryLabel, count) => {
75
+ utilities.verifyInnerText(uploadResponsePage.supportedFileTypeCategoryLabel(count), fileTypeCategoryLabel);
76
+ utilities.verifyElementVisibilityState(uploadResponsePage.supportedFileTypeCategoryLabel(count), 'visible');
77
+ });
78
+ supportedFileType.fileTypeList.forEach((fileType, count) => {
79
+ utilities.verifyInnerText(uploadResponsePage.supportedFileTypeOptionLabel(count), fileType);
80
+ utilities.verifyElementVisibilityState(uploadResponsePage.supportedFileTypeOptionLabel(count), 'visible');
81
+ });
82
+ uploadResponsePage.steps.verifyDefaultSelectedFileTypes();
83
+ });
84
+
85
+ it('CSS of supported files accordion contents in expanded state', { tags: 'css' }, () => {
86
+ utilities.verifyCSS(uploadResponsePage.supportedFileTypeCategoryLabel(0), {
87
+ 'color': css.color.labels,
88
+ 'font-size': css.fontSize.normal,
89
+ 'font-weight': css.fontWeight.semibold
90
+ });
91
+ utilities.verifyCSS(uploadResponsePage.supportedFileTypeButton(0).find('.feather-check-icon'), {
92
+ 'fill': css.color.activeButtons
93
+ });
94
+ utilities.verifyCSS(uploadResponsePage.supportedFileTypeButton(0), {
95
+ 'background-color': css.color.activeButtons
96
+ });
97
+ utilities.verifyCSS(uploadResponsePage.supportedFileTypeOptionLabel(0), {
98
+ 'color': css.color.whiteText,
99
+ 'font-size': css.fontSize.default,
100
+ 'font-weight': css.fontWeight.medium
101
+ });
102
+ utilities.verifyCSS(uploadResponsePage.supportedFileTypeButton(8), {
103
+ 'background-color': css.color.defaultBackground
104
+ });
105
+ utilities.verifyCSS(uploadResponsePage.supportedFileTypeOptionLabel(8), {
106
+ 'color': css.color.panelLabel,
107
+ 'font-size': css.fontSize.default,
108
+ 'font-weight': css.fontWeight.medium
109
+ });
110
+ });
111
+
112
+ it('Accessibility of supported files accordion contents in expanded state', { tags: 'a11y' }, () => {
113
+ cy.checkAccessibility(uploadResponsePage.supportedFileTypesAccordion().parents('.upload-mode'));
114
+ });
115
+
116
+ it('When the user deselects all the file types from the \'Supported file types\' accordion menu, then a validation text \'Error: Please select a file type.\' should be displayed', () => {
117
+ cy.log('Deselecting all file types to get error message.');
118
+ uploadResponsePage.steps.uncheckDefaultSelectedFileTypes();
119
+ utilities.verifyInnerText(uploadResponsePage.errorMessage(), 'Error: Please select a file type.');
120
+ utilities.verifyElementVisibilityState(uploadResponsePage.errorMessage(), 'visible');
121
+ });
122
+
123
+ uploadResponsePage.tests.verifyErrorMessageCSSAndA11y();
124
+
125
+ it('When the user re-selects any file type from the \'Supported file types\' accordion menu, then the validation text \'Error: Please select a file type\' should disappear', () => {
126
+ uploadResponsePage.steps.selectSupportedFileTypeOption(0);
127
+ utilities.verifyElementVisibilityState(uploadResponsePage.errorMessage(), 'notExist');
128
+ });
129
+ });
130
+
131
+ describe('Supported file types- preview tab', () => {
132
+ abortEarlySetup();
133
+ before(() => {
134
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
135
+ cy.barsPreLoaderWait();
136
+ });
137
+
138
+ it('When user hovers over supported file formats info icon, a tooltip with selected supported file types should be displayed in preview tab', () => {
139
+ uploadResponsePage.steps.switchToPreviewTab();
140
+ utilities.triggerMouseover(uploadResponsePage.supportedFileInfoIcon());
141
+ utilities.verifyInnerText(uploadResponsePage.supportedFilesTooltip(), 'Supported file formats: CSV, Excel, GIF, JPG, Open Office, PDF, PNG, Powerpoint, Publisher, RTF, TXT, Word, XPS, ZIP.');
142
+ });
143
+
144
+ it('When user uploads file type which is not selected from the \'Supported file types\' accordion menu, then file upload warning message - \'The file type is not supported. Please upload files with the following supported formats: *file format separated by commas*\' should be displayed', () => {
145
+ uploadResponsePage.steps.uploadFile('uploads/sample.mp4');
146
+ utilities.verifyInnerText(uploadResponsePage.warningMessage(), 'The file type is not supported. Please upload files with the following supported formats: CSV, Excel, GIF, JPG, Open Office, PDF, PNG, Powerpoint, Publisher, RTF, TXT, Word, XPS, ZIP.');
147
+ });
148
+
149
+ it('When user modifies supported file types, then in preview tab on hovering over the Supported file formats info icon a tooltip with the modified list of selected supported file types should be displayed', () => {
150
+ cy.log('Pre-step: checking a new file type and unchecking a default selected file type');
151
+ uploadResponsePage.steps.switchToEditTab();
152
+ uploadResponsePage.steps.expandSupportedFileTypesAccordion();
153
+ uploadResponsePage.steps.unselectSupportedFileTypeOption(4);
154
+ uploadResponsePage.steps.selectSupportedFileTypeOption(27);
155
+ uploadResponsePage.steps.switchToPreviewTab();
156
+ utilities.triggerMouseover(uploadResponsePage.supportedFileInfoIcon());
157
+ utilities.verifyInnerText(uploadResponsePage.supportedFilesTooltip(), 'Supported file formats: CSV, Excel, GIF, JPG, MP3, PDF, PNG, Powerpoint, Publisher, RTF, TXT, Word, XPS, ZIP.');
158
+ });
159
+
160
+ it('User should be able to upload file of newly added supported file type', () => {
161
+ uploadResponsePage.steps.fileUploadAndVerify(['sample.mp3']);
162
+ });
163
+
164
+ it('When the user uploads file type which is now removed from supported file type, then file upload warning message - \'The file type is not supported. Please upload files with the following supported formats: *file format separated by commas*\' should be displayed', () => {
165
+ uploadResponsePage.steps.uploadFile('uploads/sample.mp4');
166
+ utilities.verifyInnerText(uploadResponsePage.warningMessage(), 'The file type is not supported. Please upload files with the following supported formats: CSV, Excel, GIF, JPG, MP3, PDF, PNG, Powerpoint, Publisher, RTF, TXT, Word, XPS, ZIP.');
167
+ });
168
+
169
+ uploadResponsePage.tests.verifyWarningMessageDisappear();
170
+ });
171
+
172
+ describe('Maximum number of files - Edit tab', () => {
173
+ abortEarlySetup();
174
+ before(() => {
175
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
176
+ });
177
+
178
+ it('\'Maximum number of files\' label and input field with increment operator and decrement operator should be displayed and input filed should have 15 by default', () => {
179
+ utilities.verifyInnerText(uploadResponsePage.maximumNumberOfFilesLabel(), 'Maximum number of files');
180
+ utilities.verifyElementVisibilityState(uploadResponsePage.maximumNumberOfFilesLabel(), 'visible');
181
+ uploadResponsePage.steps.verifyMaximumNumberOfFilesInputField(15);
182
+ utilities.verifyElementVisibilityState(uploadResponsePage.maximumNumberOfFilesInputField(), 'visible');
183
+ utilities.verifyElementVisibilityState(uploadResponsePage.maximumNumberOfFilesDecreaseButton(), 'visible');
184
+ utilities.verifyElementVisibilityState(uploadResponsePage.maximumNumberOfFilesIncreaseButton(), 'visible');
185
+ });
186
+
187
+ it('CSS of \'Maximum number of files\' section', { tags: 'css' }, () => {
188
+ utilities.verifyCSS(uploadResponsePage.maximumNumberOfFilesLabel(), {
189
+ 'color': css.color.labelText,
190
+ 'font-size': css.fontSize.normal,
191
+ 'font-weight': css.fontWeight.semibold
192
+ });
193
+ });
194
+
195
+ it('Accessibility of Max Files dropdown in default state', { tags: 'a11y' }, () => {
196
+ cy.checkAccessibility(uploadResponsePage.maximumNumberOfFilesLabel().parents('.input-stepper'));
197
+ });
198
+
199
+ it('When user clicks on the decrement operator, then maximum number of files value should decrease', () => {
200
+ uploadResponsePage.steps.decreaseMaximumNumberOfFilesCount();
201
+ uploadResponsePage.steps.verifyMaximumNumberOfFilesInputField(14);
202
+ });
203
+
204
+ it('When user clicks on the increment operator, then maximum number of files value should increase', () => {
205
+ uploadResponsePage.steps.increaseMaximumNumberOfFilesCount();
206
+ uploadResponsePage.steps.verifyMaximumNumberOfFilesInputField(15);
207
+ });
208
+
209
+ it('User should be able to update the value by entering text in input field', () => {
210
+ uploadResponsePage.steps.setMaximumNumberOfFiles(5);
211
+ uploadResponsePage.steps.verifyMaximumNumberOfFilesInputField(5);
212
+ });
213
+ });
214
+
215
+ describe('Maximum number of Files section - Preview tab', () => {
216
+ abortEarlySetup();
217
+ before(() => {
218
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
219
+ });
220
+
221
+ it('When \'Maximum number of files\' selected are 15 by default, then \'0/15 File Limit\' should be displayed in preview tab', () => {
222
+ uploadResponsePage.steps.verifyMaximumNumberOfFilesInputField(15);
223
+ uploadResponsePage.steps.switchToPreviewTab();
224
+ uploadResponsePage.steps.verifyUploadedFileLimitCount(0, 15);
225
+ });
226
+
227
+ it('User should be able to upload maximum 15 files and count in the file limit section should update accordingly', () => {
228
+ uploadResponsePage.steps.fileUploadAndVerify(['sample.csv', 'sample.xlsx', 'sample.gif', 'sample.jpg', 'sample.pdf', 'image.png', 'sample.ppt', 'sample.pub', 'sample.rtf', 'sample.txt', 'sample.doc', 'sample.xps', 'sample.zip', 'sample1.jpg', 'sample2.jpg']);
229
+ utilities.verifyInnerText(uploadResponsePage.uploadedFileCount(), '15/15 File Limit');
230
+ });
231
+
232
+ it('When user updates \'Maximum number of files\' input field , then file limit should be updated in preview tab', () => {
233
+ uploadResponsePage.steps.switchToEditTab();
234
+ uploadResponsePage.steps.setMaximumNumberOfFiles(4);
235
+ uploadResponsePage.steps.verifyMaximumNumberOfFilesInputField(4);
236
+ uploadResponsePage.steps.switchToPreviewTab();
237
+ uploadResponsePage.steps.verifyUploadedFileLimitCount(0, 4);
238
+ });
239
+
240
+ it('When user decreases \'Maximum number of files\' by clicking on decrement operator , then file limit should be updated in preview tab', () => {
241
+ uploadResponsePage.steps.switchToEditTab();
242
+ uploadResponsePage.steps.decreaseMaximumNumberOfFilesCount();
243
+ uploadResponsePage.steps.verifyMaximumNumberOfFilesInputField(3);
244
+ uploadResponsePage.steps.switchToPreviewTab();
245
+ uploadResponsePage.steps.verifyUploadedFileLimitCount(0, 3);
246
+ });
247
+
248
+ it('When user increases \'Maximum number of files\'by clicking on increment operator , then file limit should be updated in preview tab', () => {
249
+ uploadResponsePage.steps.switchToEditTab();
250
+ uploadResponsePage.steps.increaseMaximumNumberOfFilesCount();
251
+ uploadResponsePage.steps.verifyMaximumNumberOfFilesInputField(4);
252
+ uploadResponsePage.steps.switchToPreviewTab();
253
+ uploadResponsePage.steps.verifyUploadedFileLimitCount(0, 4);
254
+ });
255
+
256
+ it('When user tries to upload files more than the limit, then warning message \'You have reached the maximum number of files that can be uploaded.\' should be displayed', () => {
257
+ uploadResponsePage.steps.fileUploadAndVerify(['sample.csv', 'sample.xlsx', 'sample.gif', 'sample.jpg']);
258
+ uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
259
+ uploadResponsePage.steps.verifyWarningMessage('You have reached the maximum number of files that can be uploaded.');
260
+ });
261
+
262
+ uploadResponsePage.tests.verifyWarningMessageDisappear();
263
+ });
264
+
265
+ describe('File size limit - Edit tab', () => {
266
+ abortEarlySetup();
267
+ before(() => {
268
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
269
+ cy.barsPreLoaderWait();
270
+ });
271
+
272
+ it('\'File size limit\' label and dropdown should be displayed and in \'File size limit\' dropdown option \'20\' should be selected by default', () => {
273
+ utilities.verifyInnerText(uploadResponsePage.fileSizeLimitLabel(), 'File size limit (MB)');
274
+ utilities.verifyElementVisibilityState(uploadResponsePage.fileSizeLimitLabel(), 'visible');
275
+ utilities.verifyInnerText(uploadResponsePage.fileSizeLimitDropdown(), '20');
276
+ });
277
+
278
+ it('CSS of \'File size limit\' label in default state', { tags: 'css' }, () => {
279
+ utilities.verifyCSS(uploadResponsePage.fileSizeLimitLabel(), {
280
+ 'color': css.color.labels,
281
+ 'font-size': css.fontSize.normal,
282
+ 'font-weight': css.fontWeight.semibold
283
+ });
284
+ });
285
+
286
+ it('Accessibility of \'File size limit\' section in default state', { tags: 'a11y' }, () => {
287
+ cy.checkAccessibility(uploadResponsePage.fileSizeLimitLabel());
288
+ });
289
+
290
+ it(`Clicking on \'File size limit\' dropdown should open a list of options ${fileSizeLimitOptions}`, () => {
291
+ uploadResponsePage.steps.expandFileSizeLimitDropdown();
292
+ uploadResponsePage.steps.verifyFileSizeLimitDropdownOptions(fileSizeLimitOptions);
293
+ });
294
+
295
+ it('CSS of \'File size limit\' dropdown and dropdown content in active state', { tags: 'css' }, () => {
296
+ utilities.verifyCSS(uploadResponsePage.fileSizeLimitDropdown(), {
297
+ 'background-color': css.color.secondaryBtnBg,
298
+ 'border': `1px solid ${css.color.secondaryBtnActive}`
299
+ });
300
+ utilities.verifyCSS(uploadResponsePage.fileSizeLimitDropdownListOptions(5), {
301
+ 'background-color': css.color.transparent
302
+ });
303
+ utilities.verifyCSS(uploadResponsePage.fileSizeLimitDropdownListOptions('20 Selected'), {
304
+ 'color': css.color.liText,
305
+ 'font-size': css.fontSize.default,
306
+ 'font-weight': css.fontWeight.regular,
307
+ 'background-color': css.color.liTextSelectedBg
308
+ });
309
+ });
310
+
311
+ it('Accessibility of \'File size limit\' dropdown and dropdown content in active state', { tags: 'a11y' }, () => {
312
+ cy.checkAccessibility(uploadResponsePage.fileSizeLimitDropdown());
313
+ cy.checkAccessibility(uploadResponsePage.dropdownList());
314
+ });
315
+
316
+ it('When the user selects any option from the expanded\'File size limit\' dropdown, then the dropdown should close', () => {
317
+ uploadResponsePage.steps.selectFileSizeLimit(fileSizeLimitOptions[0]);
318
+ uploadResponsePage.steps.verifyDropdownIsCollapsed();
319
+ });
320
+ });
321
+
322
+ describe('File size limit - Preview tab', () => {
323
+ abortEarlySetup();
324
+ before(() => {
325
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
326
+ cy.barsPreLoaderWait();
327
+ });
328
+
329
+ it('When \'File size limit\' selected by default is 20, then \'Maximum file size: 20MB\' should be displayed and user should be able to upload file within the maximum file limit in preview tab', () => {
330
+ utilities.verifyInnerText(uploadResponsePage.fileSizeLimitDropdown(), '20');
331
+ uploadResponsePage.steps.switchToPreviewTab();
332
+ uploadResponsePage.steps.verifyMaximumFileSizePreviewTab('20MB');
333
+ uploadResponsePage.steps.fileUploadAndVerify(['sample1.jpg']);
334
+ });
335
+
336
+ it('When user selects an option in file size limit dropdown then maximum file size should be updated and user should be able to upload file within the updated file limit in preview tab', () => {
337
+ uploadResponsePage.steps.switchToEditTab();
338
+ uploadResponsePage.steps.expandFileSizeLimitDropdown();
339
+ uploadResponsePage.steps.selectFileSizeLimit(5);
340
+ uploadResponsePage.steps.switchToPreviewTab();
341
+ uploadResponsePage.steps.verifyMaximumFileSizePreviewTab('5MB');
342
+ uploadResponsePage.steps.fileUploadAndVerify(['sample1.jpg']);
343
+ });
344
+
345
+ it('CSS of \'Maximum file size: #MB\' in preview tab', { tags: 'css' }, () => {
346
+ utilities.verifyCSS(uploadResponsePage.maximumFileSize(), {
347
+ 'color': css.color.text,
348
+ 'font-size': css.fontSize.small,
349
+ 'font-weight': css.fontWeight.regular
350
+
351
+ });
352
+ });
353
+
354
+ it('Accessibility of \'Maximum file size: #MB\' in preview tab', { tags: 'a11y' }, () => {
355
+ cy.checkAccessibility(uploadResponsePage.maximumFileSize());
356
+ });
357
+
358
+ it('When the user uploads file exceeding maximum file size set in the edit tab then file upload warning message - \'The file could not be uploaded. The file is *File size in MB* exceeding the maximum size of # MB.\'. should be displayed', () => {
359
+ uploadResponsePage.steps.uploadFile('uploads/20mbFile.png')
360
+ utilities.verifyInnerText(uploadResponsePage.warningMessage(), 'The file could not be uploaded. The file is 21 MB exceeding the maximum size of 5 MB.');
361
+ });
362
+
363
+ it('CSS of File Upload warning message', { tags: 'css' }, () => {
364
+ utilities.verifyCSS(uploadResponsePage.warningMessage(), {
365
+ 'color': css.color.warningMessage,
366
+ 'font-size': css.fontSize.default,
367
+ 'font-weight': css.fontWeight.regular
368
+ });
369
+ });
370
+
371
+ it('Accessibility of File Upload warning message', { tags: 'a11y' }, () => {
372
+ cy.checkAccessibility(uploadResponsePage.warningMessage());
373
+ });
374
+
375
+ uploadResponsePage.tests.verifyWarningMessageDisappear();
376
+ });
377
+ });