itemengine-cypress-automation 1.0.113 → 1.0.114

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.js +489 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.js +482 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +488 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +92 -0
  5. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +229 -0
  6. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  7. package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +67 -0
  8. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -1
  9. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +11 -11
  10. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +529 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +108 -190
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +83 -155
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +104 -315
  14. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +121 -135
  15. package/cypress/e2e/ILC/EssayResponseMath/createItem.js +17 -0
  16. package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +203 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +121 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +236 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsBasic.js +255 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +237 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +236 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  23. package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +43 -0
  24. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +187 -0
  25. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
  26. package/cypress/e2e/ILC/ShortTextResponseNew/checkAnswerFunctionalityForAllViews.smoke.js +99 -0
  27. package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +97 -0
  28. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +74 -0
  29. package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +83 -0
  30. package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +109 -0
  31. package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +66 -0
  32. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +326 -0
  33. package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +163 -0
  34. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +8 -8
  35. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +3 -3
  36. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +154 -0
  37. package/cypress/pages/audioResponsePage.js +523 -66
  38. package/cypress/pages/components/autoScoredScoringPreviewTab.js +2 -0
  39. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +6 -5
  40. package/cypress/pages/components/equationEditorFlyout.js +11 -0
  41. package/cypress/pages/components/essayResponseCommonComponents.js +290 -19
  42. package/cypress/pages/components/maximumRecorderLengthComponent.js +32 -15
  43. package/cypress/pages/components/playbackControlsBaseComponent.js +9 -1
  44. package/cypress/pages/components/questionInputFieldComponent.js +0 -7
  45. package/cypress/pages/essayResponseBasicPage.js +1 -26
  46. package/cypress/pages/essayResponsePage.js +21 -284
  47. package/cypress/pages/shortTextResponsePage.js +142 -103
  48. package/cypress/pages/textEntryMathPage.js +58 -7
  49. package/package.json +1 -1
