itemengine-cypress-automation 1.0.252 → 1.0.253

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAddFeatureRadioButton.js +231 -0
  2. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAddTranscriptRadioButton .js +213 -0
  3. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAudioPlayerStyle.js +148 -0
  4. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabStudentViewSettings.js +249 -0
  5. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerHeaderSectionAndButtons.js +164 -0
  6. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTab.js +444 -0
  7. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabSupportedFileTypes.js +102 -0
  8. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabTranscript.js +134 -0
  9. package/cypress/e2e/ILC/CkEditorEquationEditor/equationEditorBasicFile.js +46 -0
  10. package/cypress/e2e/ILC/CkEditorInsertTable/insertTableEditorBasicFile.js +98 -0
  11. package/cypress/e2e/ILC/CkEditorInsertTable/tableDimension&FooterProperties.js +147 -0
  12. package/cypress/e2e/ILC/CkEditorInsertTable/tableHeaders.js +127 -0
  13. package/cypress/e2e/ILC/CkEditorInsertTable/tableRowAndColumn.js +71 -0
  14. package/cypress/e2e/ILC/CkEditorInsertTable/tableStyle.js +154 -0
  15. package/cypress/e2e/ILC/Compass/compassPreviewContent.smoke.js +1 -0
  16. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +41 -17
  17. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +24 -12
  18. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +47 -20
  19. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +43 -16
  20. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +5 -5
  21. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +52 -21
  22. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionBasic.js +23 -11
  23. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +55 -21
  24. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +53 -21
  25. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +48 -19
  26. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneBasic.js +23 -11
  27. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +47 -17
  28. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +50 -19
  29. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +0 -2
  30. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +3 -0
  31. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +0 -3
  32. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +2 -1
  33. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +4 -4
  34. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +261 -0
  35. package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +4 -2
  36. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +4 -2
  37. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +1 -1
  38. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneAlternateAnswerPopup.js +2 -2
  39. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +5 -3
  40. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -2
  41. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -2
  42. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAlternateAnswerPopup.js +1 -0
  43. package/cypress/e2e/ILC/GridFill/customizeLayoutFillColor.js +3 -0
  44. package/cypress/e2e/ILC/GridFill/customizeLayoutFillImageBackgroundImage.js +15 -0
  45. package/cypress/e2e/ILC/GridFill/customizeLayoutSectionShadeCellsGridBorders.js +10 -0
  46. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +2 -1
  47. package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +3 -2
  48. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +56 -8
  49. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +1 -1
  50. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  51. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +1 -1
  52. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +4 -4
  53. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  54. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +1 -1
  55. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +3 -3
  56. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +2 -2
  57. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +16 -16
  58. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViewsFormulaTemplate.smoke.js +4 -5
  59. package/cypress/e2e/ILC/TextEntryMath/customSettings.js +8 -22
  60. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +19 -19
  61. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -2
  62. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +5 -5
  63. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +1 -4
  64. package/cypress/e2e/ILC/ToolAudioPlayerNew/studentViewSettings.js +8 -2
  65. package/cypress/fixtures/theme/ilc.json +9 -5
  66. package/cypress/pages/components/ckEditorAudioPlayerComponent.js +615 -0
  67. package/cypress/pages/components/ckEditorEquationEditorComponent.js +41 -0
  68. package/cypress/pages/components/ckEditorInsertTableComponent.js +741 -0
  69. package/cypress/pages/components/essayResponseCommonComponents.js +145 -7
  70. package/cypress/pages/components/imageCanvasComponent.js +2 -2
  71. package/cypress/pages/components/index.js +2 -1
  72. package/cypress/pages/components/layoutSectionComponent.js +25 -4
  73. package/cypress/pages/components/numberLineCommonComponent.js +39 -0
  74. package/cypress/pages/components/optionsWrapperComponent.js +1 -1
  75. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -0
  76. package/cypress/pages/dragAndDropIntoCategoriesPage.js +28 -0
  77. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -1
  78. package/cypress/pages/graphingPage.js +8 -8
  79. package/cypress/pages/gridFillPage.js +11 -11
  80. package/cypress/pages/multipleSelectionPage.js +12 -0
  81. package/cypress/pages/singleSelectionPage.js +1 -1
  82. package/cypress/pages/textEntryMathPage.js +18 -0
  83. package/cypress/pages/textEntryMathWithImagePage.js +15 -2
  84. package/cypress/pages/textSelectionPage.js +7 -1
  85. package/package.json +1 -1
