itemengine-cypress-automation 1.0.193-packageUpdated-7f1e306.0 → 1.0.193-packageUpdated-0af2e49.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +3 -3
  2. package/cypress/e2e/ILC/AudioPlayerNew/audioOverviewAndTranscript.js +568 -0
  3. package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +4 -4
  4. package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +5 -5
  5. package/cypress/e2e/ILC/AudioPlayerNew/customizePlayerLayoutSettings.js +2 -2
  6. package/cypress/e2e/ILC/AudioPlayerNew/headerSection.js +125 -0
  7. package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +5 -5
  8. package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +4 -4
  9. package/cypress/e2e/ILC/AudioPlayerNew/studentViewSettings.js +3 -3
  10. package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +19 -17
  11. package/cypress/e2e/ILC/ChartsBar/previewContentsForAllViews.smoke.js +7 -4
  12. package/cypress/e2e/ILC/ChartsLine/allOrNothingScoringForAllViews.smoke.js +366 -0
  13. package/cypress/e2e/ILC/ChartsLine/checkAnswerFunctionalityForAllViews.smoke.js +183 -0
  14. package/cypress/e2e/ILC/ChartsLine/gradingViewAndCorrectAnswerView.smoke.js +281 -0
  15. package/cypress/e2e/ILC/ChartsLine/previewContentsForAllViews.smoke.js +595 -0
  16. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +8 -8
  17. package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +241 -0
  18. package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +241 -0
  19. package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternatePoints.js +285 -0
  20. package/cypress/e2e/ILC/ImageHighlight/Scoring/manuallyAndNonScored.js +164 -0
  21. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +281 -0
  22. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsScoring.js +467 -0
  23. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +250 -0
  24. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeigtsCorrectPointsGreaterThanAlternativePoints.js +281 -0
  25. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +260 -0
  26. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsScoring.js +184 -0
  27. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +229 -0
  28. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +261 -0
  29. package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +409 -0
  30. package/cypress/e2e/ILC/chartsDotsPlot/checkAnswerFunctionalityForAllViews.smoke.js +199 -0
  31. package/cypress/e2e/ILC/chartsDotsPlot/gradingViewAndCorrectAnswerView.smoke.js +223 -0
  32. package/cypress/e2e/ILC/chartsDotsPlot/previewContentsForAllViews.smoke.js +402 -0
  33. package/cypress/pages/audioPlayerPage.js +229 -9
  34. package/cypress/pages/chartsBarPage.js +2 -70
  35. package/cypress/pages/chartsDotPlotPage.js +986 -3
  36. package/cypress/pages/chartsLinePage.js +368 -9
  37. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +0 -1
  38. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -0
  39. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
  40. package/cypress/pages/components/barAndLineChartComponent.js +27 -1
  41. package/cypress/pages/components/chartsCommonComponent.js +31 -2
  42. package/cypress/pages/components/createQuestionBasePage.js +1 -0
  43. package/cypress/pages/components/layoutSectionComponent.js +2 -2
  44. package/cypress/pages/components/singleMultipleSelectionModeComponent.js +5 -0
  45. package/cypress/pages/components/toolSettingsComponent.js +2 -2
  46. package/cypress/pages/feedbackScalePage.js +1 -1
  47. package/cypress/pages/gridFillPage.js +13 -6
  48. package/cypress/pages/imageHighlightPage.js +308 -2
  49. package/cypress/pages/numberLinePage.js +40 -16
  50. package/cypress/pages/textEntryMathPage.js +1 -1
  51. package/cypress/pages/videoResponsePage.js +350 -6
  52. package/package.json +1 -1
  53. package/cypress/e2e/ILC/ChartsBar/allOrNothingScoringForAllViews.smoke.js +0 -366
@@ -51,7 +51,7 @@ describe('Audio player: Preview tab', () => {
51
51
  });
52
52
 