@@ -0,0 +1,489 @@
1
+ import { dialogBoxBase } from "../../../pages";
2
+ import { audioResponsePage } from "../../../pages/audioResponsePage";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+ describe('Preview of Audio response for bar audio recorder style', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Preview of bar audio recorder style', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ audioResponsePage.steps.navigateToCreateQuestion('audio response');
15
+ cy.barsPreLoaderWait();
16
+ audioResponsePage.steps.selectAudioRecorderStyle('Bar');
17
+ audioResponsePage.steps.switchToPreviewTab();
18
+ });
19
+
20
+ it('By default: Mic icon, \'Allow microphone access\' help text should be displayed in \'bar audio recorder\'. Maximum recording length should be displayed in minutes(mm:ss) format.', () => {
21
+ utilities.verifyInnerText(audioResponsePage.barPreviewStartRecordingButton(), 'REC');
22
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewStartRecordingButton(), 'visible');
23
+ utilities.verifyElementVisibilityState(audioResponsePage.microphoneIcon(), 'visible');
24
+ utilities.verifyInnerText(audioResponsePage.allowMicrophoneAccessHelpText(), 'Allow microphone access');
25
+ utilities.verifyElementVisibilityState(audioResponsePage.allowMicrophoneAccessHelpText(), 'visible');
26
+ utilities.verifyInnerText(audioResponsePage.barPreviewRecordTime(), '15:00');
27
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewRecordTime(), 'visible');
28
+ });
29
+
30
+ it('CSS of \'Preview\' section', { tags: 'css' }, () => {
31
+ utilities.verifyCSS(audioResponsePage.barPreviewStartRecordingButton(), {
32
+ 'color': css.color.defaultBackground,
33
+ 'font-size': css.fontSize.small,
34
+ 'font-weight': css.fontWeight.semibold,
35
+ 'border': `2px solid ${css.color.defaultBackground}`,
36
+ 'background-color': css.color.recordingIcon
37
+ });
38
+ utilities.verifyCSS(audioResponsePage.microphoneIcon().find('path').eq(1), {
39
+ 'fill': css.color.microphoneIcon
40
+ });
41
+ utilities.verifyCSS(audioResponsePage.allowMicrophoneAccessHelpText(), {
42
+ 'color': css.color.liText,
43
+ 'font-size': css.fontSize.normal,
44
+ 'font-weight': css.fontWeight.regular
45
+ });
46
+ utilities.verifyCSS(audioResponsePage.barPreviewRecordTime(), {
47
+ 'color': css.color.liText,
48
+ 'font-size': css.fontSize.small,
49
+ 'font-weight': css.fontWeight.bold
50
+ });
51
+ });
52
+
53
+ it('When the user clicks on the \'Start recording\' button, a countdown should begin and help text "Preparing to record" should be displayed. The recording should start after the countdown, a beep sound should play and the help text should change to "Recording...". User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs / min:sec)\'. Pause recording and Stop recording buttons should be displayed in record player. Start recording button should not be displayed.', () => {
54
+ audioResponsePage.steps.startRecordingBarPreview();
55
+ utilities.verifyInnerText(audioResponsePage.recordingStatusText(), 'Preparing to record 3');
56
+ utilities.verifyElementVisibilityState(audioResponsePage.recordingStatusIcon(), 'visible');
57
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewPauseRecordingButton(), 'visible');
58
+ utilities.verifyElementDisabled(audioResponsePage.barPreviewPauseRecordingButton());
59
+ audioResponsePage.steps.waitForRecordingToStartBarPreview();
60
+ audioResponsePage.steps.addWaitToRecordAudio(2000);
61
+ audioResponsePage.steps.verifyRecordingTimeBarPreview('00:03', '15:00');
62
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewPauseRecordingButton(), 'visible');
63
+ utilities.verifyElementNotDisabled(audioResponsePage.barPreviewPauseRecordingButton());
64
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewStopRecordingButton(), 'visible');
65
+ utilities.verifyElementVisibilityState(audioResponsePage.recordingStatusIcon(), 'visible');
66
+ utilities.verifyInnerText(audioResponsePage.recordingStatusText(), 'Recording...');
67
+ });
68
+
69
+ it('CSS of \'Preview\' section once recording starts', { tags: 'css' }, () => {
70
+ cy.log('Pre-step : Switching to edit tab and back to preview tab to reset the recorder, then recording a response');
71
+ audioResponsePage.steps.resetQuestionPreview();
72
+ audioResponsePage.steps.startRecordingBarPreview();
73
+ audioResponsePage.steps.waitForRecordingToStartBarPreview();
74
+ utilities.verifyCSS(audioResponsePage.recordingStatusText(), {
75
+ 'color': css.color.liText,
76
+ 'font-size': css.fontSize.normal,
77
+ 'font-weight': css.fontWeight.regular
78
+ });
79
+ utilities.verifyCSS(audioResponsePage.barPreviewPauseRecordingButton(), {
80
+ 'border': `1px solid ${css.color.secondaryBtnActive}`
81
+ });
82
+ utilities.verifyCSS(audioResponsePage.barPreviewPauseRecordingButton().find('svg rect'), {
83
+ 'fill': css.color.secondaryBtnBg
84
+ });
85
+ utilities.verifyCSS(audioResponsePage.barPreviewPauseRecordingButton().find('svg path'), {
86
+ 'stroke': css.color.secondaryBtnActive
87
+ });
88
+ utilities.verifyCSS(audioResponsePage.barPreviewStopRecordingButton(), {
89
+ 'border': `1px solid ${css.color.secondaryBtnActive}`
90
+ });
91
+ utilities.verifyCSS(audioResponsePage.barPreviewStopRecordingButton().find('svg rect').eq(0), {
92
+ 'fill': css.color.secondaryBtnBg
93
+ });
94
+ utilities.verifyCSS(audioResponsePage.barPreviewStopRecordingButton().find('svg rect').eq(1), {
95
+ 'fill': css.color.secondaryBtnActive
96
+ });
97
+ utilities.verifyCSS(audioResponsePage.barPreviewRecordTime(), {
98
+ 'color': css.color.liText,
99
+ 'font-size': css.fontSize.small,
100
+ 'font-weight': css.fontWeight.bold
101
+ });
102
+ });
103
+
104
+ it('Accessibility of \'Preview\' section once recording starts', { tags: 'a11y' }, () => {
105
+ cy.checkAccessibility(audioResponsePage.previewTabQuestionWrapper());
106
+ });
107
+
108
+ it('When the user hovers on \'Pause recording\' button, \'Pause recording\' text should be displayed in tooltip', () => {
109
+ audioResponsePage.barPreviewPauseRecordingButton()
110
+ .verifyTooltip('Pause recording');
111
+ });
112
+
113
+ it('When recording is inprogress and the user clicks on \'Pause recording\' icon, recording should pause and the help text should update to \'Recording paused\'. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs / min:sec)\'. \'Pause recording\' button should get replaced with \'Resume recording\' button. \'Stop recording\' button should be displayed beside resume recording icon', () => {
114
+ audioResponsePage.steps.resetQuestionPreview();
115
+ audioResponsePage.steps.startRecordingBarPreview();
116
+ audioResponsePage.steps.waitForRecordingToStartBarPreview();
117
+ audioResponsePage.steps.addWaitToRecordAudio(2000);
118
+ audioResponsePage.steps.pauseRecordingBarPreview();
119
+ utilities.verifyInnerText(audioResponsePage.recordingStatusText(), 'Recording paused');
120
+ utilities.verifyElementVisibilityState(audioResponsePage.pauseIcon(), 'visible');
121
+ audioResponsePage.steps.verifyRecordingTimeBarPreview('00:03', '15:00');
122
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewPauseRecordingButton(), 'notExist');
123
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewResumeRecordingButton(), 'visible');
124
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewStopRecordingButton(), 'visible');
125
+ });
126
+
127
+ it('When the user hovers over the \'Resume\' button, a tooltip \'Resume recording\' should be displayed and on moving away the focus, the tooltip should disappear', () => {
128
+ audioResponsePage.barPreviewResumeRecordingButton()
129
+ .verifyTooltip('Resume recording');
130
+ });
131
+
132
+ it('CSS of \'Preview\' section if recording is paused', { tags: 'css' }, () => {
133
+ cy.log('CSS of Resume recording button and help text');
134
+ utilities.verifyCSS(audioResponsePage.recordingStatusText(), {
135
+ 'color': css.color.liText,
136
+ 'font-size': css.fontSize.normal,
137
+ 'font-weight': css.fontWeight.regular
138
+ });
139
+ utilities.verifyCSS(audioResponsePage.barPreviewResumeRecordingButton().find('circle'), {
140
+ 'fill': css.color.defaultBackground
141
+ });
142
+ utilities.verifyCSS(audioResponsePage.barPreviewResumeRecordingButton().find('path'), {
143
+ 'fill': css.color.recordingIcon
144
+ });
145
+ cy.log('CSS of tooltip of Resume recording button');
146
+ utilities.triggerMouseover(audioResponsePage.barPreviewResumeRecordingButton());
147
+ utilities.verifyCSS(audioResponsePage.tooltipText(), {
148
+ 'color': css.color.helperText,
149
+ 'background-color': css.color.defaultBackground,
150
+ 'font-size': css.fontSize.normal,
151
+ 'font-weight': css.fontWeight.regular
152
+ });
153
+ utilities.triggerMouseout(audioResponsePage.barPreviewResumeRecordingButton());
154
+ utilities.verifyElementVisibilityState(audioResponsePage.tooltipText(), 'notExist');
155
+ cy.log('CSS of tooltip of Stop recording button');
156
+ utilities.triggerMouseover(audioResponsePage.barPreviewStopRecordingButton());
157
+ utilities.verifyCSS(audioResponsePage.tooltipText(), {
158
+ 'color': css.color.helperText,
159
+ 'background-color': css.color.defaultBackground,
160
+ 'font-size': css.fontSize.normal,
161
+ 'font-weight': css.fontWeight.regular
162
+ });
163
+ utilities.triggerMouseout(audioResponsePage.barPreviewStopRecordingButton());
164
+ utilities.verifyElementVisibilityState(audioResponsePage.tooltipText(), 'notExist');
165
+ });
166
+
167
+ it('Accessibility of \'Preview\' section if recording is paused', { tags: 'a11y' }, () => {
168
+ cy.checkAccessibility(audioResponsePage.previewTabQuestionWrapper());
169
+ });
170
+
171
+ it('When the recorder is in paused state and the user clicks on the \'Resume recording\' button, recording should get resumed. The help text should update to "Recording...". Progress bar should display the elapsed time and the remaining time until recording is in progress. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs / min:sec)\'. Pause recording and stop recording icon should be displayed. Start recording button should not be displayed', () => {
172
+ audioResponsePage.steps.resumeRecordingBarPreview();
173
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewStartRecordingButton(), 'notExist');
174
+ utilities.verifyInnerText(audioResponsePage.recordingStatusText(), 'Recording...');
175
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewPauseRecordingButton(), 'visible');
176
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewStopRecordingButton(), 'visible');
177
+ audioResponsePage.steps.verifyRecordingLengthAfterResumingBarPreview();
178
+ });
179
+
180
+ it('When the user hovers on \'Stop recording\' button, \'Stop recording\' text should be displayed in tooltip', () => {
181
+ audioResponsePage.barPreviewStopRecordingButton()
182
+ .verifyTooltip('Stop recording');
183
+ });
184
+
185
+ it('When the recording is in-progress and the user clicks on \'Stop recording\' icon, recording should stop, recorded audio response should be saved. Retake recording button, Play recording button should be displayed. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs)\'.', () => {
186
+ audioResponsePage.steps.resetQuestionPreview();
187
+ audioResponsePage.steps.startRecordingBarPreview();
188
+ audioResponsePage.steps.waitForRecordingToStartBarPreview();
189
+ audioResponsePage.steps.addWaitToRecordAudio(3000);
190
+ audioResponsePage.steps.stopRecordingBarPreview();
191
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:00', '00:04');
192
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
193
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewRetakeButton(), 'visible');
194
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackProgressBar(), 'visible');
195
+ });
196
+
197
+ it('CSS of \'Preview\' section if recording is stopped', { tags: 'css' }, () => {
198
+ audioResponsePage.steps.resetQuestionPreview();
199
+ audioResponsePage.steps.startRecordingBarPreview();
200
+ audioResponsePage.steps.waitForRecordingToStartBarPreview();
201
+ audioResponsePage.steps.addWaitToRecordAudio(3000);
202
+ audioResponsePage.steps.stopRecordingBarPreview();
203
+ utilities.verifyCSS(audioResponsePage.recordingStatusText(), {
204
+ 'color': css.color.liText,
205
+ 'font-size': css.fontSize.normal,
206
+ 'font-weight': css.fontWeight.regular
207
+ });
208
+ });
209
+
210
+ it('Accessibility of \'Preview\' section if recording is stopped', { tags: 'a11y' }, () => {
211
+ cy.checkAccessibility(audioResponsePage.previewTabQuestionWrapper());
212
+ });
213
+
214
+ it('When the user stops paused recording, recording should stop, recorded audio response should be saved. Progress bar and start recording button should be displayed on bar player. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs)\'. Play button should be displayed. Stop recording button should not be displayed', () => {
215
+ audioResponsePage.steps.resetQuestionPreview();
216
+ audioResponsePage.steps.startRecordingBarPreview();
217
+ audioResponsePage.steps.waitForRecordingToStartBarPreview();
218
+ audioResponsePage.steps.addWaitToRecordAudio(3000);
219
+ audioResponsePage.steps.pauseRecordingBarPreview();
220
+ audioResponsePage.steps.stopRecordingBarPreview();
221
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
222
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewPlaybackTime(), 'visible');
223
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackProgressBar(), 'visible');
224
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:00', '00:04');
225
+ });
226
+
227
+ it('When recording is inprogress and user has reached maximum recorder length, Retake and Play icon should be displayed along with progress bar. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs)\'.', () => {
228
+ audioResponsePage.steps.switchToEditTab();
229
+ audioResponsePage.steps.setMaximumRecorderLength(10);
230
+ audioResponsePage.steps.switchToPreviewTab();
231
+ audioResponsePage.steps.startRecordingBarPreview();
232
+ audioResponsePage.steps.waitForRecordingToStartBarPreview();
233
+ cy.log('Response will keep recording until maximum recording length of 10 seconds is reached');
234
+ utilities.verifyInnerText(audioResponsePage.recordingStatusText(), 'Recording...');
235
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewRetakeButton(), 'visible');
236
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
237
+ utilities.verifyElementVisibilityState(audioResponsePage.previewVolumeMeter(), 'visible');
238
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewPlaybackTime(), 'visible');
239
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackProgressBar(), 'visible');
240
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:10', '00:10');
241
+ });
242
+ });
243
+
244
+ describe('Playback player : Default state', () => {
245
+ abortEarlySetup();
246
+ before(() => {
247
+ audioResponsePage.steps.navigateToCreateQuestion('audio response');
248
+ cy.barsPreLoaderWait();
249
+ audioResponsePage.steps.selectAudioRecorderStyle('Bar');
250
+ audioResponsePage.steps.switchToPreviewTab();
251
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(5000);
252
+ });
253
+
254
+ it('A playback player with audio wave form, Volume meter, Retake recording and Play buttons, Volume control and playback speed buttons, Progress bar and time in (mm:ss / mm:ss) format should be displayed', () => {
255
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewRetakeButton(), 'visible');
256
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
257
+ utilities.verifyElementVisibilityState(audioResponsePage.volumeControlButton(), 'visible');
258
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackSpeedButton(), 'visible');
259
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackProgressBar(), 'visible');
260
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewPlaybackTime(), 'visible');
261
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:00', '00:05');
262
+ });
263
+
264
+ it('The progress bar should have a slider so that user can click/drag to seek the audio.', () => {
265
+ utilities.verifyElementVisibilityState(audioResponsePage.progressBarSlider(), 'visible');
266
+ });
267
+
268
+ it('CSS of bar recorder style playback player', { tags: 'css' }, () => {
269
+ utilities.verifyCSS(audioResponsePage.barPreviewRetakeButton().find('circle'), {
270
+ 'fill': css.color.defaultBackground
271
+ });
272
+ utilities.verifyCSS(audioResponsePage.barPreviewRetakeButton().find('path'), {
273
+ 'fill': css.color.recordingIcon
274
+ });
275
+ utilities.verifyCSS(audioResponsePage.playbackPlayButton(), {
276
+ 'border': `1px solid ${css.color.secondaryBtnActive}`
277
+ });
278
+ utilities.verifyCSS(audioResponsePage.playbackPlayButton().find('svg rect'), {
279
+ 'fill': css.color.secondaryBtnBg
280
+ });
281
+ utilities.verifyCSS(audioResponsePage.playbackPlayButton().find('svg path'), {
282
+ 'stroke': css.color.secondaryBtnActive
283
+ });
284
+ utilities.verifyCSS(audioResponsePage.barPreviewPlaybackTime(), {
285
+ 'color': css.color.liText,
286
+ 'font-size': css.fontSize.small,
287
+ 'font-weight': css.fontWeight.bold
288
+ });
289
+ utilities.verifyCSS(audioResponsePage.playbackProgressBar().find('.MuiSlider-thumbSizeMedium'), {
290
+ 'background-color': css.color.activeButtons
291
+ });
292
+ utilities.verifyCSS(audioResponsePage.playbackProgressBar().find('.MuiSlider-rail'), {
293
+ 'border': `1px solid ${css.color.activeButtons}`
294
+ });
295
+ utilities.verifyCSS(audioResponsePage.volumeControlButton().find('[data-name="minimal-volume-icon"]'), {
296
+ 'fill': css.color.activeButtons
297
+ });
298
+ utilities.verifyCSS(audioResponsePage.playbackSpeedButton().find('[id="playback-speed"] path'), {
299
+ 'fill': css.color.activeButtons
300
+ });
301
+ });
302
+
303
+ it('Accessibility of playback player - default state', { tags: 'a11y' }, () => {
304
+ cy.checkAccessibility(audioResponsePage.barPreviewPlaybackWrapper());
305
+ });
306
+ });
307
+
308
+ describe('Playback player : Play, pause and seek', () => {
309
+ let actualAudioSeekedInPercent = 50
310
+ abortEarlySetup();
311
+ before(() => {
312
+ audioResponsePage.steps.navigateToCreateQuestion('audio response');
313
+ cy.barsPreLoaderWait();
314
+ audioResponsePage.steps.selectAudioRecorderStyle('Bar');
315
+ audioResponsePage.steps.switchToPreviewTab();
316
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(10000);
317
+ });
318
+
319
+ it('When the user hovers over the \'Play\' button, a tooltip \'Play\' should be displayed and on moving away the focus, the tooltip should disappear', () => {
320
+ audioResponsePage.playbackPlayButton()
321
+ .verifyTooltip('Play');
322
+ });
323
+
324
+ it('When the user clicks on \'Play\' button, then the audio should start playing. Timer should display the amount of audio that has been played and the total audio length in (mm:ss)/(mm:ss) format.', () => {
325
+ audioResponsePage.steps.startPlayback();
326
+ audioResponsePage.steps.waitForPlaybackToBeginBarPreview();
327
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:03', '00:10');
328
+ });
329
+
330
+ it('When the user hovers over the \'Pause\' button, a tooltip \'Pause\' should be displayed and on moving away the focus, the tooltip should disappear', () => {
331
+ audioResponsePage.playbackPauseButton()
332
+ .verifyTooltip('Pause');
333
+ });
334
+
335
+ it('CSS of \'Preview\' section if playback is initiated', { tags: 'css' }, () => {
336
+ utilities.verifyCSS(audioResponsePage.barPreviewPlaybackTime(), {
337
+ 'color': css.color.liText,
338
+ 'font-size': css.fontSize.small,
339
+ 'font-weight': css.fontWeight.bold
340
+ });
341
+ utilities.verifyCSS(audioResponsePage.playbackPauseButton().find('svg rect'), {
342
+ 'fill': css.color.secondaryBtnBg
343
+ });
344
+ utilities.verifyCSS(audioResponsePage.playbackPauseButton().find('svg path'), {
345
+ 'stroke': css.color.secondaryBtnActive
346
+ });
347
+ });
348
+
349
+ it('Accessibility of \'Preview\' section if playback is initiated', { tags: 'a11y' }, () => {
350
+ cy.checkAccessibility(audioResponsePage.barPreviewPlaybackWrapper());
351
+ });
352
+
353
+ it('When the audio player is in playback state and the user clicks on \'Pause\' button, then playback should get paused. Progress bar and timer should not update further and the \'Pause\' button should get replaced with \'Play\' button', () => {
354
+ audioResponsePage.steps.resetQuestionPreview();
355
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(10000);
356
+ audioResponsePage.steps.startPlayback();
357
+ audioResponsePage.steps.waitForPlaybackToBeginBarPreview();
358
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:05', '00:10');
359
+ audioResponsePage.steps.pauseAndVerifyProgressBarSliderPosition();
360
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:05', '00:10');
361
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
362
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'notExist');
363
+ });
364
+
365
+ it('CSS of \'Preview\' section if playback is paused', { tags: 'css' }, () => {
366
+ utilities.verifyCSS(audioResponsePage.playbackPlayButton().find('svg rect'), {
367
+ 'fill': css.color.secondaryBtnBg
368
+ });
369
+ utilities.verifyCSS(audioResponsePage.playbackPlayButton().find('svg path'), {
370
+ 'stroke': css.color.secondaryBtnActive
371
+ });
372
+ });
373
+
374
+ it('Accessibility of \'Preview\' section if if playback is paused', { tags: 'a11y' }, () => {
375
+ cy.checkAccessibility(audioResponsePage.barPreviewPlaybackWrapper());
376
+ });
377
+
378
+ it('When audio player is in paused state and user clicks on \'Play\' button, then playback should get resumed and \'Play\' button should get replaced with \'Pause\' button.', () => {
379
+ audioResponsePage.steps.startPlayback();
380
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'visible');
381
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'notExist');
382
+ });
383
+
384
+ it('When the user seeks the progress bar slider while the audio is playing, then the audio should continue to play from the position where the slider is seeked', () => {
385
+ audioResponsePage.steps.seekProgressBarSliderToCenter();
386
+ audioResponsePage.steps.addWaitToPlayAudio(1000);
387
+ audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
388
+ });
389
+
390
+ it('When the user seeks the progress bar slider while the audio is paused, then the audio playback should be in paused state and on playing the audio, then the audio should play from the position where the slider is seeked', () => {
391
+ audioResponsePage.steps.pausePlayback();
392
+ audioResponsePage.steps.seekProgressBarSliderToCenter();
393
+ audioResponsePage.steps.startPlayback();
394
+ audioResponsePage.steps.addWaitToPlayAudio(5000);
395
+ audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
396
+ });
397
+
398
+ it('When the audio playback is completed, the \'Pause\' button should get replaced with \'Play\' button', () => {
399
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:45', '00:45');
400
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
401
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'notExist');
402
+ audioResponsePage.steps.verifyProgressBarSliderPosition(99);
403
+ });
404
+
405
+ it('CSS of progress bar in hover state', { tags: 'css' }, () => {
406
+ audioResponsePage.steps.hoverOnProgressBarSlider();
407
+ utilities.verifyCSS(audioResponsePage.progressBarSlider().parents('span[class*="MuiSlider-thumb"]'), {
408
+ 'box-shadow': `${css.color.progressBarSliderHoverBackground} 0px 0px 0px 8px`
409
+ });
410
+ });
411
+ });
412
+
413
+ describe('Playback player : Volume control', () => {
414
+ abortEarlySetup();
415
+ before(() => {
416
+ audioResponsePage.steps.navigateToCreateQuestion('audio response');
417
+ cy.barsPreLoaderWait();
418
+ audioResponsePage.steps.selectAudioRecorderStyle('Bar');
419
+ audioResponsePage.steps.switchToPreviewTab();
420
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(10000);
421
+ });
422
+
423
+ audioResponsePage.tests.verifyVolumeControlFunctionality();
424
+ });
425
+
426
+ describe('Playback player : Playback speed', () => {
427
+ const playbackSpeedOptions = ['1', '1.25', '1.5', '2'];
428
+ abortEarlySetup();
429
+ before(() => {
430
+ audioResponsePage.steps.navigateToCreateQuestion('audio response');
431
+ cy.barsPreLoaderWait();
432
+ audioResponsePage.steps.selectAudioRecorderStyle('Bar');
433
+ audioResponsePage.steps.switchToPreviewTab();
434
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(10000);
435
+ });
436
+
437
+ audioResponsePage.tests.verifyPlaybackSpeedContents();
438
+
439
+ for (let index = 0; index < playbackSpeedOptions.length; index++) {
440
+ it(`When the user selects playback speed option ${playbackSpeedOptions[index]}x, the audio playback speed should be changed accordingly`, () => {
441
+ audioResponsePage.steps.resetQuestionPreview();
442
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(12000);
443
+ utilities.hoverOverElement(audioResponsePage.playbackSpeedButton());
444
+ audioResponsePage.steps.selectPlaybackSpeed(`${playbackSpeedOptions[index]}x`);
445
+ audioResponsePage.steps.startPlayback();
446
+ audioResponsePage.steps.waitForPlaybackToBeginBarPreview();
447
+ audioResponsePage.steps.addWaitToPlayAudio(4000);
448
+ audioResponsePage.steps.pausePlayback();
449
+ audioResponsePage.steps.verifyPlaybackElapsedTime(1 + (4 * playbackSpeedOptions[index]), 'Bar');
450
+ });
451
+ };
452
+ });
453
+
454
+ describe('Playback player : Retake my audio response', () => {
455
+ abortEarlySetup();
456
+ before(() => {
457
+ audioResponsePage.steps.navigateToCreateQuestion('audio response');
458
+ cy.barsPreLoaderWait();
459
+ audioResponsePage.steps.selectAudioRecorderStyle('Bar');
460
+ audioResponsePage.steps.setMaximumRecorderLength(10);
461
+ audioResponsePage.steps.switchToPreviewTab();
462
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(5000);
463
+ });
464
+
465
+ it('When the user clicks on \'Retake\' icon button, \'Retake\' popup should be displayed along with \'Are you sure you want to overwrite the existing audio recording?\' message', () => {
466
+ audioResponsePage.steps.retakeRecordingBarPreview();
467
+ utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'Retake');
468
+ audioResponsePage.steps.verifyRetakePopupContents();
469
+ });
470
+
471
+ audioResponsePage.tests.verifyRetakePopupCSSAndA11y();
472
+
473
+ it('When the user clicks on \'Cancel\' button, \'Retake\' popup should close and previous state of playback player should persist', () => {
474
+ audioResponsePage.steps.cancelRetake();
475
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
476
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewRetakeButton(), 'visible');
477
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
478
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:00', '00:05');
479
+ });
480
+
481
+ it('When the user clicks on Confirm button of the retake popup, the previous recording should get deleted and a new recording should begin', () => {
482
+ audioResponsePage.steps.retakeRecordingBarPreview();
483
+ audioResponsePage.steps.confirmRetake();
484
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
485
+ utilities.verifyInnerText(audioResponsePage.recordingStatusText(), 'Recording...');
486
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:00', '00:10');
487
+ });
488
+ });
489
+ });