itemengine-cypress-automation 1.0.253-TEMSmokeTestUpdates-82559a5.0 → 1.0.254-UpdatedRepo4thNov-c5b0050.0

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,231 @@
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: Edit tab', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('\'Add\' feature radio buttons', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
16
+ cy.barsPreLoaderWait();
17
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
18
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
19
+ });
20
+
21
+ it('\'Upload audio file\' and \'Add audio URL\' radio buttons should be displayed. By default \'Add audio URL\' button should be selected', () => {
22
+ utilities.verifyInnerText(multipleSelectionPage.addUrlButton(), 'Add audio URL');
23
+ utilities.verifyElementVisibilityState(multipleSelectionPage.addUrlButton(), 'visible');
24
+ multipleSelectionPage.steps.verifyAddAudioURLUncheckedState();
25
+ utilities.verifyInnerText(multipleSelectionPage.addAudioButton(), 'Upload audio file');
26
+ utilities.verifyElementVisibilityState(multipleSelectionPage.addAudioButton(), 'visible');
27
+ multipleSelectionPage.steps.verifyUploadAudioFileCheckedState();
28
+ });
29
+
30
+ it('CSS of Add feature radio buttons', { tags: 'css' }, () => {
31
+ utilities.verifyCSS(multipleSelectionPage.addAudioURLRadioButton().parent().find('svg'), {
32
+ 'fill': 'rgb(118, 118, 118)'
33
+ });
34
+ utilities.verifyCSS(multipleSelectionPage.uploadAudioFileRadioButton().parent().find('svg'), {
35
+ 'fill': 'rgb(0, 117, 255)'
36
+ });
37
+ utilities.verifyCSS(multipleSelectionPage.addUrlButton(), {
38
+ 'color': 'rgb(0, 0, 0)',
39
+ 'font-size': '12px',
40
+ 'font-weight': '400'
41
+ });
42
+ utilities.verifyCSS(multipleSelectionPage.addAudioButton(), {
43
+ 'color': 'rgb(0, 0, 0)',
44
+ 'font-size': '12px',
45
+ 'font-weight': '400'
46
+ });
47
+ });
48
+
49
+ //Note: Accessibility is already covered in header file
50
+ });
51
+
52
+ describe('\'Add Audio URL\' section', () => {
53
+ abortEarlySetup();
54
+ before(() => {
55
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
56
+ cy.barsPreLoaderWait();
57
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
58
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
59
+ multipleSelectionPage.steps.clickOnAddUrlRadioButton();
60
+ });
61
+
62
+ it('\'Source URL\' label and input field should be displayed. By default, the source url input field should be empty', () => {
63
+ utilities.verifyInnerText(multipleSelectionPage.sourceUrlLabel(), 'Source URL');
64
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlLabel(), 'visible');
65
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlInputField(), 'visible');
66
+ utilities.verifyInnerText(multipleSelectionPage.sourceUrlInputField(), '');
67
+ });
68
+
69
+ it('CSS of \'Add audio URL\' Section', { tags: 'css' }, () => {
70
+ utilities.verifyCSS(multipleSelectionPage.sourceUrlLabel(), {
71
+ 'color': 'rgb(0, 0, 0)',
72
+ 'font-size': '12px',
73
+ 'font-weight': '400'
74
+ });
75
+ utilities.verifyCSS(multipleSelectionPage.sourceUrlInputField(), {
76
+ 'color': 'rgba(0, 0, 0, 0.87)',
77
+ 'font-size': '12px',
78
+ 'font-weight': '400'
79
+ });
80
+ });
81
+
82
+ it('When user focuses in and out of the \'Source URL\' input field, \'Error: Source URL is required.\' error message should be displayed below \'Source URL\' input field.', () => {
83
+ multipleSelectionPage.steps.focusInAndFocusOutOfSourceURLInputField();
84
+ utilities.verifyInnerText(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'Error: Source URL is required.');
85
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'visible');
86
+ });
87
+
88
+ multipleSelectionPage.tests.verifyErrorMessageCSSAndA11y();
89
+
90
+ it('When user adds a MP3 file in \'Source URL\' input field, \'Error: Source URL is required.\' validation message should disappear', () => {
91
+ multipleSelectionPage.steps.enterTextInSourceURLInputField(constants.sampleMp3Link);
92
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'hidden');
93
+ });
94
+
95
+ it('When user adds invalid file format URL in \'Source URL\' input field, \'Error: The provided URL does not link to a supported audio file. Please enter a URL for a MP3, WAV, AAC file.\' validation message should be displayed', () => {
96
+ multipleSelectionPage.steps.clearTextInSourceURLInputField();
97
+ multipleSelectionPage.steps.enterTextInSourceURLInputField(constants.foxImageLink);
98
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'visible');
99
+ 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.');
100
+ });
101
+
102
+ multipleSelectionPage.tests.verifyErrorMessageCSSAndA11y();
103
+
104
+ it('When user adds valid file URL in \'Source URL\' input field, \'Error: The provided URL does not link to a supported audio file. Please enter a URL for a MP3, WAV, AAC file.\' validation message should disappear', () => {
105
+ multipleSelectionPage.steps.clearTextInSourceURLInputField();
106
+ multipleSelectionPage.steps.enterTextInSourceURLInputField(constants.sampleMp3Link);
107
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'hidden');
108
+ });
109
+
110
+ it('When user adds invalid text in \'Source URL\' input field, \'Error: The provided URL does not link to a supported audio file. Please enter a URL for a MP3, WAV, AAC file.\' validation message should be displayed', () => {
111
+ multipleSelectionPage.steps.clearTextInSourceURLInputField();
112
+ multipleSelectionPage.steps.enterTextInSourceURLInputField('Invalid text');
113
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlInputFieldErrorMessage(), 'visible');
114
+ 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.');
115
+ });
116
+ });
117
+
118
+ describe('\'Upload audio file\' section', () => {
119
+ abortEarlySetup();
120
+ before(() => {
121
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
122
+ cy.barsPreLoaderWait();
123
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
124
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
125
+ });
126
+
127
+ it('On selecting \'Upload audio file\' radio button, the \'Add Audio URL\' radio button should get unchecked', () => {
128
+ multipleSelectionPage.steps.clickOnUploadAudioFileRadioButton();
129
+ multipleSelectionPage.steps.verifyUploadAudioFileCheckedState();
130
+ multipleSelectionPage.steps.verifyAddAudioURLUncheckedState();
131
+ });
132
+
133
+ it('\'Source URL\' label and input field should not be displayed', () => {
134
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlLabel(), 'notExist');
135
+ utilities.verifyElementVisibilityState(multipleSelectionPage.sourceUrlInputField(), 'notExist');
136
+ });
137
+
138
+ it('\'Upload\' label should be displayed', () => {
139
+ utilities.verifyInnerText(multipleSelectionPage.uploadLabel(), 'Upload');
140
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadLabel(), 'visible');
141
+ });
142
+
143
+ it('\'File name\' label should be displayed', () => {
144
+ utilities.verifyInnerText(multipleSelectionPage.fileNameLabel(), 'File name');
145
+ utilities.verifyElementVisibilityState(multipleSelectionPage.fileNameLabel(), 'visible');
146
+ });
147
+
148
+ it('\'Choose File\' button should be displayed', () => {
149
+ utilities.verifyInnerText(multipleSelectionPage.chooseFileButton(), 'Choose File');
150
+ utilities.verifyElementVisibilityState(multipleSelectionPage.chooseFileButton(), 'visible');
151
+ });
152
+
153
+ it('By default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
154
+ utilities.verifyInnerText(multipleSelectionPage.noFileChosenLabel(), 'No file chosen');
155
+ utilities.verifyElementVisibilityState(multipleSelectionPage.noFileChosenLabel(), 'visible');
156
+ });
157
+
158
+ it('CSS of \'Upload audio file\' section', { tags: 'css' }, () => {
159
+ utilities.verifyCSS(multipleSelectionPage.uploadLabel(), {
160
+ 'color': 'rgb(0, 0, 0)',
161
+ 'font-size': '12px',
162
+ 'font-weight': '400'
163
+ });
164
+ utilities.verifyCSS(multipleSelectionPage.fileNameLabel(), {
165
+ 'color': 'rgb(72, 72, 72)',
166
+ 'font-size': '12px',
167
+ 'font-weight': '400'
168
+ });
169
+ utilities.verifyCSS(multipleSelectionPage.noFileChosenLabel(), {
170
+ 'color': 'rgb(0, 0, 0)',
171
+ 'font-size': '12px',
172
+ 'font-weight': '400'
173
+ });
174
+ utilities.verifyCSS(multipleSelectionPage.chooseFileButton(), {
175
+ 'background-color': 'rgb(248, 248, 248)',
176
+ 'border': '1px solid rgb(188, 188, 188)',
177
+ 'color': 'rgb(72, 72, 72)',
178
+ 'font-size': '12px',
179
+ 'font-weight': '700'
180
+ });
181
+ });
182
+
183
+ it('Accessibility of \'Upload audio file\' section', { tags: 'a11y' }, () => {
184
+ cy.checkAccessibility(multipleSelectionPage.uploadAudioFileRadioButton().parents('[class*="AddAudioPopupstyles__FormContentWrapper"]'));
185
+ });
186
+
187
+ it('When the user adds the audio file and file upload is inprogress, file name and progress bar should be displayed below \'File name\' label. Progress bar should disappear once file is uploaded', () => {
188
+ multipleSelectionPage.steps.uploadFile('sample.mp3');
189
+ utilities.verifyElementVisibilityState(multipleSelectionPage.fileUploadProgressBar(), 'visible');
190
+ utilities.verifyInnerText(multipleSelectionPage.uploadedFileNameLabel(), 'sample.mp3');
191
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadedFileNameLabel(), 'visible');
192
+ utilities.verifyElementVisibilityState(multipleSelectionPage.fileUploadProgressBar(), 'hidden');
193
+ });
194
+
195
+ it('CSS of progress bar and file name when file upload is in progress', { tags: 'css' }, () => {
196
+ multipleSelectionPage.steps.uploadFile('sample1.mp3');
197
+ multipleSelectionPage.fileUploadProgressBar()
198
+ .verifyPseudoClassBeforeProperty('background-color', 'rgb(74, 147, 224)')
199
+ });
200
+
201
+ it('Accessibility of progress bar and file name when file upload is in progress', { tags: 'a11y' }, () => {
202
+ multipleSelectionPage.steps.uploadFile('sample.mp3');
203
+ cy.checkAccessibility(multipleSelectionPage.uploadAudioFileRadioButton().parents('[class*="AddAudioPopupstyles__FormContentWrapper"]'));
204
+ });
205
+
206
+ it('When user clicks on \'Choose file\' button again and upload another audio file, previously uploaded audio file should get replaced with new audio file', () => {
207
+ multipleSelectionPage.steps.uploadFile('sample2.mp3');
208
+ utilities.verifyElementVisibilityState(multipleSelectionPage.fileUploadProgressBar(), 'hidden');
209
+ utilities.verifyInnerText(multipleSelectionPage.uploadedFileNameLabel(), 'sample2.mp3');
210
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadedFileNameLabel(), 'visible');
211
+ });
212
+
213
+ it('When the user uploads a file that is not supported, following error message should be displayed: \'Error: The file type is not supported. Please upload a file with the following supported formats: MP3, WAV, AAC.\'', () => {
214
+ multipleSelectionPage.steps.uploadFile('sample.mp4');
215
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadFileSectionErrorMessage(), 'visible');
216
+ utilities.verifyInnerText(multipleSelectionPage.uploadFileSectionErrorMessage(), 'Error: The file type is not supported. Please upload a file with the following supported formats: MP3, WAV, AAC.');
217
+ });
218
+
219
+ multipleSelectionPage.tests.verifyErrorMessageCSSAndA11y();
220
+
221
+ it('When user upload supported format of audio file, error message should disappear', () => {
222
+ multipleSelectionPage.steps.uploadFile('sample2.mp3');
223
+ utilities.verifyElementVisibilityState(multipleSelectionPage.fileUploadProgressBar(), 'hidden');
224
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadFileSectionErrorMessage(), 'hidden');
225
+ });
226
+
227
+ it('Accessibility of \'Upload audio file\' section once file is uploaded', { tags: 'a11y' }, () => {
228
+ cy.checkAccessibility(multipleSelectionPage.uploadAudioFileRadioButton().parents('[class*="AddAudioPopupstyles__FormContentWrapper"]'));
229
+ });
230
+ });
231
+ });
@@ -0,0 +1,213 @@
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: Edit tab', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('\'Transcript\' feature radio buttons', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
16
+ cy.barsPreLoaderWait();
17
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
18
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
19
+ multipleSelectionPage.steps.clickOnAddUrlRadioButton();
20
+ });
21
+
22
+ it('\'Upload transcript file\' and \'Type in transcript\' radio buttons should be displayed along with \'Transcript\' label. By default \'Upload transcript file\' button should be selected', () => {
23
+ utilities.verifyInnerText(multipleSelectionPage.transcriptLabel(), 'Transcript');
24
+ utilities.verifyElementVisibilityState(multipleSelectionPage.transcriptLabel(), 'visible');
25
+ utilities.verifyInnerText(multipleSelectionPage.uploadTranscriptFileLabel(), 'Upload transcript file');
26
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadTranscriptFileLabel(), 'visible');
27
+ multipleSelectionPage.steps.verifyUploadTranscriptFileCheckedState();
28
+ utilities.verifyInnerText(multipleSelectionPage.typeInTranscriptLabel(), 'Type in transcript');
29
+ utilities.verifyElementVisibilityState(multipleSelectionPage.typeInTranscriptLabel(), 'visible');
30
+ multipleSelectionPage.steps.verifyUploadAudioFileUncheckedState();
31
+ });
32
+
33
+ it('CSS of Transcript section', { tags: 'css' }, () => {
34
+ multipleSelectionPage.transcriptLabel()
35
+ utilities.verifyCSS(multipleSelectionPage.transcriptLabel(), {
36
+ 'color': 'rgb(72, 72, 72)',
37
+ 'font-size': '12px',
38
+ 'font-weight': '700'
39
+ });
40
+ utilities.verifyCSS(multipleSelectionPage.uploadTranscriptFileRadioButton().parent().find('svg'), {
41
+ 'fill': 'rgb(0, 117, 255)'
42
+ });
43
+ utilities.verifyCSS(multipleSelectionPage.typeInTranscriptRadioButton().parent().find('svg'), {
44
+ 'fill': 'rgb(118, 118, 118)'
45
+ });
46
+ utilities.verifyCSS(multipleSelectionPage.uploadTranscriptFileLabel(), {
47
+ 'color': 'rgb(0, 0, 0)',
48
+ 'font-size': '12px',
49
+ 'font-weight': '400'
50
+ });
51
+ utilities.verifyCSS(multipleSelectionPage.typeInTranscriptLabel(), {
52
+ 'color': 'rgb(0, 0, 0)',
53
+ 'font-size': '12px',
54
+ 'font-weight': '400'
55
+ });
56
+ });
57
+
58
+ //Note: Accessibility is already covered in header file
59
+ });
60
+
61
+ describe('\'Upload transcript file\' section', () => {
62
+ abortEarlySetup();
63
+ before(() => {
64
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
65
+ cy.barsPreLoaderWait();
66
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
67
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
68
+ multipleSelectionPage.steps.clickOnAddUrlRadioButton();
69
+ });
70
+
71
+ it('\'Upload\' label should be displayed', () => {
72
+ utilities.verifyInnerText(multipleSelectionPage.uploadTranscriptLabel(), 'Upload');
73
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadTranscriptLabel(), 'visible');
74
+ });
75
+
76
+ it('\'File name\' label should be displayed', () => {
77
+ utilities.verifyInnerText(multipleSelectionPage.transcriptFileNameLabel(), 'File name');
78
+ utilities.verifyElementVisibilityState(multipleSelectionPage.transcriptFileNameLabel(), 'visible');
79
+ });
80
+
81
+ it('\'Choose File\' button should be displayed', () => {
82
+ utilities.verifyInnerText(multipleSelectionPage.chooseTranscriptFileButton(), 'Choose File');
83
+ utilities.verifyElementVisibilityState(multipleSelectionPage.chooseTranscriptFileButton(), 'visible');
84
+ });
85
+
86
+ it('By default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
87
+ utilities.verifyInnerText(multipleSelectionPage.noFileChosenLabel(), 'No file chosen');
88
+ utilities.verifyElementVisibilityState(multipleSelectionPage.noFileChosenLabel(), 'visible');
89
+ });
90
+
91
+ it('CSS of \'Upload transcript file\' section', { tags: 'css' }, () => {
92
+ utilities.verifyCSS(multipleSelectionPage.uploadTranscriptLabel(), {
93
+ 'color': 'rgb(0, 0, 0)',
94
+ 'font-size': '12px',
95
+ 'font-weight': '400'
96
+ });
97
+ utilities.verifyCSS(multipleSelectionPage.transcriptFileNameLabel(), {
98
+ 'color': 'rgb(72, 72, 72)',
99
+ 'font-size': '12px',
100
+ 'font-weight': '400'
101
+ });
102
+ utilities.verifyCSS(multipleSelectionPage.noFileChosenLabel(), {
103
+ 'color': 'rgb(0, 0, 0)',
104
+ 'font-size': '12px',
105
+ 'font-weight': '400'
106
+ });
107
+ utilities.verifyCSS(multipleSelectionPage.chooseTranscriptFileButton(), {
108
+ 'background-color': 'rgb(248, 248, 248)',
109
+ 'border': '1px solid rgb(188, 188, 188)',
110
+ 'color': 'rgb(72, 72, 72)',
111
+ 'font-size': '12px',
112
+ 'font-weight': '700'
113
+ });
114
+ });
115
+
116
+ //Note: Accessibility is already covered in header file
117
+
118
+ it('When the user adds the transcript file and file upload is inprogress, file name and progress bar should be displayed below \'File name\' label. Progress bar should disappear once file is uploaded', () => {
119
+ multipleSelectionPage.steps.uploadTranscriptFile('sample.txt');
120
+ utilities.verifyElementVisibilityState(multipleSelectionPage.transcriptFileUploadProgressBar(), 'visible');
121
+ utilities.verifyInnerText(multipleSelectionPage.uploadedFileNameLabel(), 'sample.txt');
122
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadedFileNameLabel(), 'visible');
123
+ utilities.verifyElementVisibilityState(multipleSelectionPage.transcriptFileUploadProgressBar(), 'hidden');
124
+ });
125
+
126
+ it('CSS of progress bar and file name when file upload is in progress', { tags: 'css' }, () => {
127
+ multipleSelectionPage.steps.uploadTranscriptFile('sample1.txt');
128
+ multipleSelectionPage.transcriptFileUploadProgressBar()
129
+ .verifyPseudoClassBeforeProperty('background-color', 'rgb(74, 147, 224)')
130
+ });
131
+
132
+ it('Accessibility of progress bar and file name when file upload is in progress', { tags: 'a11y' }, () => {
133
+ multipleSelectionPage.steps.uploadTranscriptFile('sample.txt');
134
+ cy.checkAccessibility(multipleSelectionPage.uploadedFileNameLabel().parents('.upload-transcript-file'));
135
+ });
136
+
137
+ it('When user clicks on \'Choose file\' button again and upload another transcript file, previously uploaded transcript file should get replaced with new transcript file', () => {
138
+ multipleSelectionPage.steps.uploadTranscriptFile('sample1.txt');
139
+ utilities.verifyElementVisibilityState(multipleSelectionPage.transcriptFileUploadProgressBar(), 'hidden');
140
+ utilities.verifyInnerText(multipleSelectionPage.uploadedFileNameLabel(), 'sample1.txt');
141
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadedFileNameLabel(), 'visible');
142
+ });
143
+
144
+ it('When the user uploads a file that is not supported, following error message should be displayed: \'Error: The file type is not supported. Please upload a file with the following supported formats: TXT.\'', () => {
145
+ multipleSelectionPage.steps.uploadTranscriptFile('sample.doc');
146
+ utilities.verifyInnerText(multipleSelectionPage.uploadTranscriptFileSectionErrorMessage(), 'Error: The file type is not supported. Please upload a file with the following supported formats: TXT.');
147
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadTranscriptFileSectionErrorMessage(), 'visible');
148
+ });
149
+
150
+ multipleSelectionPage.tests.verifyErrorMessageCSSAndA11y(multipleSelectionPage.uploadTranscriptFileSectionErrorMessage);
151
+
152
+ it('When user upload supported format of audio file, error message should disappear', () => {
153
+ multipleSelectionPage.steps.uploadTranscriptFile('sample.txt');
154
+ utilities.verifyElementVisibilityState(multipleSelectionPage.transcriptFileUploadProgressBar(), 'hidden');
155
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadTranscriptFileSectionErrorMessage(), 'hidden');
156
+ });
157
+
158
+ it('Accessibility of \'Upload transcript file\' section once file is uploaded', { tags: 'a11y' }, () => {
159
+ cy.checkAccessibility(multipleSelectionPage.uploadTranscriptLabel().parents('[class*="AddAudioPopupstyles__FormContentWrapper"]'));
160
+ });
161
+ });
162
+
163
+ describe('\'Type in transcript\' section', () => {
164
+ abortEarlySetup();
165
+ before(() => {
166
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
167
+ cy.barsPreLoaderWait();
168
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
169
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
170
+ multipleSelectionPage.steps.clickOnAddUrlRadioButton();
171
+ });
172
+
173
+ it('On selecting \'Type in transcript\' radio button, the \'Upload transcript file\' radio button should get unchecked', () => {
174
+ multipleSelectionPage.steps.clickOnTypeInTranscriptRadioButton();
175
+ multipleSelectionPage.steps.verifyTypeInTranscriptCheckedState();
176
+ multipleSelectionPage.steps.verifyUploadTranscriptFileUncheckedState();
177
+ });
178
+
179
+ it('\'Upload\' label and \'Choose file\' button should not be displayed', () => {
180
+ utilities.verifyElementVisibilityState(multipleSelectionPage.uploadTranscriptLabel(), 'notExist');
181
+ utilities.verifyElementVisibilityState(multipleSelectionPage.chooseTranscriptFileButton(), 'notExist');
182
+ });
183
+
184
+ it('\'Type in transcript\' label and input field should be displayed. By default, the type in transcript input field should be empty', () => {
185
+ utilities.verifyInnerText(multipleSelectionPage.typeInTranscriptInputFieldLabel(), 'Type in transcript');
186
+ utilities.verifyElementVisibilityState(multipleSelectionPage.typeInTranscriptInputFieldLabel(), 'visible');
187
+ utilities.verifyElementVisibilityState(multipleSelectionPage.typeInTranscriptInputField(), 'visible');
188
+ utilities.verifyInnerText(multipleSelectionPage.typeInTranscriptInputField(), '');
189
+ });
190
+
191
+ it('The user should be able to enter text in the \'Transcript\' input field', () => {
192
+ multipleSelectionPage.steps.enterTextInTranscriptInputField('This is a transcript text');
193
+ utilities.verifyTextContent(multipleSelectionPage.typeInTranscriptInputField(), 'This is a transcript text');
194
+ });
195
+
196
+ it('CSS of \'Type in transcript\' Section', { tags: 'css' }, () => {
197
+ utilities.verifyCSS(multipleSelectionPage.typeInTranscriptInputFieldLabel(), {
198
+ 'color': 'rgb(0, 0, 0)',
199
+ 'font-size': '12px',
200
+ 'font-weight': '400'
201
+ });
202
+ utilities.verifyCSS(multipleSelectionPage.typeInTranscriptInputField(), {
203
+ 'color': 'rgb(0, 0, 46)',
204
+ 'font-size': '12px',
205
+ 'font-weight': '400'
206
+ });
207
+ });
208
+
209
+ it('Accessibility of \'Type in transcript\' section', { tags: 'a11y' }, () => {
210
+ cy.checkAccessibility(multipleSelectionPage.typeInTranscriptInputFieldLabel().parents('.freeResponseAudioFormTextInput'));
211
+ });
212
+ });
213
+ });
@@ -0,0 +1,148 @@
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: Edit tab', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('\'Audio player style\' section - Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
16
+ cy.barsPreLoaderWait();
17
+ multipleSelectionPage.steps.focusInQuestionInstructionsInputField();
18
+ multipleSelectionPage.steps.selectAudioPlayerOptionFromCKEditorToolbar();
19
+ });
20
+
21
+ it('\'Audio player style\' label should be displayed', () => {
22
+ utilities.verifyInnerText(multipleSelectionPage.audioPlayerStyleLabel(), 'Audio player style');
23
+ utilities.verifyElementVisibilityState(multipleSelectionPage.audioPlayerStyleLabel(), 'visible');
24
+ });
25
+
26
+ it('Three toggle buttons \'Standard\', \'Bar\' and \'Compact\' should be displayed and \'Bar\' toggle button should be displayed', () => {
27
+ utilities.verifyInnerText(multipleSelectionPage.standardStyleToggleButtonLabel(), 'Standard');
28
+ utilities.verifyElementVisibilityState(multipleSelectionPage.standardStyleToggleButton(), 'visible');
29
+ utilities.verifyInnerText(multipleSelectionPage.barStyleToggleButtonLabel(), 'Bar');
30
+ utilities.verifyElementVisibilityState(multipleSelectionPage.barStyleToggleButton(), 'visible');
31
+ utilities.verifyInnerText(multipleSelectionPage.compactStyleToggleButtonLabel(), 'Compact');
32
+ utilities.verifyElementVisibilityState(multipleSelectionPage.compactStyleToggleButton(), 'visible');
33
+ multipleSelectionPage.steps.verifyAudioPlayerStyleToggleButtonIsNotSelected('Standard');
34
+ multipleSelectionPage.steps.verifyAudioPlayerStyleToggleButtonIsSelected('Bar');
35
+ multipleSelectionPage.steps.verifyAudioPlayerStyleToggleButtonIsNotSelected('Compact');
36
+ });
37
+
38
+ it('User should be able to select \'Standard\' toggle button', () => {
39
+ multipleSelectionPage.steps.selectAudioPlayerStyleToggleButton('Standard');
40
+ multipleSelectionPage.steps.verifyAudioPlayerStyleToggleButtonIsNotSelected('Bar');
41
+ multipleSelectionPage.steps.verifyAudioPlayerStyleToggleButtonIsNotSelected('Compact');
42
+ });
43
+
44
+ it('User should be able to select \'Bar\' toggle button', () => {
45
+ multipleSelectionPage.steps.selectAudioPlayerStyleToggleButton('Bar');
46
+ multipleSelectionPage.steps.verifyAudioPlayerStyleToggleButtonIsNotSelected('Standard');
47
+ multipleSelectionPage.steps.verifyAudioPlayerStyleToggleButtonIsNotSelected('Compact');
48
+ });
49
+
50
+ it('User should be able to select \'Compact\' toggle button', () => {
51
+ multipleSelectionPage.steps.selectAudioPlayerStyleToggleButton('Compact');
52
+ multipleSelectionPage.steps.verifyAudioPlayerStyleToggleButtonIsNotSelected('Standard');
53
+ multipleSelectionPage.steps.verifyAudioPlayerStyleToggleButtonIsNotSelected('Bar');
54
+ });
55
+
56
+ it('When user has selected \'Compact\' toggle button, then \'Compact player options\' label and options - \'Default\', \'Text\', \'Image\' and \'Icon\' should be displayed and default should be selected by default', () => {
57
+ utilities.verifyInnerText(multipleSelectionPage.compactPlayerOptionsLabel(), 'Compact player options');
58
+ utilities.verifyElementVisibilityState(multipleSelectionPage.compactPlayerOptionsLabel(), 'visible');
59
+ utilities.verifyInnerText(multipleSelectionPage.defaultPlayerOptionButton(), 'Default');
60
+ utilities.verifyElementVisibilityState(multipleSelectionPage.defaultPlayerOptionButton(), 'visible');
61
+ utilities.verifyInnerText(multipleSelectionPage.textPlayerOptionButton(), 'Text');
62
+ utilities.verifyElementVisibilityState(multipleSelectionPage.textPlayerOptionButton(), 'visible');
63
+ utilities.verifyInnerText(multipleSelectionPage.imagePlayerOptionButton(), 'Image');
64
+ utilities.verifyElementVisibilityState(multipleSelectionPage.imagePlayerOptionButton(), 'visible');
65
+ utilities.verifyInnerText(multipleSelectionPage.iconPlayerOptionButton(), 'Icon');
66
+ utilities.verifyElementVisibilityState(multipleSelectionPage.iconPlayerOptionButton(), 'visible');
67
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsSelected('Default');
68
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Text');
69
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Image');
70
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Icon');
71
+ });
72
+
73
+ it('User should be able to select \'Default\' toggle button', () => {
74
+ multipleSelectionPage.steps.selectCompactPlayerOptionButton('Default');
75
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Text');
76
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Image');
77
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Icon');
78
+ });
79
+
80
+ it('User should be able to select \'Text\' toggle button', () => {
81
+ multipleSelectionPage.steps.selectCompactPlayerOptionButton('Text');
82
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Default');
83
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Image');
84
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Icon');
85
+ });
86
+
87
+ it('User should be able to select \'Image\' toggle button', () => {
88
+ multipleSelectionPage.steps.selectCompactPlayerOptionButton('Image');
89
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Default');
90
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Text');
91
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Icon');
92
+ });
93
+
94
+ it('User should be able to select \'Icon\' toggle button', () => {
95
+ multipleSelectionPage.steps.selectCompactPlayerOptionButton('Icon');
96
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Default');
97
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Text');
98
+ multipleSelectionPage.steps.verifyCompactPlayerOptionButtonIsNotSelected('Image');
99
+ });
100
+
101
+ it('CSS of audio player style section', { tags: 'css' }, () => {
102
+ utilities.verifyCSS(multipleSelectionPage.audioPlayerStyleLabel(), {
103
+ 'color': 'rgb(72, 72, 72)',
104
+ 'font-size': '12px',
105
+ 'font-weight': '400'
106
+ });
107
+ utilities.verifyCSS(multipleSelectionPage.compactStyleToggleButton(), {
108
+ 'color': 'rgba(0, 0, 0, 0.38)',
109
+ 'background-color': 'rgb(72, 72, 72)',
110
+ 'font-size': '14px',
111
+ 'font-weight': '500'
112
+ });
113
+ utilities.verifyCSS(multipleSelectionPage.standardStyleToggleButton(), {
114
+ 'color': 'rgba(0, 0, 0, 0.38)',
115
+ 'background-color': 'rgba(0, 0, 0, 0)',
116
+ 'font-size': '14px',
117
+ 'font-weight': '500'
118
+ });
119
+ utilities.verifyCSS(multipleSelectionPage.compactPlayerOptionsLabel(), {
120
+ 'color': 'rgb(72, 72, 72)',
121
+ 'font-size': '12px',
122
+ 'font-weight': '400'
123
+ });
124
+ utilities.verifyCSS(multipleSelectionPage.iconPlayerOptionButton(), {
125
+ 'background-color': 'rgba(0, 0, 0, 0)',
126
+ 'border': '2px solid rgb(72, 72, 72)'
127
+ });
128
+ utilities.verifyCSS(multipleSelectionPage.iconPlayerOptionButton().find('.ngie-toggle-button-label'), {
129
+ 'color': 'rgb(72, 72, 72)',
130
+ 'font-size': '12px',
131
+ 'font-weight': '400'
132
+ });
133
+ utilities.verifyCSS(multipleSelectionPage.defaultPlayerOptionButton(), {
134
+ 'background-color': 'rgba(0, 0, 0, 0)',
135
+ 'border': '1px solid rgb(188, 188, 188)'
136
+ });
137
+ utilities.verifyCSS(multipleSelectionPage.defaultPlayerOptionButton().find('.ngie-toggle-button-label'), {
138
+ 'color': 'rgb(72, 72, 72)',
139
+ 'font-size': '12px',
140
+ 'font-weight': '400'
141
+ });
142
+ });
143
+
144
+ it('Accessibility of audio player style section', { tags: 'a11y' }, () => {
145
+ cy.checkAccessibility(multipleSelectionPage.audioPlayerStyleWrapper());
146
+ });
147
+ });
148
+ });