53
53
  it('When user uploads MP3 audio file, audio player should be displayed in preview tab and user should be able to play MP3 audio file.', () => {
54
- audioPlayerPage.steps.uploadFile(MP3File);
54
+ audioPlayerPage.steps.uploadAudioFile(MP3File);
55
55
  audioPlayerPage.steps.switchToPreviewTab();
56
56
  utilities.verifyElementVisibilityState(audioPlayerPage.playbackPlayButton(), 'visible');
57
57
  audioPlayerPage.steps.startPlayback();
@@ -61,7 +61,7 @@ describe('Audio player: Preview tab', () => {
61
61
  it('When user uploads WAV audio file, audio player should be displayed in preview tab and user should be able to play WAV audio file.', () => {
62
62
  audioPlayerPage.steps.switchToEditTab();
63
63
  audioPlayerPage.steps.deleteAudioFile();
64
- audioPlayerPage.steps.uploadFile(WAVFile);
64
+ audioPlayerPage.steps.uploadAudioFile(WAVFile);
65
65
  audioPlayerPage.steps.switchToPreviewTab();
66
66
  utilities.verifyElementVisibilityState(audioPlayerPage.playbackPlayButton(), 'visible');
67
67
  audioPlayerPage.steps.startPlayback();
@@ -71,7 +71,7 @@ describe('Audio player: Preview tab', () => {
71
71
  it('When user uploads AAC audio file, audio player should be displayed in preview tab and user should be able to play AAC audio file.', () => {
72
72
  audioPlayerPage.steps.switchToEditTab();
73
73
  audioPlayerPage.steps.deleteAudioFile();
74
- audioPlayerPage.steps.uploadFile(AACFile);
74
+ audioPlayerPage.steps.uploadAudioFile(AACFile);
75
75
  audioPlayerPage.steps.switchToPreviewTab();
76
76
  utilities.verifyElementVisibilityState(audioPlayerPage.playbackPlayButton(), 'visible');
77
77
  audioPlayerPage.steps.startPlayback();
@@ -0,0 +1,568 @@
1
+ import { audioPlayerPage, dialogBoxBase } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Audio player: Audio overview and Transcript section', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Audio overview: Edit tab', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ audioPlayerPage.steps.navigateToCreateResource('audio player');
15
+ });
16
+
17
+ it('\'Audio overview (displayed to students)\' label and empty input field should be displayed', () => {
18
+ utilities.verifyInnerText(audioPlayerPage.audioOverviewLabel(), 'Audio overview (displayed to students)');
19
+ utilities.verifyElementVisibilityState(audioPlayerPage.audioOverviewLabel(), 'visible');
20
+ utilities.verifyElementVisibilityState(audioPlayerPage.audioOverviewInputField(), 'visible');
21
+ utilities.verifyTextContent(audioPlayerPage.audioOverviewInputField(), '');
22
+ });
23
+
24
+ it('When user focuses in and out of the audio overview input field, then error message should not be displayed', () => {
25
+ audioPlayerPage.steps.focusInAudioOverviewInputField();
26
+ audioPlayerPage.steps.focusOutOfAudioOverviewInputField();
27
+ audioPlayerPage.steps.verifyErrorMessageIsNotDisplayed();
28
+ });
29
+
30
+ it('User should be able to give an input in audio overview input field', () => {
31
+ audioPlayerPage.steps.addInputToAudioOverviewInputField('Sample audio overview');
32
+ });
33
+
34
+ it('CSS of \'audio overview\' section', { tags: 'css' }, () => {
35
+ utilities.verifyCSS(audioPlayerPage.audioOverviewLabel(), {
36
+ 'color': css.color.labels,
37
+ 'font-size': css.fontSize.normal,
38
+ 'font-weight': css.fontWeight.semibold
39
+ });
40
+ utilities.verifyCSS(audioPlayerPage.audioOverviewInputField(), {
41
+ 'color': css.color.text,
42
+ 'font-size': css.fontSize.default,
43
+ 'font-weight': css.fontWeight.regular
44
+ });
45
+ });
46
+
47
+ it('When the user adds an image in the audio overview input field using the image option from ckEditor toolbar, the image should be displayed in the audio overview input field', () => {
48
+ audioPlayerPage.steps.focusInAudioOverviewInputField();
49
+ audioPlayerPage.steps.selectImageOptionFromCKEditorToolbar()
50
+ audioPlayerPage.steps.addImageToInputField();
51
+ audioPlayerPage.steps.verifyImageAndAltTextInAudioOverviewInputField();
52
+ });
53
+
54
+ it('When the user adds an equation in the audio overview input field using the image option from ckEditor toolbar, the image should be displayed in the audio overview input field', () => {
55
+ audioPlayerPage.steps.clearAudioOverviewInputField();
56
+ audioPlayerPage.steps.focusInAudioOverviewInputField();
57
+ audioPlayerPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
58
+ audioPlayerPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
59
+ audioPlayerPage.steps.verifyEquationInAudioOverviewInputField();
60
+ });
61
+
62
+ it('When the user adds a link in the audio overview input field using the image option from ckEditor toolbar, the image should be displayed in the audio overview input field', () => {
63
+ audioPlayerPage.steps.clearAudioOverviewInputField();
64
+ audioPlayerPage.steps.focusInAudioOverviewInputField();
65
+ audioPlayerPage.steps.selectLinkOptionFromCKEditorToolbar();
66
+ audioPlayerPage.steps.addLinkToInputField();
67
+ audioPlayerPage.steps.verifyLinkInAudioOverviewInputField();
68
+ });
69
+
70
+ it('When the user adds a bold text in the audio overview input field using the image option from ckEditor toolbar, the image should be displayed in the audio overview input field', () => {
71
+ audioPlayerPage.steps.clearAudioOverviewInputField();
72
+ audioPlayerPage.steps.focusInAudioOverviewInputField();
73
+ audioPlayerPage.steps.selectBoldOptionFromCKEditorToolbar();
74
+ audioPlayerPage.steps.addInputToAudioOverviewInputField('This is a bold text in audio overview input field');
75
+ audioPlayerPage.steps.verifyBoldTextInAudioOverviewInputField();
76
+ });
77
+ });
78
+
79
+ describe('Audio overview: Preview tab functionality', () => {
80
+ abortEarlySetup();
81
+ before(() => {
82
+ audioPlayerPage.steps.navigateToCreateResource('audio player');
83
+ });
84
+
85
+ it('When the user has not any input to audio overview input field in the edit tab, then no audio overview should be displayed in the preview tab', () => {
86
+ audioPlayerPage.steps.switchToPreviewTab();
87
+ utilities.verifyElementVisibilityState(audioPlayerPage.audioOverviewPreviewTab(), 'notExist');
88
+ });
89
+
90
+ it('When the user enters text in the audio overview input field, then audio overview should be displayed in the preview tab', () => {
91
+ audioPlayerPage.steps.switchToEditTab();
92
+ audioPlayerPage.steps.addInputToAudioOverviewInputField('This is audio overview text');
93
+ utilities.triggerMouseout(audioPlayerPage.audioOverviewInputField());
94
+ audioPlayerPage.steps.switchToPreviewTab();
95
+ utilities.verifyElementVisibilityState(audioPlayerPage.audioOverviewPreviewTab(), 'visible');
96
+ utilities.verifyInnerText(audioPlayerPage.audioOverviewPreviewTab(), 'This is audio overview text');
97
+ });
98
+
99
+ it('CSS of audio overview text in preview tab', { tags: 'css' }, () => {
100
+ utilities.verifyCSS(audioPlayerPage.audioOverviewPreviewTab(), {
101
+ 'color': css.color.text,
102
+ 'font-size': css.fontSize.default,
103
+ 'font-weight': css.fontWeight.regular
104
+ });
105
+ });
106
+
107
+ it('Accessibility of audio overview text in preview tab', { tags: 'a11y' }, () => {
108
+ cy.checkAccessibility(audioPlayerPage.audioOverviewPreviewTab().parents('.audio-resource-preview-wrapper'));
109
+ });
110
+
111
+ it('When the user adds an image in the audio overview input field using the image option from ckEditor toolbar, the image should be displayed in the preview tab', () => {
112
+ audioPlayerPage.steps.switchToEditTab();
113
+ audioPlayerPage.steps.clearAudioOverviewInputField();
114
+ audioPlayerPage.steps.focusInAudioOverviewInputField();
115
+ audioPlayerPage.steps.selectImageOptionFromCKEditorToolbar()
116
+ audioPlayerPage.steps.addImageToInputField();
117
+ audioPlayerPage.steps.switchToPreviewTab();
118
+ audioPlayerPage.steps.verifyImageAndAltTextInAudioOverviewPreviewTab();
119
+ });
120
+
121
+ it('When the user adds an equation in the audio overview input field using the image option from ckEditor toolbar, the image should be displayed in the preview tab', () => {
122
+ audioPlayerPage.steps.switchToEditTab();
123
+ audioPlayerPage.steps.clearAudioOverviewInputField();
124
+ audioPlayerPage.steps.focusInAudioOverviewInputField();
125
+ audioPlayerPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
126
+ audioPlayerPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
127
+ audioPlayerPage.steps.focusAwayFromElement();
128
+ audioPlayerPage.steps.switchToPreviewTab();
129
+ audioPlayerPage.steps.verifyEquationInAudioOverviewPreviewTab();
130
+ });
131
+
132
+ it('When the user adds a link in the audio overview input field using the image option from ckEditor toolbar, the image should be displayed in the preview tab', () => {
133
+ audioPlayerPage.steps.switchToEditTab();
134
+ audioPlayerPage.steps.clearAudioOverviewInputField();
135
+ audioPlayerPage.steps.focusInAudioOverviewInputField();
136
+ audioPlayerPage.steps.selectLinkOptionFromCKEditorToolbar();
137
+ audioPlayerPage.steps.addLinkToInputField();
138
+ audioPlayerPage.steps.switchToPreviewTab();
139
+ audioPlayerPage.steps.verifyLinkInAudioOverviewPreviewTab();
140
+ });
141
+
142
+ it('When the user adds a bold text in the audio overview input field using the image option from ckEditor toolbar, the image should be displayed in the preview tab', () => {
143
+ audioPlayerPage.steps.switchToEditTab();
144
+ audioPlayerPage.steps.clearAudioOverviewInputField();
145
+ audioPlayerPage.steps.focusInAudioOverviewInputField();
146
+ audioPlayerPage.steps.selectBoldOptionFromCKEditorToolbar();
147
+ audioPlayerPage.steps.addInputToAudioOverviewInputField('This is a bold text in audio overview input field');
148
+ utilities.triggerMouseout(audioPlayerPage.audioOverviewInputField());
149
+ audioPlayerPage.steps.switchToPreviewTab();
150
+ audioPlayerPage.steps.verifyBoldTextInAudioOverviewPreviewTab();
151
+ });
152
+ });
153
+
154
+ describe('\'Upload transcript file\' section', () => {
155
+ abortEarlySetup();
156
+ before(() => {
157
+ audioPlayerPage.steps.navigateToCreateResource('audio player');
158
+ });
159
+
160
+ it('\'Transcript\' label should be displayed', () => {
161
+ utilities.verifyInnerText(audioPlayerPage.transcriptLabel(), 'Transcript');
162
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptLabel(), 'visible');
163
+ });
164
+
165
+ it('\'Upload transcript file\' and \'Type in transcript\' radio buttons should be displayed. By default \'Upload transcript file\' button should be selected', () => {
166
+ utilities.verifyInnerText(audioPlayerPage.uploadTranscriptFileLabel(), 'Upload transcript file');
167
+ utilities.verifyElementVisibilityState(audioPlayerPage.uploadTranscriptFileLabel(), 'visible');
168
+ audioPlayerPage.steps.verifyUploadTranscriptFileRadioButtonIsSelected();
169
+ utilities.verifyInnerText(audioPlayerPage.typeInTranscriptLabel(), 'Type in transcript');
170
+ utilities.verifyElementVisibilityState(audioPlayerPage.typeInTranscriptLabel(), 'visible');
171
+ audioPlayerPage.steps.verifyTypeInTranscriptRadioButtonIsNotSelected();
172
+ });
173
+
174
+ it('\'Upload\' label should be displayed', () => {
175
+ utilities.verifyInnerText(audioPlayerPage.uploadTranscriptUploadLabel(), 'Upload');
176
+ utilities.verifyElementVisibilityState(audioPlayerPage.uploadTranscriptUploadLabel(), 'visible');
177
+ });
178
+
179
+ it('\'File name\' label should be displayed', () => {
180
+ utilities.verifyInnerText(audioPlayerPage.uploadTranscriptFileNameLabel(), 'File name');
181
+ utilities.verifyElementVisibilityState(audioPlayerPage.uploadTranscriptFileNameLabel(), 'visible');
182
+ });
183
+
184
+ it('\'Choose file\' button should be displayed', () => {
185
+ utilities.verifyInnerText(audioPlayerPage.uploadTranscriptChooseFileButton(), 'Choose file');
186
+ utilities.verifyElementVisibilityState(audioPlayerPage.uploadTranscriptChooseFileButton(), 'visible');
187
+ });
188
+
189
+ it('By default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
190
+ utilities.verifyInnerText(audioPlayerPage.uploadTranscriptNoFileChosenLabel(), 'No file chosen');
191
+ utilities.verifyElementVisibilityState(audioPlayerPage.uploadTranscriptNoFileChosenLabel(), 'visible');
192
+ });
193
+
194
+ it('CSS of \'Upload transcript file\' section', { tags: 'css' }, () => {
195
+ utilities.verifyCSS(audioPlayerPage.uploadTranscriptFileRadioButton().parent().find('svg'), {
196
+ 'fill': css.color.secondaryBtnActive
197
+ });
198
+ utilities.verifyCSS(audioPlayerPage.typeInTranscriptRadioButton().parent().find('svg path'), {
199
+ 'color': css.color.uncheckedCheckbox
200
+ });
201
+ utilities.verifyCSS(audioPlayerPage.uploadTranscriptFileLabel(), {
202
+ 'color': css.color.labels,
203
+ 'font-size': css.fontSize.normal,
204
+ 'font-weight': css.fontWeight.regular
205
+ });
206
+ utilities.verifyCSS(audioPlayerPage.typeInTranscriptLabel(), {
207
+ 'color': css.color.labels,
208
+ 'font-size': css.fontSize.normal,
209
+ 'font-weight': css.fontWeight.regular
210
+ });
211
+ utilities.verifyCSS(audioPlayerPage.uploadTranscriptNoFileChosenLabel(), {
212
+ 'color': css.color.liText,
213
+ 'font-size': css.fontSize.default,
214
+ 'font-weight': css.fontWeight.regular
215
+ });
216
+ utilities.verifyCSS(audioPlayerPage.uploadTranscriptChooseFileButton(), {
217
+ 'background-color': css.color.transparent,
218
+ 'border': `1px solid ${css.color.secondaryBtnBorder}`,
219
+ 'color': css.color.secondaryBtn,
220
+ 'font-size': css.fontSize.default,
221
+ 'font-weight': css.fontWeight.regular
222
+ });
223
+ });
224
+
225
+ it('Accessibility of \'Upload transcript file\' section', { tags: 'a11y' }, () => {
226
+ cy.checkAccessibility(audioPlayerPage.uploadTranscriptFileLabel().parents('.audio-player-resource'));
227
+ });
228
+
229
+ 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', () => {
230
+ audioPlayerPage.steps.attachTranscriptFile('uploads/sample300kb.txt');
231
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptFileUploadProgressBar(), 'visible');
232
+ utilities.verifyInnerText(audioPlayerPage.uploadedTranscriptFileNameLabel(), 'sample300kb.txt');
233
+ utilities.verifyElementVisibilityState(audioPlayerPage.uploadedTranscriptFileNameLabel(), 'visible');
234
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptFileUploadProgressBar(), 'hidden');
235
+ });
236
+
237
+ it('CSS of progress bar and file name when file upload is in progress', { tags: 'css' }, () => {
238
+ audioPlayerPage.steps.attachTranscriptFile('uploads/sample300kb.txt');
239
+ audioPlayerPage.transcriptFileUploadProgressBar()
240
+ .verifyPseudoClassBeforeProperty('background-color', css.color.fileUploadProgressBarFill);
241
+ });
242
+
243
+ it('Accessibility of progress bar and file name when file upload is in progress', { tags: 'a11y' }, () => {
244
+ audioPlayerPage.steps.attachTranscriptFile('uploads/sample300kb.txt');
245
+ cy.checkAccessibility(audioPlayerPage.uploadTranscriptFileLabel().parents('.audio-player-resource'));
246
+ });
247
+
248
+ 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', () => {
249
+ audioPlayerPage.steps.uploadTranscriptFile('uploads/sample2.txt');
250
+ utilities.verifyElementVisibilityState(audioPlayerPage.uploadedTranscriptFileNameLabel(), 'visible');
251
+ utilities.verifyInnerText(audioPlayerPage.uploadedTranscriptFileNameLabel(), 'sample2.txt');
252
+ utilities.verifyElementCount(audioPlayerPage.uploadedTranscriptFileNameLabel(), 1);
253
+ });
254
+
255
+ 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.\'', () => {
256
+ audioPlayerPage.steps.attachTranscriptFile('uploads/sample.mp4')
257
+ utilities.verifyInnerText(audioPlayerPage.errorMessage(), 'Error: The file type is not supported. Please upload a file with the following supported formats: TXT.');
258
+ utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'visible');
259
+ });
260
+
261
+ audioPlayerPage.tests.verifyErrorMessageCSSAndA11y();
262
+
263
+ it('When user upload supported format of transcript file, error message should disappear', () => {
264
+ audioPlayerPage.steps.uploadTranscriptFile('uploads/sample.txt');
265
+ audioPlayerPage.steps.verifyErrorMessageIsNotDisplayed();
266
+ });
267
+
268
+ it('When user has uploaded an transcript file, then delete button should appear beside uploaded file\'s name', () => {
269
+ utilities.verifyElementVisibilityState(audioPlayerPage.deleteTranscriptButton(), 'visible');
270
+ });
271
+
272
+ it('When the user hovers on \'Delete\' button, \'Delete transcript\' text should be displayed in tooltip', () => {
273
+ audioPlayerPage.deleteTranscriptButton()
274
+ .verifyTooltip('Delete transcript');
275
+ });
276
+
277
+ it('CSS of tooltip', { tags: 'css' }, () => {
278
+ audioPlayerPage.deleteTranscriptButton()
279
+ .trigger('mouseover');
280
+ utilities.verifyCSS(audioPlayerPage.tooltipText(), {
281
+ 'color': css.color.whiteText,
282
+ 'font-size': css.fontSize.normal,
283
+ 'font-weight': css.fontWeight.regular,
284
+ 'background-color': css.color.tooltipBg
285
+ });
286
+ });
287
+
288
+ it('When user clicks on the \'Delete\' button, then \'Delete\' popup should be displayed', () => {
289
+ audioPlayerPage.steps.deleteTranscriptFile();
290
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
291
+ utilities.verifyInnerText(audioPlayerPage.dialogBoxTitle(), 'Delete');
292
+ });
293
+
294
+ it('The pop up should be displayed with the message \'Are you sure you want to delete the transcript?\'', () => {
295
+ utilities.verifyInnerText(audioPlayerPage.dialogBoxContent(), 'Are you sure you want to delete the transcript?');
296
+ utilities.verifyInnerText(audioPlayerPage.buttonAccept(), 'Delete transcript');
297
+ utilities.verifyInnerText(audioPlayerPage.buttonReject(), 'Cancel');
298
+ });
299
+
300
+ it('CSS of popup', { tags: 'css' }, () => {
301
+ utilities.verifyCSS(dialogBoxBase.dialogBox(), {
302
+ 'background-color': css.color.defaultBackground,
303
+ });
304
+ utilities.verifyCSS(audioPlayerPage.dialogBoxContent().find('[class*="DeletePopupWrapper"]'), {
305
+ 'color': css.color.sectionHeading,
306
+ 'font-size': css.fontSize.default,
307
+ 'font-weight': css.fontWeight.regular
308
+ });
309
+ utilities.verifyCSS(audioPlayerPage.buttonAccept(), {
310
+ 'color': css.color.primaryBtn,
311
+ 'font-size': css.fontSize.default,
312
+ 'font-weight': css.fontWeight.semibold
313
+ });
314
+ utilities.verifyCSS(audioPlayerPage.buttonReject(), {
315
+ 'color': css.color.secondaryBtn,
316
+ 'font-size': css.fontSize.default,
317
+ 'font-weight': css.fontWeight.semibold,
318
+ 'background-color': css.color.defaultBackground
319
+ });
320
+ });
321
+
322
+ it('Accessibility of the popup', () => {
323
+ cy.checkAccessibility(dialogBoxBase.dialogBox());
324
+ });
325
+
326
+ it('When user clicks on \'Cancel\' button, then popup should close and user should remain on the edit interface of the question', () => {
327
+ dialogBoxBase.steps.clickOnRejectButtonInDialogBox()();
328
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
329
+ utilities.verifyInnerText(audioPlayerPage.uploadedTranscriptFileNameLabel(), 'sample.txt');
330
+ });
331
+
332
+ it('When user clicks on \'Delete\' button, then popup should close and transcript file should be deleted', () => {
333
+ audioPlayerPage.steps.deleteTranscriptFile();
334
+ dialogBoxBase.steps.clickOnAcceptButtonInDialogBox();
335
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
336
+ utilities.verifyInnerText(audioPlayerPage.uploadTranscriptNoFileChosenLabel(), 'No file chosen');
337
+ });
338
+ });
339
+
340
+ describe('\'Type in transcript\' section', () => {
341
+ abortEarlySetup();
342
+ before(() => {
343
+ audioPlayerPage.steps.navigateToCreateResource('audio player');
344
+ });
345
+
346
+ it('User should be able to select \'Type in transcript\' radio button', () => {
347
+ audioPlayerPage.steps.selectTypeInTranscriptRadioButton();
348
+ audioPlayerPage.steps.verifyUploadTranscriptFileRadioButtonIsNotSelected();
349
+ })
350
+
351
+ it('\'Transcript\' label and input field should be displayed. By default, the source url input field should be empty', () => {
352
+ utilities.verifyInnerText(audioPlayerPage.transcriptInputFieldLabel(), 'Transcript');
353
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptInputFieldLabel(), 'visible');
354
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptInputField(), 'visible');
355
+ utilities.verifyInnerText(audioPlayerPage.transcriptInputField(), '\n');
356
+ });
357
+
358
+ it('CSS of \'Type in transcript\' Section', { tags: 'css' }, () => {
359
+ utilities.verifyCSS(audioPlayerPage.transcriptInputFieldLabel(), {
360
+ 'color': css.color.labels,
361
+ 'font-size': css.fontSize.normal,
362
+ 'font-weight': css.fontWeight.semibold
363
+ });
364
+ utilities.verifyCSS(audioPlayerPage.transcriptInputField(), {
365
+ 'color': css.color.text,
366
+ 'font-size': css.fontSize.default,
367
+ 'font-weight': css.fontWeight.regular
368
+ });
369
+ });
370
+
371
+ it('Accessibility of \'Type in transcript\' section', { tags: 'a11y' }, () => {
372
+ cy.checkAccessibility(audioPlayerPage.transcriptInputFieldLabel().parents('.audio-player-resource'));
373
+ });
374
+
375
+ it('When user focuses in and out of the \'Transcript\' input field, then error message should not be displayed', () => {
376
+ audioPlayerPage.steps.focusInAndFocusOutOfTranscriptInputField();
377
+ audioPlayerPage.steps.verifyErrorMessageIsNotDisplayed();
378
+ });
379
+
380
+ it('When user should be able to add input in transcript input field', () => {
381
+ audioPlayerPage.steps.enterTextInTranscriptInputField('Sample transcript');
382
+ audioPlayerPage.steps.verifyTextInTranscriptInputField('Sample transcript');
383
+ });
384
+
385
+ it('When the user adds an image in the transcript input field using the image option from ckEditor toolbar, the image should be displayed in the transcript input field', () => {
386
+ audioPlayerPage.steps.clearTranscriptInputField();
387
+ audioPlayerPage.steps.focusInTranscriptInputField();
388
+ audioPlayerPage.steps.selectImageOptionFromCKEditorToolbar()
389
+ audioPlayerPage.steps.addImageToInputField();
390
+ audioPlayerPage.steps.verifyImageAndAltTextInTranscriptInputField();
391
+ });
392
+
393
+ it('When the user adds an equation in the transcript input field using the image option from ckEditor toolbar, the image should be displayed in the transcript input field', () => {
394
+ audioPlayerPage.steps.clearTranscriptInputField();
395
+ audioPlayerPage.steps.focusInTranscriptInputField();
396
+ audioPlayerPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
397
+ audioPlayerPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
398
+ audioPlayerPage.steps.verifyEquationInTranscriptInputField();
399
+ });
400
+
401
+ it('When the user adds a link in the transcript input field using the image option from ckEditor toolbar, the image should be displayed in the transcript input field', () => {
402
+ audioPlayerPage.steps.clearTranscriptInputField();
403
+ audioPlayerPage.steps.focusInTranscriptInputField();
404
+ audioPlayerPage.steps.selectLinkOptionFromCKEditorToolbar();
405
+ audioPlayerPage.steps.addLinkToInputField();
406
+ audioPlayerPage.steps.verifyLinkInTranscriptInputField();
407
+ });
408
+
409
+ it('When the user adds a bold text in the transcript input field using the image option from ckEditor toolbar, the image should be displayed in the transcript input field', () => {
410
+ audioPlayerPage.steps.clearTranscriptInputField();
411
+ audioPlayerPage.steps.focusInTranscriptInputField();
412
+ audioPlayerPage.steps.selectBoldOptionFromCKEditorToolbar();
413
+ audioPlayerPage.steps.enterTextInTranscriptInputField('This is a bold text in transcript input field');
414
+ audioPlayerPage.steps.verifyBoldTextInTranscriptInputField();
415
+ });
416
+ });
417
+
418
+ describe('Upload transcript file - preview tab', () => {
419
+ abortEarlySetup();
420
+ before(() => {
421
+ audioPlayerPage.steps.navigateToCreateResource('audio player');
422
+ audioPlayerPage.steps.switchToPreviewTab();
423
+ });
424
+
425
+ it('When the user has not set any transcript in the edit tab, then transcript button should not be displayed in playback player in the preview tab', () => {
426
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptButton(), 'notExist');
427
+ });
428
+
429
+ it('When the user uploads a transcript file, then transcript button should be displayed in playback player in the preview tab', () => {
430
+ audioPlayerPage.steps.switchToEditTab();
431
+ audioPlayerPage.steps.uploadTranscriptFile('uploads/sample.txt');
432
+ audioPlayerPage.steps.switchToPreviewTab();
433
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptButton(), 'visible');
434
+ });
435
+
436
+ it('When user hovers on the transcript button, then the tooltip \'Show transcript\' should be displayed', () => {
437
+ audioPlayerPage.transcriptButton()
438
+ .verifyTooltip('Show transcript');
439
+ });
440
+
441
+ it('When the user clicks on the transcript button, a transcript modal should appear', () => {
442
+ audioPlayerPage.steps.clickOnTranscriptButton();
443
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptModal(), 'visible');
444
+ });
445
+
446
+ it('\'Transcript\' title should be displayed in the transcript modal', () => {
447
+ utilities.verifyInnerText(audioPlayerPage.transcriptTitlePreviewTab(), 'Transcript');
448
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptTitlePreviewTab(), 'visible');
449
+ });
450
+
451
+ it('A \'X\' close button should be displayed in the transcript modal', () => {
452
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptModalCloseButton(), 'visible');
453
+ });
454
+
455
+ it('The text of the transcript file should be displayed in the transcript modal', () => {
456
+ utilities.verifyInnerText(audioPlayerPage.transcriptContentPreviewTab(), 'sample txt file');
457
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptContentPreviewTab(), 'visible');
458
+ });
459
+
460
+ //Failing due to https://redmine.zeuslearning.com/issues/549855
461
+ it('CSS of transcript modal', { tags: 'css' }, () => {
462
+ utilities.verifyCSS(audioPlayerPage.transcriptModal(), {
463
+ 'background-color': css.color.titleContainerBg
464
+ });
465
+ utilities.verifyCSS(audioPlayerPage.transcriptTitlePreviewTab(), {
466
+ 'color': css.color.sectionHeading,
467
+ 'font-size': css.fontSize.default,
468
+ 'font-weight': css.fontWeight.semibold
469
+ });
470
+ utilities.verifyCSS(audioPlayerPage.transcriptModalCloseButton().find('svg path'), {
471
+ 'fill': css.color.activeButtons
472
+ });
473
+ });
474
+
475
+ it('Accessibility of transcript modal', { tags: 'a11y' }, () => {
476
+ cy.checkAccessibility(audioPlayerPage.transcriptModal());
477
+ });
478
+
479
+ it('The user should be able to close the transcript modal', () => {
480
+ audioPlayerPage.steps.closeTranscriptModal();
481
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptModal(), 'notExist');
482
+ });
483
+
484
+ it('When user uploads another transcript file, then updated transcript text should be displayed in the transcript modal', () => {
485
+ audioPlayerPage.steps.switchToEditTab()
486
+ audioPlayerPage.steps.uploadTranscriptFile('uploads/sample1.txt');
487
+ audioPlayerPage.steps.switchToPreviewTab();
488
+ audioPlayerPage.steps.clickOnTranscriptButton();
489
+ utilities.verifyInnerText(audioPlayerPage.transcriptContentPreviewTab(), 'Utilitatis causa amicitia est quaesita. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Collatio igitur ista te nihil iuvat. Honesta oratio, Socratica, Platonis etiam. Primum in nostrane potestate est, quid meminerimus? Duo Reges: constructio interrete. Quid, si etiam iucunda memoria est praeteritorum malorum? Si quidem, inquit, tollerem, sed relinquo. An nisi populari fama? Quamquam id quidem licebit iis existimare, qui legerint. Summum a vobis bonum voluptas dicitur. At hoc in eo M. Refert tamen, quo modo. Quid sequatur, quid repugnet, vident. Iam id ipsum absurdum, maximum malum neglegi.');
490
+ });
491
+ });
492
+
493
+ describe('Type in transcript - Preview tab', () => {
494
+ abortEarlySetup();
495
+ before(() => {
496
+ audioPlayerPage.steps.navigateToCreateResource('audio player');
497
+ audioPlayerPage.steps.switchToPreviewTab();
498
+ });
499
+
500
+ it('When the user has not set any transcript in the edit tab, then transcript button should not be displayed in playback player in the preview tab', () => {
501
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptButton(), 'notExist');
502
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptModal(), 'notExist');
503
+ });
504
+
505
+ it('When the user enters text in the transcript input field, then transcript button should be displayed in playback player in the preview tab', () => {
506
+ audioPlayerPage.steps.switchToEditTab();
507
+ audioPlayerPage.steps.selectTypeInTranscriptRadioButton();
508
+ audioPlayerPage.steps.enterTextInTranscriptInputField('So let\'s examine the relationship between time and distance, using this turtle interactive. You\'re going to get a chance to do it as well. So here\'s my little turtle. And I\'m going to be watching him move along this ruler that\'s measuring the distance that he\'s traveling. And then that information is going to be graphed. The time here is on the horizontal axis, measured in seconds. And the distance is measured here along the vertical axis, in centimeters. Now this is the distance from a starting point. So I\'m going to click just time. And we\'ll get to distance here in just a minute. I click Walk, and my turtle starts walking. He\'s moving along my ruler. And as he\'s doing so, you\'ll notice that this ruler doesn\'t match up with my time. And that\'s because this is just measuring the time that he\'s spending traveling. So now right as he stops, you\'ll see that that time on the horizontal axis keeps going on.');
509
+ audioPlayerPage.steps.switchToPreviewTab();
510
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptButton(), 'visible');
511
+ });
512
+
513
+ it('The text entered in the transcript input field should be displayed in the transcript modal', () => {
514
+ audioPlayerPage.steps.clickOnTranscriptButton();
515
+ utilities.verifyInnerText(audioPlayerPage.transcriptContentPreviewTab(), 'So let\'s examine the relationship between time and distance, using this turtle interactive. You\'re going to get a chance to do it as well. So here\'s my little turtle. And I\'m going to be watching him move along this ruler that\'s measuring the distance that he\'s traveling. And then that information is going to be graphed. The time here is on the horizontal axis, measured in seconds. And the distance is measured here along the vertical axis, in centimeters. Now this is the distance from a starting point. So I\'m going to click just time. And we\'ll get to distance here in just a minute. I click Walk, and my turtle starts walking. He\'s moving along my ruler. And as he\'s doing so, you\'ll notice that this ruler doesn\'t match up with my time. And that\'s because this is just measuring the time that he\'s spending traveling. So now right as he stops, you\'ll see that that time on the horizontal axis keeps going on.');
516
+ utilities.verifyElementVisibilityState(audioPlayerPage.transcriptContentPreviewTab(), 'visible');
517
+ });
518
+
519
+ it('When the user adds an image in the transcript input field using the image option from ckEditor toolbar, the image should be displayed in the preview tab', () => {
520
+ audioPlayerPage.steps.switchToEditTab();
521
+ audioPlayerPage.steps.clearTranscriptInputField();
522
+ audioPlayerPage.steps.focusInTranscriptInputField();
523
+ audioPlayerPage.steps.selectImageOptionFromCKEditorToolbar()
524
+ audioPlayerPage.steps.addImageToInputField();
525
+ audioPlayerPage.steps.switchToPreviewTab();
526
+ audioPlayerPage.steps.clickOnTranscriptButton();
527
+ audioPlayerPage.steps.verifyImageAndAltTextInTranscriptPreviewTab();
528
+ audioPlayerPage.steps.closeTranscriptModal();
529
+ });
530
+
531
+ it('When the user adds an equation in the transcript input field using the image option from ckEditor toolbar, the image should be displayed in the preview tab', () => {
532
+ audioPlayerPage.steps.switchToEditTab();
533
+ audioPlayerPage.steps.clearTranscriptInputField();
534
+ audioPlayerPage.steps.focusInTranscriptInputField();
535
+ audioPlayerPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
536
+ audioPlayerPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
537
+ audioPlayerPage.steps.focusAwayFromElement();
538
+ audioPlayerPage.steps.switchToPreviewTab();
539
+ audioPlayerPage.steps.clickOnTranscriptButton();
540
+ audioPlayerPage.steps.verifyEquationInTranscriptPreviewTab();
541
+ audioPlayerPage.steps.closeTranscriptModal();
542
+ });
543
+
544
+ it('When the user adds a link in the transcript input field using the image option from ckEditor toolbar, the image should be displayed in the preview tab', () => {
545
+ audioPlayerPage.steps.switchToEditTab();
546
+ audioPlayerPage.steps.clearTranscriptInputField();
547
+ audioPlayerPage.steps.focusInTranscriptInputField();
548
+ audioPlayerPage.steps.selectLinkOptionFromCKEditorToolbar();
549
+ audioPlayerPage.steps.addLinkToInputField();
550
+ audioPlayerPage.steps.switchToPreviewTab();
551
+ audioPlayerPage.steps.clickOnTranscriptButton();
552
+ audioPlayerPage.steps.verifyLinkInTranscriptPreviewTab();
553
+ audioPlayerPage.steps.closeTranscriptModal();
554
+ });
555
+
556
+ it('When the user adds a bold text in the transcript input field using the image option from ckEditor toolbar, the image should be displayed in the preview tab', () => {
557
+ audioPlayerPage.steps.switchToEditTab();
558
+ audioPlayerPage.steps.clearTranscriptInputField();
559
+ audioPlayerPage.steps.focusInTranscriptInputField();
560
+ audioPlayerPage.steps.selectBoldOptionFromCKEditorToolbar();
561
+ audioPlayerPage.steps.enterTextInTranscriptInputField('This is a bold text in transcript');
562
+ audioPlayerPage.steps.switchToPreviewTab();
563
+ audioPlayerPage.steps.clickOnTranscriptButton();
564
+ audioPlayerPage.steps.verifyBoldTextInTranscriptPreviewTab();
565
+ audioPlayerPage.steps.closeTranscriptModal();
566
+ });
567
+ });
568
+ });
@@ -13,7 +13,7 @@ describe('Bar audio player style: Preview tab functionality', () => {
13
13
  abortEarlySetup();
14
14
  before(() => {
15
15
  audioPlayerPage.steps.navigateToCreateResource('audio player');
16
- audioPlayerPage.steps.uploadFile('uploads/sample.mp3');
16
+ audioPlayerPage.steps.uploadAudioFile('uploads/sample.mp3');
17
17
  audioPlayerPage.steps.switchToPreviewTab();
18
18
  });
19
19
 
@@ -133,7 +133,7 @@ describe('Bar audio player style: Preview tab functionality', () => {
133
133
  abortEarlySetup();
134
134
  before(() => {
135
135
  audioPlayerPage.steps.navigateToCreateResource('audio player');
136
- audioPlayerPage.steps.uploadFile('uploads/sample.mp3');
136
+ audioPlayerPage.steps.uploadAudioFile('uploads/sample.mp3');
137
137
  audioPlayerPage.steps.switchToPreviewTab();
138
138
  audioPlayerPage.steps.startPlayback();
139
139
  audioPlayerPage.steps.waitForPlaybackToBegin();
@@ -208,7 +208,7 @@ describe('Bar audio player style: Preview tab functionality', () => {
208
208
  abortEarlySetup();
209
209
  before(() => {
210
210
  audioPlayerPage.steps.navigateToCreateResource('audio player');
211
- audioPlayerPage.steps.uploadFile('uploads/sample.mp3');
211
+ audioPlayerPage.steps.uploadAudioFile('uploads/sample.mp3');
212
212
  audioPlayerPage.steps.switchToPreviewTab();
213
213
  });
214
214
 
@@ -233,7 +233,7 @@ describe('Bar audio player style: Preview tab functionality', () => {
233
233
  abortEarlySetup();
234
234
  before(() => {
235
235
  audioPlayerPage.steps.navigateToCreateResource('audio player');
236
- audioPlayerPage.steps.uploadFile('uploads/sample.mp3');
236
+ audioPlayerPage.steps.uploadAudioFile('uploads/sample.mp3');
237
237
  audioPlayerPage.steps.switchToPreviewTab();
238
238
  });
239
239