@@ -0,0 +1,249 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { multipleSelectionPage } from "../../../pages";
3
+ import constants from "../../../fixtures/constants";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+ const customizeUIControlButtons = [multipleSelectionPage.customizeControlPauseButton, multipleSelectionPage.customizeControlSeekButton, multipleSelectionPage.customizeControlPlayBackSpeedButton, multipleSelectionPage.customizeControlAddPinButton, multipleSelectionPage.customizeControlForwardBackwardButton];
7
+ const customizeUIControlButtonsLabel = ['Pause', 'Seek', 'Playback speed', 'Add pin', 'Forward/ backward'];
8
+
9
+ describe('Audio player: Edit tab', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Student view settings section', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
18
+ cy.barsPreLoaderWait();
19
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
20
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
21
+ });
22
+
23
+ it('\'Student View Settings\' label, \'Customize player layout settings\' dropdown along with \'Allow students to download the audio\' and \'Limit play attempts\' check box should be displayed. By default, checkboxes should be unselected', () => {
24
+ utilities.verifyElementVisibilityState(multipleSelectionPage.studentViewSettingLabel(), 'visible');
25
+ utilities.verifyInnerText(multipleSelectionPage.studentViewSettingLabel(), 'Student view settings');
26
+ utilities.verifyElementVisibilityState(multipleSelectionPage.customizePlayerLayoutSettings(), 'visible');
27
+ utilities.verifyInnerText(multipleSelectionPage.customizePlayerLayoutSettings(), 'Customize player layout settings');
28
+ utilities.verifyElementVisibilityState(multipleSelectionPage.allowStudentsToDownloadAudioLabel(), 'visible');
29
+ utilities.verifyInnerText(multipleSelectionPage.allowStudentsToDownloadAudioLabel(), 'Allow students to download the audio');
30
+ utilities.verifyElementVisibilityState(multipleSelectionPage.limitPlayAttemptsLabel(), 'visible');
31
+ utilities.verifyInnerText(multipleSelectionPage.limitPlayAttemptsLabel(), 'Limit play attempts');
32
+ });
33
+
34
+ it('CSS of Student view settings section', { tags: 'css' }, () => {
35
+ utilities.verifyCSS(multipleSelectionPage.studentViewSettingLabel(), {
36
+ 'color': 'rgb(72, 72, 72)',
37
+ 'font-size': '12px',
38
+ 'font-weight': '700'
39
+ });
40
+ utilities.verifyCSS(multipleSelectionPage.customizePlayerLayoutSettings(), {
41
+ 'color': 'rgb(0, 0, 0)',
42
+ 'font-size': '12px',
43
+ 'font-weight': '400'
44
+ });
45
+ utilities.verifyCSS(multipleSelectionPage.allowStudentsToDownloadAudioLabel(), {
46
+ 'color': 'rgba(0, 0, 0, 0.87)',
47
+ 'font-size': '12px',
48
+ 'font-weight': '400'
49
+ });
50
+ utilities.verifyCSS(multipleSelectionPage.limitPlayAttemptsLabel(), {
51
+ 'color': 'rgba(0, 0, 0, 0.87)',
52
+ 'font-size': '12px',
53
+ 'font-weight': '400'
54
+ });
55
+ });
56
+ });
57
+
58
+ describe('\'Customize player layout settings\' accordion', () => {
59
+ abortEarlySetup();
60
+ before(() => {
61
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
62
+ cy.barsPreLoaderWait();
63
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
64
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
65
+ });
66
+
67
+ it('\'Customize player layout settings\' label should be displayed along with chevron. The accordion should be displayed in collapsed state by default.', () => {
68
+ utilities.verifyInnerText(multipleSelectionPage.customizeUIControlAccordionLabel(), 'Customize player layout settings');
69
+ utilities.verifyElementVisibilityState(multipleSelectionPage.customizeUIControlAccordionLabel(), 'visible');
70
+ multipleSelectionPage.steps.verifyCustomizeUIControlAccordionChevronIcon();
71
+ multipleSelectionPage.steps.verifyCustomizeUIControlAccordionCollapsedState();
72
+ });
73
+
74
+ it('CSS of \'Customize player layout settings\' section if accordion is in collapse state', { tags: 'css' }, () => {
75
+ utilities.verifyCSS(multipleSelectionPage.customizeUIControlAccordionLabel(), {
76
+ 'color': 'rgb(0, 0, 0)',
77
+ 'font-size': '12px',
78
+ 'font-weight': '400'
79
+ });
80
+ utilities.verifyCSS(multipleSelectionPage.customizeUIControlsForPlaybackChevronIcon(), {
81
+ 'fill': 'rgb(0, 0, 0)',
82
+ });
83
+ });
84
+
85
+ it('User should be able to expand \'Customize player layout settings\' accordion and Pause, Seek, Play back speed, Add Pin and Forward/Backward option should be displayed in \'Customize player layout settings\' accordion. By default all options should be selected and \'Uncheck all\' button should be present in active state', () => {
86
+ multipleSelectionPage.steps.clickOnCustomizeUIControlAccordion();
87
+ multipleSelectionPage.steps.verifyCustomizeUIControlAccordionExpandedState();
88
+ utilities.verifyElementVisibilityState(multipleSelectionPage.unCheckAllButton(), 'visible');
89
+ utilities.verifyInnerText(multipleSelectionPage.unCheckAllButton(), 'Uncheck all');
90
+ utilities.verifyElementNotDisabled(multipleSelectionPage.unCheckAllButton());
91
+ utilities.verifyInnerText(multipleSelectionPage.customizeUIControlAccordion(), 'Customize player layout settings');
92
+ customizeUIControlButtons.forEach((button, index) => {
93
+ utilities.verifyInnerText(button(), customizeUIControlButtonsLabel[index]);
94
+ utilities.verifyElementVisibilityState(button(), 'visible');
95
+ });
96
+ multipleSelectionPage.steps.verifyCustomizeControlPauseButtonSelectedState();
97
+ multipleSelectionPage.steps.verifyCustomizeControlSeekButtonSelectedState();
98
+ multipleSelectionPage.steps.verifyCustomizeControlPlayBackSpeedButtonSelectedState();
99
+ multipleSelectionPage.steps.verifyCustomizeControlAddPinButtonSelectedState();
100
+ multipleSelectionPage.steps.verifyCustomizeControlForwardBackwardButtonSelectedState();
101
+ });
102
+
103
+ it('CSS of options in \'Customize player layout settings\' section', { tags: 'css' }, () => {
104
+ customizeUIControlButtons.forEach((button) => {
105
+ utilities.verifyCSS(button(), {
106
+ 'color': 'rgb(0, 0, 0)',
107
+ 'font-size': '14px',
108
+ 'font-weight': '500'
109
+ });
110
+ utilities.verifyCSS(button().find('svg'), {
111
+ 'fill': 'rgb(0, 0, 0)'
112
+ });
113
+ utilities.verifyCSS(button()
114
+ .find('div[class*="SelectionButtonstyles__SelectedWrapper"] svg'), {
115
+ 'fill': 'rgb(0, 117, 255)'
116
+ });
117
+ });
118
+ });
119
+
120
+ it('Accessibility of options in \'Customize player layout settings\' section', { tags: 'a11y' }, () => {
121
+ cy.checkAccessibility(multipleSelectionPage.customizeUIControlAccordion().parent('div'));
122
+ });
123
+
124
+ it('User should be able to deselect all options from \'Customize player layout settings\' accordion and \'Uncheck all\' button will become disabled', () => {
125
+ multipleSelectionPage.steps.clickOnCustomizeControlPauseButton();
126
+ multipleSelectionPage.steps.clickOnCustomizeControlSeekButton();
127
+ multipleSelectionPage.steps.clickOnCustomizeControlPlayBackSpeedButton();
128
+ multipleSelectionPage.steps.clickOnCustomizeControlAddPinButton();
129
+ multipleSelectionPage.steps.clickOnCustomizeControlForwardBackwardButton();
130
+ multipleSelectionPage.steps.verifyCustomizeControlPauseButtonDeselectedState();
131
+ multipleSelectionPage.steps.verifyCustomizeControlSeekButtonDeselectedState();
132
+ multipleSelectionPage.steps.verifyCustomizeControlPlayBackSpeedButtonDeselectedState();
133
+ multipleSelectionPage.steps.verifyCustomizeControlAddPinButtonDeselectedState();
134
+ multipleSelectionPage.steps.verifyCustomizeControlForwardBackwardButtonDeselectedState();
135
+ multipleSelectionPage.steps.verifyUnCheckAllButtonInDisabledState();
136
+ });
137
+
138
+ it('User should be able to deselect all options from \'Customize player layout settings\' accordion using the \'Uncheck all\' button', () => {
139
+ multipleSelectionPage.steps.clickOnCustomizeControlPauseButton();
140
+ multipleSelectionPage.steps.clickOnCustomizeControlSeekButton();
141
+ multipleSelectionPage.steps.clickOnCustomizeControlPlayBackSpeedButton();
142
+ multipleSelectionPage.steps.clickOnCustomizeControlAddPinButton();
143
+ multipleSelectionPage.steps.clickOnCustomizeControlForwardBackwardButton();
144
+ utilities.verifyElementNotDisabled(multipleSelectionPage.unCheckAllButton());
145
+ multipleSelectionPage.steps.clickOnUnCheckAllButton();
146
+ multipleSelectionPage.steps.verifyCustomizeControlPauseButtonDeselectedState();
147
+ multipleSelectionPage.steps.verifyCustomizeControlSeekButtonDeselectedState();
148
+ multipleSelectionPage.steps.verifyCustomizeControlPlayBackSpeedButtonDeselectedState();
149
+ multipleSelectionPage.steps.verifyCustomizeControlAddPinButtonDeselectedState();
150
+ multipleSelectionPage.steps.verifyCustomizeControlForwardBackwardButtonDeselectedState();
151
+ multipleSelectionPage.steps.verifyUnCheckAllButtonInDisabledState();
152
+ });
153
+
154
+ it('CSS of deselected options in \'Customize player layout settings\' accordion', { tags: 'css' }, () => {
155
+ customizeUIControlButtons.forEach((button) => {
156
+ utilities.verifyCSS(button(), {
157
+ 'color': 'rgb(0, 0, 0)',
158
+ 'font-size': '14px',
159
+ 'font-weight': '500'
160
+ });
161
+ });
162
+ });
163
+
164
+ it('Accessibility of deselected options in \'Customize player layout settings\' accordion', { tags: 'a11y' }, () => {
165
+ cy.checkAccessibility(multipleSelectionPage.customizeUIControlAccordion().parents('div'));
166
+ });
167
+
168
+ it('User should be able to collapse \'Customize player layout settings\' accordion.', () => {
169
+ multipleSelectionPage.steps.clickOnCustomizeUIControlAccordion();
170
+ multipleSelectionPage.steps.verifyCustomizeUIControlAccordionCollapsedState();
171
+ });
172
+ });
173
+
174
+ describe('Playback Limit Section', () => {
175
+ abortEarlySetup();
176
+ before(() => {
177
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
178
+ cy.barsPreLoaderWait();
179
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
180
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
181
+ multipleSelectionPage.steps.clickOnLimitPlayAttempts();
182
+ });
183
+
184
+ it('\'Playback Limit\' label and empty input field should be displayed', () => {
185
+ utilities.verifyInnerText(multipleSelectionPage.playbackLimitLabel(), 'Playback Limit');
186
+ utilities.verifyElementVisibilityState(multipleSelectionPage.playbackLimitLabel(), 'visible');
187
+ utilities.verifyInnerText(multipleSelectionPage.playbackLimitInputField(), '');
188
+ utilities.verifyElementVisibilityState(multipleSelectionPage.playbackLimitInputField(), 'visible');
189
+ });
190
+
191
+ it('When the user focuses in and out of the \'Playback Limit\' input field, no error message should be displayed', () => {
192
+ multipleSelectionPage.steps.focusInAndFocusOutOfPlaybackLimitInputField();
193
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadFileSectionErrorMessage(), 'hidden');
194
+ })
195
+
196
+ it('CSS of Playback Limit section', { tags: 'css' }, () => {
197
+ utilities.verifyCSS(multipleSelectionPage.playbackLimitLabel(), {
198
+ 'color': 'rgb(0, 0, 0)',
199
+ 'font-size': '12px',
200
+ 'font-weight': '400'
201
+ });
202
+ utilities.verifyCSS(multipleSelectionPage.playbackLimitInputField(), {
203
+ 'color': 'rgba(0, 0, 0, 0.87)',
204
+ 'font-size': '12px',
205
+ 'font-weight': '400'
206
+ });
207
+ });
208
+
209
+ //Note: Accessibility is already covered in header file
210
+
211
+ it('When user adds decimal values or alphanumeric values then only numeric values should be displayed in the \'Playback Limit\' input field', () => {
212
+ multipleSelectionPage.steps.setPlaybackLimit('.1!@#ab0.e0');
213
+ multipleSelectionPage.steps.verifyPlaybackLimitInputFieldValue('100');
214
+ });
215
+
216
+ it('Accessibility of Playback Limit section', { tags: 'a11y' }, () => {
217
+ cy.checkAccessibility(multipleSelectionPage.playbackLimitLabel().parents('[class*="AudioPlayerFormstyles__PlaybackLimit"]'));
218
+ });
219
+ });
220
+
221
+ describe('\'Allow students to download the audio\' checkbox', () => {
222
+ abortEarlySetup();
223
+ before(() => {
224
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
225
+ cy.barsPreLoaderWait();
226
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
227
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
228
+ });
229
+
230
+ it('\'Allow students to download the audio\' label and checkbox should be displayed. By default the \'Allow students to download the audio\' checkbox should be unchecked.', () => {
231
+ utilities.verifyInnerText(multipleSelectionPage.allowStudentsToDownloadAudioLabel(), 'Allow students to download the audio');
232
+ utilities.verifyElementVisibilityState(multipleSelectionPage.allowStudentsToDownloadAudioLabel(), 'visible');
233
+ multipleSelectionPage.steps.verifyAllowStudentsToDownloadAudioCheckboxNotChecked();
234
+ });
235
+
236
+ it('CSS of \'Allow students to download the audio\' section - unchecked state', { tags: 'css' }, () => {
237
+ utilities.verifyCSS(multipleSelectionPage.allowStudentsToDownloadAudioLabel().parent().find('svg'), {
238
+ 'color': 'rgb(13, 71, 161)'
239
+ });
240
+ });
241
+
242
+ //Note: Accessibility is already covered in header file
243
+
244
+ it('The user should be able to check the \'Allow students to download the audio\' checkbox', () => {
245
+ multipleSelectionPage.steps.checkUncheckAllowStudentsToDownloadAudioCheckbox();
246
+ multipleSelectionPage.steps.verifyAllowStudentsToDownloadAudioCheckboxChecked();
247
+ });
248
+ });
249
+ });
@@ -0,0 +1,164 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { multipleSelectionPage } from "../../../pages";
3
+ import constants from "../../../fixtures/constants";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+ describe('Audio player: Header section, buttons and saving item', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Header section contents', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
16
+ cy.barsPreLoaderWait();
17
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
18
+ });
19
+
20
+ multipleSelectionPage.tests.verifyCkEditorToolHeader('Audio Player');
21
+ });
22
+
23
+ describe('Audio player popup: OK button', () => {
24
+ abortEarlySetup();
25
+ before(() => {
26
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
27
+ cy.barsPreLoaderWait();
28
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
29
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
30
+ });
31
+
32
+ describe('OK button Contents', () => {
33
+ it('\'OK\' button should be displayed in popup.', () => {
34
+ utilities.verifyInnerText(multipleSelectionPage.okButton(), 'OK');
35
+ utilities.verifyElementVisibilityState(multipleSelectionPage.okButton(), 'visible');
36
+ });
37
+
38
+ it('CSS of \'OK\' button', { tags: 'css' }, () => {
39
+ utilities.verifyCSS(multipleSelectionPage.okButton(), {
40
+ 'background-color': 'rgb(13, 71, 161)'
41
+ });
42
+ utilities.verifyCSS(multipleSelectionPage.okButton().find('p'), {
43
+ 'color': 'rgb(255, 255, 255)',
44
+ 'font-size': '12px',
45
+ 'font-weight': '700'
46
+ });
47
+ });
48
+ });
49
+
50
+ describe('Validation error messages', () => {
51
+ it('When user switches to \'Add Audio URL\' and has made no edits and clicks on \'OK\' button, user should get \'Error: Source URL is required.\' error message below \'Source URL\' input field and audio player popup should not close', () => {
52
+ multipleSelectionPage.steps.clickOnAddUrlRadioButton();
53
+ multipleSelectionPage.steps.clickOnOKButton();
54
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'visible');
55
+ utilities.verifyInnerText(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'Error: Source URL is required.');
56
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolDialogBox(), 'visible');
57
+ });
58
+
59
+ it('\'Error: Source URL is required.\' validation error message should disappear when required input field is filled', () => {
60
+ multipleSelectionPage.steps.enterTextInSourceURLInputField(constants.sampleMp3Link);
61
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'hidden');
62
+ });
63
+
64
+ it('When user adds invalid source URL in \'Source URL\' input field and clicks on \'OK\' button, validation error message should be displayed below source URL input field and popup should not close', () => {
65
+ multipleSelectionPage.steps.clearTextInSourceURLInputField();
66
+ multipleSelectionPage.steps.enterTextInSourceURLInputField(constants.sampleJPEGLink);
67
+ multipleSelectionPage.steps.clickOnOKButton();
68
+ utilities.verifyInnerText(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'Error: The provided URL does not link to a supported audio file. Please enter a URL for a MP3, WAV, AAC file.');
69
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolDialogBox(), 'visible');
70
+ });
71
+
72
+ it('When user adds valid source URL in \'Source URL\' input field and clicks on \'OK\' button, validation error message should disappear, audio player popup should close and audio player should be displayed in prompt field', () => {
73
+ multipleSelectionPage.steps.clearTextInSourceURLInputField();
74
+ multipleSelectionPage.steps.enterTextInSourceURLInputField(constants.sampleMp3Link);
75
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'hidden');
76
+ multipleSelectionPage.steps.clickOnOKButton();
77
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolDialogBox(), 'notExist');
78
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolAudioPlayerBlock(), 'visible');
79
+ });
80
+
81
+ it('When user selects \'Upload audio file\' radio button and clicks on \'OK\' button without uploading an audio file, validation error message should be displayed below \'Upload\' section and audio player popup should not close', () => {
82
+ multipleSelectionPage.steps.clearInPromptInputField();
83
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
84
+ multipleSelectionPage.steps.clickOnAddAudioRadioButton();
85
+ multipleSelectionPage.steps.clickOnOKButton();
86
+ utilities.verifyInnerText(multipleSelectionPage.uploadFileSectionErrorMessage(), 'Error: Audio file is required.');
87
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolDialogBox(), 'visible');
88
+ });
89
+
90
+ it('When user uploads valid audio file in \'Upload\' section, \'Error: Audio file is required.\' validation error message should disappear', () => {
91
+ multipleSelectionPage.steps.uploadFile('sample.mp3');
92
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadFileSectionErrorMessage(), 'hidden');
93
+ });
94
+
95
+ it('When the user uploads an audio and transcript file that is not supported and clicks on \'OK\' button, validation error message should be displayed and popup should not close', () => {
96
+ multipleSelectionPage.steps.uploadFile('sample.mp4');
97
+ multipleSelectionPage.steps.uploadTranscriptFile('sample.doc');
98
+ multipleSelectionPage.steps.clickOnOKButton();
99
+ utilities.verifyInnerText(multipleSelectionPage.uploadFileSectionErrorMessage(), 'Error: The file type is not supported. Please upload a file with the following supported formats: MP3, WAV, AAC.');
100
+ utilities.verifyInnerText(multipleSelectionPage.uploadTranscriptFileSectionErrorMessage(), 'Error: The file type is not supported. Please upload a file with the following supported formats: TXT.');
101
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolDialogBox(), 'visible');
102
+ });
103
+
104
+ it('When user uploads valid audio file in \'Upload\' section and clicks on \'OK\' button, audio player popup should close and audio player should be displayed in prompt field', () => {
105
+ multipleSelectionPage.steps.uploadFile('sample.mp3');
106
+ utilities.verifyElementVisibilityState(multipleSelectionPage.fileUploadProgressBar(), 'hidden');
107
+ multipleSelectionPage.steps.uploadTranscriptFile('sample.txt');
108
+ multipleSelectionPage.steps.clickOnOKButton();
109
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolDialogBox(), 'notExist');
110
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolAudioPlayerBlock(), 'visible');
111
+ });
112
+
113
+ it('Placeholder block should be displayed for audio player along with placeholder text \'Audio Player - Bar Style\' and icon. On hovering over audio player block, drag handle should be displayed for each audio player present in prompt field.', () => {
114
+ utilities.verifyInnerText(multipleSelectionPage.ckEditorToolAudioPlayerBlock(), 'Audio Player - Bar Style');
115
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolAudioPlayerBlock().find('.audioplayer-icon'), 'visible');
116
+ utilities.hoverOverElement(multipleSelectionPage.ckEditorToolAudioPlayerBlock());
117
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolAudioPlayerDragHandle(), 'visible');
118
+ });
119
+
120
+ it('CSS of audio player block displayed in prompt field', { tags: 'css' }, () => {
121
+ utilities.verifyCSS(multipleSelectionPage.ckEditorToolAudioPlayerBlock().find('.audioplayer-type'), {
122
+ 'background-color': 'rgb(148, 148, 148)',
123
+ 'color': 'rgb(0, 0, 46)',
124
+ 'font-size': '12px',
125
+ 'font-weight': '400'
126
+ });
127
+ utilities.verifyCSS(multipleSelectionPage.ckEditorToolAudioPlayerBlock().find('.audioplayer-icon'), {
128
+ 'background-color': 'rgb(148, 148, 148)',
129
+ 'color': 'rgb(0, 0, 46)',
130
+ 'font-size': '16px',
131
+ 'font-weight': '400'
132
+ });
133
+ });
134
+ });
135
+ });
136
+
137
+ describe('Audio player popup: Cancel button', () => {
138
+ abortEarlySetup();
139
+ before(() => {
140
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
141
+ cy.barsPreLoaderWait();
142
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
143
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
144
+ });
145
+ it('\'Cancel\' button should be displayed in popup.', () => {
146
+ utilities.verifyInnerText(multipleSelectionPage.cancelButton(), 'Cancel');
147
+ utilities.verifyElementVisibilityState(multipleSelectionPage.cancelButton(), 'visible');
148
+ });
149
+
150
+ it('CSS of \'Cancel\' button', { tags: 'css' }, () => {
151
+ utilities.verifyCSS(multipleSelectionPage.cancelButton(), {
152
+ 'background-color': 'rgb(248, 248, 248)',
153
+ 'color': 'rgb(72, 72, 72)',
154
+ 'font-size': '12px',
155
+ 'font-weight': '700'
156
+ });
157
+ });
158
+
159
+ it(`When user clicks on cancel present in popup, 'Audio Player' popup should close.`, () => {
160
+ multipleSelectionPage.steps.clickOnCancelButton();
161
+ utilities.verifyElementVisibilityState(multipleSelectionPage.ckEditorToolDialogBox(), 'notExist');
162
+ });
163
+ });
164
+ });