itemengine-cypress-automation 1.0.20 → 1.0.22
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponse/audioResponseAdditionalSettings.js +848 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseEditTabBasicSections.js +1230 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseHeaderSection.js +80 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseMinimalPreviewSection.js +941 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseScoringSection.js +60 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseStandardPreviewSection.js +862 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -123
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.js +0 -774
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditorCategories1.js +290 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditorCategories2.js +514 -0
- package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
- package/package.json +1 -1
- /package/cypress/e2e/ILC/{EssayResponse → EssayResponseMath}/essayResponseMathCharacters.js +0 -0
- /package/cypress/e2e/ILC/{EssayResponse → EssayResponseMath}/essayResponseMathCreateItem.js +0 -0
@@ -0,0 +1,862 @@
|
|
1
|
+
import { audioResponsePage } from "../../../pages/audioResponsePage";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
|
5
|
+
describe('Preview tab of Audio Response', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Preview of standard audio recorder style', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
cy.log('Navigating to Audio Response question type');
|
14
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
15
|
+
audioResponsePage.steps.setMaximumRecorderLength(10);
|
16
|
+
audioResponsePage.steps.switchToPreviewTab();
|
17
|
+
});
|
18
|
+
|
19
|
+
it('CSS of \'Preview\' section', { tags: 'css' }, () => {
|
20
|
+
audioResponsePage.previewMicIcon()
|
21
|
+
.should('have.css', 'fill', css.color.audioResponsePreviewComponentsFill);
|
22
|
+
audioResponsePage.standardPreviewRecorderHelpText()
|
23
|
+
.verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
|
24
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
25
|
+
.find('svg')
|
26
|
+
.should('have.css', 'fill', css.color.startRecordingIconFill);
|
27
|
+
audioResponsePage.previewMaxRecordTime()
|
28
|
+
.verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
|
29
|
+
audioResponsePage.standardPreviewRecorderWrapper()
|
30
|
+
.should('have.css', 'border-color', css.color.audioResponsePreviewComponentsFill);
|
31
|
+
audioResponsePage.previewRecordProgressBar()
|
32
|
+
.should('have.css', 'background', `${css.color.transparent} linear-gradient(to right, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarRemainingFill} -100%, ${css.color.progressBarRemainingFill} 100%) repeat scroll 0% 0% / auto padding-box border-box`);
|
33
|
+
audioResponsePage.standardPreviewDisabledPlayButton()
|
34
|
+
.should('have.css', 'opacity', '0.38')
|
35
|
+
.find('svg')
|
36
|
+
.should('have.css', 'fill', css.color.secondaryBtnActive);
|
37
|
+
});
|
38
|
+
|
39
|
+
it('Accessibility of \'Preview\' section', { tags: 'a11y' }, () => {
|
40
|
+
cy.checkAccessibility(audioResponsePage.previewTabQuestionWrapper());
|
41
|
+
});
|
42
|
+
|
43
|
+
it('By default: \'Click record to begin\' help text message, mic icon, progress bar and Start recording should be displayed in \'Standard audio recorder\'. Maximum recording length should be displayed in minutes(mm:ss) format. Play button should be displayed in disabled state', () => {
|
44
|
+
audioResponsePage.standardPreviewRecorderHelpText()
|
45
|
+
.verifyInnerText('Click record to begin');
|
46
|
+
audioResponsePage.previewMicIcon()
|
47
|
+
.should('be.visible');
|
48
|
+
audioResponsePage.previewRecordProgressBar()
|
49
|
+
.should('be.visible');
|
50
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
51
|
+
.should('be.enabled')
|
52
|
+
.and('be.visible');
|
53
|
+
audioResponsePage.standardPreviewDisabledPlayButton()
|
54
|
+
.should('be.disabled')
|
55
|
+
.and('be.visible');
|
56
|
+
audioResponsePage.previewMicGlowAnimation()
|
57
|
+
.should('not.exist');
|
58
|
+
audioResponsePage.previewMaxRecordTime()
|
59
|
+
.should('be.visible')
|
60
|
+
.verifyInnerText('00:10');
|
61
|
+
});
|
62
|
+
|
63
|
+
it('When the user hovers on \'Start recording\' icon button, \'Start recording\' text should be displayed in tooltip', () => {
|
64
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
65
|
+
.trigger('mouseover');
|
66
|
+
audioResponsePage.tooltipText()
|
67
|
+
.should('be.visible')
|
68
|
+
.verifyInnerText('Start recording');
|
69
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
70
|
+
.trigger('mouseout');
|
71
|
+
audioResponsePage.tooltipText()
|
72
|
+
.should('not.exist');
|
73
|
+
});
|
74
|
+
|
75
|
+
//Comment : Unable to detect recording cue in cypress, added to manual sheet
|
76
|
+
//TODO : Change script as per new implementation after ticket is marked TL - https://redmine.zeuslearning.com/issues/525600
|
77
|
+
it('When the user clicks on the \'Start recording\' icon, the recording should start, a beep sound should play and the help text should change to "Recording..." while the glow animation should play behind the mic icon. While recording, the user should be able to view the progress bar, which displays the elapsed time and the remaining time until the recording is inprogress. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs / min:sec)\'. Volume meter, Pause recording and Stop recording should be displayed in record player. Start recording icon should not be displayed.', () => {
|
78
|
+
audioResponsePage.steps.startRecordingStandardPreview();
|
79
|
+
audioResponsePage.previewMicGlowAnimation()
|
80
|
+
.should('be.visible');
|
81
|
+
cy.log('Waiting 3 seconds so as to fill 30% of the progress bar');
|
82
|
+
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
83
|
+
audioResponsePage.steps.addWaitToRecordAudio(2000);
|
84
|
+
audioResponsePage.steps.verifyRecordingTimeStandardPreview('00:03 / 00:10');
|
85
|
+
cy.log('Verifying whether the progress bar is 30% filled')
|
86
|
+
audioResponsePage.previewRecordProgressBar()
|
87
|
+
.should('be.visible')
|
88
|
+
.and('have.css', 'background', `${css.color.transparent} linear-gradient(to right, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarElapsedFill} 30%, ${css.color.progressBarRemainingFill} -70%, ${css.color.progressBarRemainingFill} 100%) repeat scroll 0% 0% / auto padding-box border-box`);
|
89
|
+
audioResponsePage.standardPreviewPauseRecordingButton()
|
90
|
+
.should('be.visible');
|
91
|
+
audioResponsePage.standardPreviewStopRecordingButton()
|
92
|
+
.should('be.visible');
|
93
|
+
audioResponsePage.steps.verifyRecordingStatusStandardPreview('Recording...');
|
94
|
+
audioResponsePage.previewVolumeMeter()
|
95
|
+
.should('be.visible');
|
96
|
+
audioResponsePage.steps.verifyVolumeMeterInDb('0dB')
|
97
|
+
});
|
98
|
+
|
99
|
+
//Comment : Unable to check volume meter go high/low (css) in cypress when recording is in progress, added to manual sheet
|
100
|
+
it('CSS of \'Preview\' section once recording starts', { tags: 'css' }, () => {
|
101
|
+
cy.log('Pre-step : Switching to edit tab and back to preview tab to reset the recorder, then recording a response');
|
102
|
+
audioResponsePage.steps.switchToEditTab();
|
103
|
+
audioResponsePage.steps.switchToPreviewTab();
|
104
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
105
|
+
.click();
|
106
|
+
audioResponsePage.previewRecordProgressBar()
|
107
|
+
.should('have.css', 'background', `${css.color.transparent} linear-gradient(to right, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarRemainingFill} -100%, ${css.color.progressBarRemainingFill} 100%) repeat scroll 0% 0% / auto padding-box border-box`);
|
108
|
+
audioResponsePage.standardPreviewPauseRecordingButton()
|
109
|
+
.find('svg')
|
110
|
+
.should('have.css', 'fill', css.color.activeButtons);
|
111
|
+
audioResponsePage.standardPreviewStopRecordingButton()
|
112
|
+
.find('svg')
|
113
|
+
.should('have.css', 'fill', css.color.activeButtons);
|
114
|
+
audioResponsePage.previewMicGlowAnimation()
|
115
|
+
.should('have.css', 'background-color', css.color.micGlowAnimation);
|
116
|
+
audioResponsePage.previewMaxRecordTime()
|
117
|
+
.verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
|
118
|
+
audioResponsePage.standardPreviewRecorderHelpText()
|
119
|
+
.verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
|
120
|
+
});
|
121
|
+
|
122
|
+
it('Accessibility of \'Preview\' section once recording starts', { tags: 'a11y' }, () => {
|
123
|
+
cy.checkAccessibility(audioResponsePage.previewTabQuestionWrapper());
|
124
|
+
});
|
125
|
+
|
126
|
+
//Comment : not checking tooltips for pause buttons as the state of the page keeps changing
|
127
|
+
it('When the user hovers on \'Pause recording\' icon button, \'Pause recording\' text should be displayed in tooltip', () => {
|
128
|
+
audioResponsePage.standardPreviewPauseRecordingButton()
|
129
|
+
.verifyTooltip('Pause recording');
|
130
|
+
});
|
131
|
+
|
132
|
+
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\'. The mic icon\'s glow animation should disappear and the volume meter should drop to \'0dB\'. Also the progress bar on the control panel should display the amount of audio recorded in relation to the total length of the recording. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs / min:sec)\'. \'Pause recording\' icon button should get replaced with \'Resume recording\' icon button. \'Stop recording\' icon should be displayed beside resume recording icon', () => {
|
133
|
+
audioResponsePage.steps.resetQuestionPreview();
|
134
|
+
audioResponsePage.steps.startRecordingStandardPreview();
|
135
|
+
cy.log('Waiting 2 seconds so as to fill 20% of the progress bar and pausing the recording');
|
136
|
+
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
137
|
+
audioResponsePage.steps.addWaitToRecordAudio(1000);
|
138
|
+
audioResponsePage.steps.pauseRecordingStandardPreview()
|
139
|
+
audioResponsePage.steps.verifyRecordingStatusStandardPreview('Recording paused');
|
140
|
+
audioResponsePage.previewMicIcon()
|
141
|
+
.should('be.visible');
|
142
|
+
audioResponsePage.previewMicGlowAnimation()
|
143
|
+
.should('not.exist');
|
144
|
+
cy.log('Verifying whether the progress bar is 20% filled')
|
145
|
+
//TODO : Change script as per new implementation after ticket is marked TL - https://redmine.zeuslearning.com/issues/525600
|
146
|
+
audioResponsePage.previewRecordProgressBar()
|
147
|
+
.should('have.css', 'background', `${css.color.transparent} linear-gradient(to right, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarElapsedFill} 20%, ${css.color.progressBarRemainingFill} -80%, ${css.color.progressBarRemainingFill} 100%) repeat scroll 0% 0% / auto padding-box border-box`);
|
148
|
+
audioResponsePage.steps.verifyRecordingTimeStandardPreview('00:02 / 00:10');
|
149
|
+
audioResponsePage.standardPreviewPauseRecordingButton()
|
150
|
+
.should('not.exist');
|
151
|
+
audioResponsePage.standardPreviewResumeRecordingButton()
|
152
|
+
.should('be.visible');
|
153
|
+
audioResponsePage.standardPreviewStopRecordingButton()
|
154
|
+
.should('be.visible');
|
155
|
+
audioResponsePage.steps.verifyVolumeMeterInDb('0dB');
|
156
|
+
});
|
157
|
+
|
158
|
+
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', () => {
|
159
|
+
audioResponsePage.standardPreviewResumeRecordingButton()
|
160
|
+
.verifyTooltip('Resume recording');
|
161
|
+
});
|
162
|
+
|
163
|
+
it('CSS of \'Preview\' section if recording is paused', { tags: 'css' }, () => {
|
164
|
+
cy.log('CSS of Resume recording button and help text');
|
165
|
+
audioResponsePage.standardPreviewResumeRecordingButton()
|
166
|
+
.find('svg')
|
167
|
+
.should('have.css', 'fill', css.color.startRecordingIconFill);
|
168
|
+
audioResponsePage.standardPreviewRecorderHelpText()
|
169
|
+
.verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
|
170
|
+
cy.log('CSS of tooltip of Resume recording button');
|
171
|
+
audioResponsePage.standardPreviewResumeRecordingButton()
|
172
|
+
.trigger('mouseover');
|
173
|
+
audioResponsePage.tooltipText()
|
174
|
+
.should('be.visible')
|
175
|
+
.verifyCSS(css.color.whiteText, css.fontSize.small, css.fontWeight.regular);
|
176
|
+
audioResponsePage.standardPreviewResumeRecordingButton()
|
177
|
+
.trigger('mouseout');
|
178
|
+
audioResponsePage.tooltipText()
|
179
|
+
.should('not.exist');
|
180
|
+
cy.log('CSS of tooltip of Stop recording button');
|
181
|
+
audioResponsePage.standardPreviewStopRecordingButton()
|
182
|
+
.trigger('mouseover');
|
183
|
+
audioResponsePage.tooltipText()
|
184
|
+
.should('be.visible')
|
185
|
+
.verifyCSS(css.color.whiteText, css.fontSize.small, css.fontWeight.regular);
|
186
|
+
audioResponsePage.standardPreviewStopRecordingButton()
|
187
|
+
.trigger('mouseout');
|
188
|
+
audioResponsePage.tooltipText()
|
189
|
+
.should('not.exist');
|
190
|
+
});
|
191
|
+
|
192
|
+
it('Accessibility of \'Preview\' section if recording is paused', { tags: 'a11y' }, () => {
|
193
|
+
cy.checkAccessibility(audioResponsePage.previewTabQuestionWrapper());
|
194
|
+
});
|
195
|
+
|
196
|
+
it('When the recorder is in paused state and the user clicks on the \'Resume recording\' icon button, recording should get resumed. The glow animation behind the mic icon should start again, and the help text should update to "Recording...". The volume meter should also detect the sound levels during 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', () => {
|
197
|
+
audioResponsePage.steps.resumeRecordingStandardPreview();
|
198
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
199
|
+
.should('not.exist');
|
200
|
+
audioResponsePage.previewMicGlowAnimation()
|
201
|
+
.should('be.visible');
|
202
|
+
audioResponsePage.standardPreviewRecorderHelpText()
|
203
|
+
.verifyInnerText('Recording...');
|
204
|
+
audioResponsePage.previewVolumeMeter()
|
205
|
+
.should('be.visible');
|
206
|
+
audioResponsePage.standardPreviewPauseRecordingButton()
|
207
|
+
.should('be.visible');
|
208
|
+
audioResponsePage.standardPreviewStopRecordingButton()
|
209
|
+
.should('be.visible');
|
210
|
+
audioResponsePage.previewVolumeMeter()
|
211
|
+
.should('have.text', '0dB');
|
212
|
+
audioResponsePage.previewMaxRecordTime()
|
213
|
+
.invoke('text')
|
214
|
+
.then(($timer) => {
|
215
|
+
const currentTimer = $timer.split(' / ')[0];
|
216
|
+
const currentSeconds = parseInt(currentTimer.split(':')[1], 10);
|
217
|
+
expect(currentSeconds).to.be.gte(1);
|
218
|
+
});
|
219
|
+
});
|
220
|
+
|
221
|
+
it('When the user hovers on \'Stop recording\' button, \'Stop recording\' text should be displayed in tooltip', () => {
|
222
|
+
audioResponsePage.standardPreviewStopRecordingButton()
|
223
|
+
.trigger('mouseover');
|
224
|
+
audioResponsePage.tooltipText()
|
225
|
+
.should('be.visible')
|
226
|
+
.verifyInnerText('Stop recording');
|
227
|
+
audioResponsePage.standardPreviewStopRecordingButton()
|
228
|
+
.trigger('mouseout');
|
229
|
+
audioResponsePage.tooltipText()
|
230
|
+
.should('not.exist');
|
231
|
+
});
|
232
|
+
|
233
|
+
it('When the recording is in-progress and the user clicks on \'Stop recording\' icon, recording should stop, recorded audio response should be saved and \'Your response has been recorded\' help text message, progress bar and retake recording icon should be displayed. Play icon should be enabled. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs)\'. Volume meter should not be displayed', () => {
|
234
|
+
audioResponsePage.steps.resetQuestionPreview();
|
235
|
+
audioResponsePage.steps.startRecordingStandardPreview();
|
236
|
+
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
237
|
+
audioResponsePage.steps.addWaitToRecordAudio(3000);
|
238
|
+
audioResponsePage.steps.stopRecordingStandardPreview();
|
239
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
240
|
+
.verifyInnerText('Your response has been recorded');
|
241
|
+
audioResponsePage.previewPlayPlaybackButton()
|
242
|
+
.should('be.visible')
|
243
|
+
.and('be.enabled');
|
244
|
+
audioResponsePage.previewVolumeMeter()
|
245
|
+
.should('not.exist');
|
246
|
+
audioResponsePage.standardPreviewRecordTime()
|
247
|
+
.should('be.visible');
|
248
|
+
audioResponsePage.previewVolumeControlButton()
|
249
|
+
.should('not.exist');
|
250
|
+
audioResponsePage.standardPreviewRecordTime()
|
251
|
+
.should('be.visible')
|
252
|
+
.verifyInnerText('00:04');
|
253
|
+
});
|
254
|
+
|
255
|
+
it('CSS of \'Preview\' section if recording is stopped', { tags: 'css' }, () => {
|
256
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
257
|
+
.verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
|
258
|
+
audioResponsePage.standardPreviewRecordTime()
|
259
|
+
.verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
|
260
|
+
audioResponsePage.standardPreviewRecordingCompletedProgressBar()
|
261
|
+
.should('have.css', 'background-color', css.color.progressBarElapsedFill);
|
262
|
+
audioResponsePage.standardPreviewRetakeButton()
|
263
|
+
.find('svg')
|
264
|
+
.should('have.css', 'fill', css.color.startRecordingIconFill)
|
265
|
+
});
|
266
|
+
|
267
|
+
it('Accessibility of \'Preview\' section if recording is stopped', { tags: 'a11y' }, () => {
|
268
|
+
cy.checkAccessibility(audioResponsePage.previewTabQuestionWrapper());
|
269
|
+
});
|
270
|
+
|
271
|
+
it('When the user stops paused recording, recording should stop, recorded audio response should be saved and \'Your response has been recorded\' help text message, progress bar and start recording icon should be displayed on standard player. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs)\'. Play icon should be displayed in enabled state. Volume meter and stop recording icon should not be displayed', () => {
|
272
|
+
audioResponsePage.steps.resetQuestionPreview();
|
273
|
+
audioResponsePage.steps.startRecordingStandardPreview();
|
274
|
+
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
275
|
+
audioResponsePage.steps.addWaitToRecordAudio(3000);
|
276
|
+
audioResponsePage.steps.pauseRecordingStandardPreview();
|
277
|
+
audioResponsePage.steps.stopRecordingStandardPreview();
|
278
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
279
|
+
.verifyInnerText('Your response has been recorded');
|
280
|
+
audioResponsePage.previewPlayPlaybackButton()
|
281
|
+
.should('be.visible')
|
282
|
+
.and('be.enabled');
|
283
|
+
audioResponsePage.previewVolumeMeter()
|
284
|
+
.should('not.exist');
|
285
|
+
audioResponsePage.standardPreviewRecordTime()
|
286
|
+
.should('be.visible');
|
287
|
+
audioResponsePage.previewVolumeControlButton()
|
288
|
+
.should('not.exist');
|
289
|
+
audioResponsePage.standardPreviewRecordTime()
|
290
|
+
.should('be.visible')
|
291
|
+
.verifyInnerText('00:04');
|
292
|
+
});
|
293
|
+
|
294
|
+
it('When recording is inprogress and user has reached maximum recorder length, \'Your response has been recorded\' message should be displayed below mic icon. 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)\'. Volume meter should not be displayed in player', () => {
|
295
|
+
audioResponsePage.steps.resetQuestionPreview();
|
296
|
+
audioResponsePage.steps.startRecordingStandardPreview();
|
297
|
+
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
298
|
+
cy.log('Response will keep recording until maximum recoring length of 10 seconds is reached');
|
299
|
+
audioResponsePage.standardPreviewRecorderHelpText()
|
300
|
+
.should('have.text', 'Recording...');
|
301
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
302
|
+
.verifyInnerText('Your response has been recorded');
|
303
|
+
audioResponsePage.standardPreviewRetakeButton()
|
304
|
+
.should('be.visible')
|
305
|
+
.and('be.enabled');
|
306
|
+
audioResponsePage.previewPlayPlaybackButton()
|
307
|
+
.should('be.visible')
|
308
|
+
.and('be.enabled');
|
309
|
+
audioResponsePage.standardPreviewRecordingCompletedProgressBar()
|
310
|
+
.should('be.visible');
|
311
|
+
audioResponsePage.standardPreviewRecordTime()
|
312
|
+
.should('be.visible')
|
313
|
+
.verifyInnerText('00:10');
|
314
|
+
audioResponsePage.previewVolumeMeter()
|
315
|
+
.should('not.exist');
|
316
|
+
});
|
317
|
+
});
|
318
|
+
|
319
|
+
describe('Standard audio recorder style- Playback player', () => {
|
320
|
+
abortEarlySetup();
|
321
|
+
before(() => {
|
322
|
+
cy.log('Navigating to Audio Response question type');
|
323
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
324
|
+
cy.log('Switching to Preview tab');
|
325
|
+
audioResponsePage.steps.switchToPreviewTab();
|
326
|
+
audioResponsePage.steps.recordAndSaveAudioStandardPreview(10000);
|
327
|
+
});
|
328
|
+
|
329
|
+
it('When the user hovers on \'Play\' icon, \'Play\' text should be displayed in tooltip', () => {
|
330
|
+
audioResponsePage.previewPlayPlaybackButton()
|
331
|
+
.trigger('mouseover');
|
332
|
+
audioResponsePage.tooltipText()
|
333
|
+
.should('be.visible')
|
334
|
+
.verifyInnerText('Play');
|
335
|
+
audioResponsePage.previewPlayPlaybackButton()
|
336
|
+
.trigger('mouseout');
|
337
|
+
audioResponsePage.tooltipText()
|
338
|
+
.should('not.exist');
|
339
|
+
});
|
340
|
+
|
341
|
+
it('When the user clicks on \'Play\' icon, then user should be able to playback the recording and helptext should be updated to \'Playback...\'. Waveform, volume meter, progress bar, volume control,\'Retake\' icon and \'Pause\' icon should be displayed in playback player. Timer should displays the amount of audio that has been played and the total recording length in (mm:ss)/(mm:ss) format. \'Your response has been recorded\' message should be displayed below playback player', () => {
|
342
|
+
audioResponsePage.previewPlayPlaybackButton()
|
343
|
+
.click();
|
344
|
+
audioResponsePage.steps.waitForPlaybackToBeginStandardPreview();
|
345
|
+
audioResponsePage.steps.addWaitForPlayback(3000);
|
346
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
347
|
+
.verifyInnerText('Playback...');
|
348
|
+
audioResponsePage.standardPreviewRecordTime()
|
349
|
+
.invoke('text')
|
350
|
+
.then(($timer) => {
|
351
|
+
const timerText = $timer.split('/')[0];
|
352
|
+
const maxTimer = $timer.split('/')[1];
|
353
|
+
const currentSeconds = parseInt(timerText.split(':')[1], 10);
|
354
|
+
const maxSeconds = parseInt(maxTimer.split(':')[1], 10);
|
355
|
+
expect(currentSeconds).to.be.gte(3);
|
356
|
+
expect(maxSeconds).to.equal(10);
|
357
|
+
});
|
358
|
+
//TODO : remove below line after https://redmine.zeuslearning.com/issues/525475 has been marked TL
|
359
|
+
audioResponsePage.previewPausePlaybackButton()
|
360
|
+
.trigger('mouseout');
|
361
|
+
audioResponsePage.previewPlaybackProgressBar()
|
362
|
+
.should('be.visible');
|
363
|
+
audioResponsePage.previewPlaybackWaveform()
|
364
|
+
.should('be.visible');
|
365
|
+
audioResponsePage.previewPausePlaybackButton()
|
366
|
+
.should('be.visible')
|
367
|
+
.and('be.enabled');
|
368
|
+
audioResponsePage.previewVolumeControlButton()
|
369
|
+
.should('be.visible');
|
370
|
+
audioResponsePage.previewVolumeMeter()
|
371
|
+
.should('be.visible')
|
372
|
+
.and('have.text', '0dB');
|
373
|
+
audioResponsePage.standardPreviewRecordTime()
|
374
|
+
.should('be.visible');
|
375
|
+
audioResponsePage.standardPreviewRetakeButton()
|
376
|
+
.should('be.visible')
|
377
|
+
.and('be.enabled');
|
378
|
+
audioResponsePage.standardPreviewHelpTextOutsideContainer()
|
379
|
+
.verifyInnerText('Your response has been recorded');
|
380
|
+
});
|
381
|
+
|
382
|
+
//Comment : Unable to check volume meter go high/low (css) in cypress when playback is in progress, added to manual sheet
|
383
|
+
//Comment : Unable to check waveform css in cypress, added to manual sheet
|
384
|
+
it('CSS of \'Preview\' section if playback is initiated', { tags: 'css' }, () => {
|
385
|
+
audioResponsePage.steps.resetQuestionPreview();
|
386
|
+
audioResponsePage.steps.recordAndSaveAudioStandardPreview(10000);
|
387
|
+
audioResponsePage.previewPlayPlaybackButton()
|
388
|
+
.click()
|
389
|
+
audioResponsePage.previewPausePlaybackButton()
|
390
|
+
.trigger('mouseout');
|
391
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
392
|
+
.verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
|
393
|
+
audioResponsePage.previewVolumeMeter()
|
394
|
+
.find('text')
|
395
|
+
.should('have.css', 'fill', css.color.text);
|
396
|
+
audioResponsePage.standardPreviewRecordTime()
|
397
|
+
.verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
|
398
|
+
audioResponsePage.previewPausePlaybackButton()
|
399
|
+
.find('svg')
|
400
|
+
.should('have.css', 'fill', css.color.activeButtons)
|
401
|
+
audioResponsePage.standardPreviewHelpTextOutsideContainer()
|
402
|
+
.verifyCSS(css.color.text, css.fontSize.normal, css.fontWeight.semibold);
|
403
|
+
//TODO : Change selectors after https://redmine.zeuslearning.com/issues/518498 is marked TL
|
404
|
+
audioResponsePage.previewPlaybackProgressBar()
|
405
|
+
.find('span[class*="MuiSlider-track"]')
|
406
|
+
.should('have.css', 'background-color', css.color.progressBarElapsedFill);
|
407
|
+
audioResponsePage.previewPlaybackProgressBar()
|
408
|
+
.find('span[class*="MuiSlider-rail"]')
|
409
|
+
.should('have.css', 'background-color', css.color.progressBarRemainingFill);
|
410
|
+
});
|
411
|
+
|
412
|
+
it('Accessibility of \'Preview\' section if playback is initiated', { tags: 'a11y' }, () => {
|
413
|
+
cy.checkAccessibility(audioResponsePage.previewTabQuestionWrapper());
|
414
|
+
});
|
415
|
+
|
416
|
+
it('When the user hover over \'Volume control\' icon present in playback overlay, volume control settings should open and by default it should be set to full volume', () => {
|
417
|
+
audioResponsePage.previewVolumeControlButton()
|
418
|
+
.realHover();
|
419
|
+
audioResponsePage.previewVolumeControlSlider()
|
420
|
+
.should('be.visible')
|
421
|
+
.and('have.attr', 'value', '100');
|
422
|
+
cy.get('body')
|
423
|
+
.realHover({ position: 'right' });
|
424
|
+
audioResponsePage.previewVolumeControlSlider()
|
425
|
+
.should('not.exist');
|
426
|
+
});
|
427
|
+
|
428
|
+
it('When volume control settings is not 0 and user hovers on \'Volume control\' icon, then \'Mute\' text should be displayed in a tooltip', () => {
|
429
|
+
audioResponsePage.previewVolumeControlButton()
|
430
|
+
.trigger('mouseover');
|
431
|
+
audioResponsePage.tooltipText()
|
432
|
+
.should('be.visible')
|
433
|
+
.verifyInnerText('Mute');
|
434
|
+
audioResponsePage.previewVolumeControlButton()
|
435
|
+
.trigger('mouseout');
|
436
|
+
audioResponsePage.tooltipText()
|
437
|
+
.should('not.exist');
|
438
|
+
});
|
439
|
+
|
440
|
+
it('When the user hover over \'Volume control slider\',then \'Volume control\' text should be displayed in a tooltip', () => {
|
441
|
+
cy.log('Pre-step: Hovering on volume control icon to make volume control slider visible')
|
442
|
+
audioResponsePage.previewVolumeControlButton()
|
443
|
+
.realHover();
|
444
|
+
audioResponsePage.previewVolumeControlSlider()
|
445
|
+
.trigger('mouseover');
|
446
|
+
cy.get('body')
|
447
|
+
.realHover();
|
448
|
+
audioResponsePage.tooltipText()
|
449
|
+
.should('be.visible')
|
450
|
+
.and('have.text', 'Volume control');
|
451
|
+
audioResponsePage.previewVolumeControlSlider()
|
452
|
+
.trigger('mouseout');
|
453
|
+
audioResponsePage.tooltipText()
|
454
|
+
.should('not.exist');
|
455
|
+
cy.get('body')
|
456
|
+
.realHover({ position: "topRight" });
|
457
|
+
});
|
458
|
+
|
459
|
+
it('When volume control setting is not 0 and user clicks on volume control icon, then the audio should be muted and the icon should change to a muted state', () => {
|
460
|
+
audioResponsePage.previewVolumeControlButton()
|
461
|
+
.realClick();
|
462
|
+
audioResponsePage.previewVolumeControlButton()
|
463
|
+
.trigger('mouseover');
|
464
|
+
audioResponsePage.previewVolumeControlSlider()
|
465
|
+
.should('have.attr', 'value', '0');
|
466
|
+
audioResponsePage.previewVolumeControlButton()
|
467
|
+
.within(() => {
|
468
|
+
audioResponsePage.previewMutedVolumeControlIcon()
|
469
|
+
.should('be.visible');
|
470
|
+
});
|
471
|
+
audioResponsePage.previewVolumeControlButton()
|
472
|
+
.trigger('mouseout');
|
473
|
+
});
|
474
|
+
|
475
|
+
it('When the user hovers on muted \'Volume control\' icon, \'Unmute\' text should be displayed in tooltip', () => {
|
476
|
+
audioResponsePage.previewVolumeControlButton()
|
477
|
+
.trigger('mouseover');
|
478
|
+
audioResponsePage.tooltipText()
|
479
|
+
.should('be.visible')
|
480
|
+
.verifyInnerText('Unmute');
|
481
|
+
audioResponsePage.previewVolumeControlSlider()
|
482
|
+
.should('have.attr', 'value', '0');
|
483
|
+
audioResponsePage.previewVolumeControlButton()
|
484
|
+
.trigger('mouseout');
|
485
|
+
audioResponsePage.tooltipText()
|
486
|
+
.should('not.exist');
|
487
|
+
cy.get('body')
|
488
|
+
.realHover({ position: "topRight" });
|
489
|
+
});
|
490
|
+
|
491
|
+
it('When the user clicks on the muted volume control icon then the volume setting slider should return to full volume and the icon should change to a unmuted state', () => {
|
492
|
+
audioResponsePage.previewVolumeControlButton()
|
493
|
+
.realClick();
|
494
|
+
audioResponsePage.previewVolumeControlSlider()
|
495
|
+
.should('have.attr', 'value', '100');
|
496
|
+
audioResponsePage.previewVolumeControlButton()
|
497
|
+
.within(() => {
|
498
|
+
audioResponsePage.previewUnmutedVolumeControlIcon()
|
499
|
+
.should('be.visible');
|
500
|
+
});
|
501
|
+
});
|
502
|
+
|
503
|
+
it('CSS of volume control section', { tags: 'css' }, () => {
|
504
|
+
audioResponsePage.previewVolumeControlSlider()
|
505
|
+
.should('have.css', 'background', `${css.color.transparent} linear-gradient(to right, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarElapsedFill} 100%, ${css.color.progressBarRemainingFill} 0%, ${css.color.progressBarRemainingFill} 100%) repeat scroll 0% 0% / auto padding-box border-box`);
|
506
|
+
audioResponsePage.previewVolumeControlButton()
|
507
|
+
.find('g path')
|
508
|
+
.should('have.css', 'fill', css.color.activeButtons);
|
509
|
+
});
|
510
|
+
|
511
|
+
it('Accessibility of volume control section', { tags: 'a11y' }, () => {
|
512
|
+
cy.checkAccessibility(audioResponsePage.previewVolumeControlButton());
|
513
|
+
cy.checkAccessibility(audioResponsePage.previewVolumeControlSlider().parents('.audio-volume-slider-wrapper'));
|
514
|
+
});
|
515
|
+
|
516
|
+
it('When the user drags the volume control all the way down, audio should be muted and the icon should update to a muted state', () => {
|
517
|
+
cy.log('Clicking at the bottom of the volume slider');
|
518
|
+
audioResponsePage.previewVolumeControlSlider()
|
519
|
+
.realClick({ position: "bottom" });
|
520
|
+
audioResponsePage.previewVolumeControlSlider()
|
521
|
+
.should('have.attr', 'value', '0');
|
522
|
+
audioResponsePage.previewVolumeControlButton()
|
523
|
+
.within(() => {
|
524
|
+
audioResponsePage.previewMutedVolumeControlIcon()
|
525
|
+
.should('be.visible');
|
526
|
+
});
|
527
|
+
});
|
528
|
+
|
529
|
+
it('CSS of volume control section in muted state', { tags: 'css' }, () => {
|
530
|
+
audioResponsePage.previewVolumeControlSlider()
|
531
|
+
.should('have.css', 'background', `${css.color.transparent} linear-gradient(to right, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarRemainingFill} -100%, ${css.color.progressBarRemainingFill} 100%) repeat scroll 0% 0% / auto padding-box border-box`);
|
532
|
+
audioResponsePage.previewMutedVolumeControlIcon()
|
533
|
+
.find('g g path')
|
534
|
+
.should('have.css', 'fill', css.color.activeButtons);
|
535
|
+
});
|
536
|
+
|
537
|
+
it('Accessibility of volume control section in muted state', { tags: 'a11y' }, () => {
|
538
|
+
cy.checkAccessibility(audioResponsePage.previewVolumeControlButton());
|
539
|
+
cy.checkAccessibility(audioResponsePage.previewVolumeControlSlider().parents('.audio-volume-slider-wrapper'));
|
540
|
+
});
|
541
|
+
|
542
|
+
it('User should be able to unmute the audio by dragging the volume control higher again', () => {
|
543
|
+
cy.log('Clicking at the top of the volume slider');
|
544
|
+
audioResponsePage.previewVolumeControlSlider()
|
545
|
+
.realClick({ position: "top" })
|
546
|
+
.should('have.attr', 'value', '100');
|
547
|
+
audioResponsePage.previewVolumeControlButton()
|
548
|
+
.find('.audio-volume-icon-wr')
|
549
|
+
.should('be.visible');
|
550
|
+
cy.get('body')
|
551
|
+
.realHover({ position: "topRight" });
|
552
|
+
});
|
553
|
+
|
554
|
+
it('The progress bar should have a slider so that user can click/drag to seek the audio. When the user hovers on the waveform, a black cursor should be display on the waveform', () => {
|
555
|
+
audioResponsePage.steps.resetQuestionPreview();
|
556
|
+
audioResponsePage.steps.recordAndSaveAudioStandardPreview(5000);
|
557
|
+
audioResponsePage.previewPlayPlaybackButton()
|
558
|
+
.click();
|
559
|
+
audioResponsePage.steps.waitForPlaybackToBeginStandardPreview();
|
560
|
+
audioResponsePage.previewPlaybackSlider()
|
561
|
+
.should('be.visible');
|
562
|
+
audioResponsePage.previewPlaybackWaveform()
|
563
|
+
.realHover();
|
564
|
+
audioResponsePage.waveformCursor()
|
565
|
+
.should('be.visible');
|
566
|
+
cy.get("body")
|
567
|
+
.realHover({ position: "topLeft" });
|
568
|
+
audioResponsePage.waveformCursor()
|
569
|
+
.should('not.be.visible');
|
570
|
+
});
|
571
|
+
|
572
|
+
it('CSS of waveform and progress bar in hover state', { tags: 'css' }, () => {
|
573
|
+
audioResponsePage.previewPlaybackWaveform()
|
574
|
+
.realHover();
|
575
|
+
audioResponsePage.waveformCursor()
|
576
|
+
.should('have.css', 'background-color', css.color.waveformCursorColor);
|
577
|
+
cy.log('Hovering out from the waveform');
|
578
|
+
cy.get("body")
|
579
|
+
.realHover({ position: "topLeft" });
|
580
|
+
audioResponsePage.previewPlaybackSlider()
|
581
|
+
.realHover()
|
582
|
+
.parents('span[class*="MuiSlider-thumb"]')
|
583
|
+
.should('have.css', 'box-shadow', `${css.color.progressBarSliderHoverBackground} 0px 0px 0px 8px`);
|
584
|
+
cy.log('Hovering out from the playback progress bar slider');
|
585
|
+
cy.get("body")
|
586
|
+
.realHover({ position: "topLeft" });
|
587
|
+
});
|
588
|
+
|
589
|
+
it('When the user seeks the audio playback by clicking on progress bar and waveform, audio response should be played from the seeked position', () => {
|
590
|
+
let actualAudioSeekedInPercent = 49
|
591
|
+
audioResponsePage.steps.resetQuestionPreview();
|
592
|
+
audioResponsePage.steps.recordAndSaveAudioStandardPreview(10000);
|
593
|
+
audioResponsePage.previewPlayPlaybackButton()
|
594
|
+
.click();
|
595
|
+
cy.log('Clicking at the middle of the progress bar to seek till 5 seconds of the recording');
|
596
|
+
audioResponsePage.previewPlaybackProgressBar()
|
597
|
+
.click();
|
598
|
+
audioResponsePage.previewPlaybackSlider()
|
599
|
+
.then(($value) => {
|
600
|
+
const value = $value[0].valueAsNumber
|
601
|
+
expect(value).to.be.gte(actualAudioSeekedInPercent);
|
602
|
+
});
|
603
|
+
audioResponsePage.previewWaveformTotalWidth()
|
604
|
+
.then(($totalWidth) => {
|
605
|
+
const totalWidth = $totalWidth[0].clientWidth
|
606
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
607
|
+
.then(($currWidth) => {
|
608
|
+
const currentWaveFormWidth = $currWidth[0].clientWidth
|
609
|
+
const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
|
610
|
+
expect(currentWaveFormWidthInPercent).to.be.gte(actualAudioSeekedInPercent)
|
611
|
+
});
|
612
|
+
});
|
613
|
+
cy.log('Clicking on the waveform to seek till 25% of the recording');
|
614
|
+
audioResponsePage.previewPlaybackWaveform()
|
615
|
+
.then(($waveformDimensions) => {
|
616
|
+
const x = ($waveformDimensions[0].clientWidth) / 4
|
617
|
+
const y = ($waveformDimensions[0].clientHeight) / 2
|
618
|
+
audioResponsePage.previewPlaybackWaveform()
|
619
|
+
.click(x, y);
|
620
|
+
});
|
621
|
+
cy.log('Checking value of progress bar after seeking on waveform');
|
622
|
+
audioResponsePage.previewPlaybackSlider()
|
623
|
+
.then(($val) => {
|
624
|
+
actualAudioSeekedInPercent = 24
|
625
|
+
const value = $val[0].value
|
626
|
+
expect(Number(value)).to.be.gte(actualAudioSeekedInPercent)
|
627
|
+
});
|
628
|
+
audioResponsePage.previewWaveformTotalWidth()
|
629
|
+
.then(($totalWidth) => {
|
630
|
+
const totalWidth = $totalWidth[0].clientWidth
|
631
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
632
|
+
.then(($currWidth) => {
|
633
|
+
const currentWaveFormWidth = $currWidth[0].clientWidth
|
634
|
+
const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
|
635
|
+
expect(currentWaveFormWidthInPercent).to.be.gte(actualAudioSeekedInPercent)
|
636
|
+
});
|
637
|
+
});
|
638
|
+
});
|
639
|
+
|
640
|
+
//Comment : not checking tooltips for pause buttons as the state of the page keeps changing
|
641
|
+
it('When the user hovers on \'Pause\' button, \'Pause\' text should be displayed in tooltip', () => {
|
642
|
+
audioResponsePage.previewPausePlaybackButton()
|
643
|
+
.verifyTooltip('Pause');
|
644
|
+
});
|
645
|
+
|
646
|
+
it('When the playback player is in playback state and the user clicks on \'Pause\' button, the playback should get paused. Also waveform, progress bar and timer should not update further. Pause icon should get replaced with Play icon', () => {
|
647
|
+
let initialWidthWaveform
|
648
|
+
let initialWidthProgressBar
|
649
|
+
audioResponsePage.steps.resetQuestionPreview();
|
650
|
+
audioResponsePage.steps.recordAndSaveAudioStandardPreview(10000);
|
651
|
+
audioResponsePage.previewPlayPlaybackButton()
|
652
|
+
.click();
|
653
|
+
cy.log('Pausing playback after 3 seconds to fill 30% of the waveform and progress bar');
|
654
|
+
audioResponsePage.steps.waitForPlaybackToBeginStandardPreview();
|
655
|
+
audioResponsePage.steps.addWaitForPlayback(2000);
|
656
|
+
audioResponsePage.previewPausePlaybackButton()
|
657
|
+
.click();
|
658
|
+
//TODO : remove below line after https://redmine.zeuslearning.com/issues/525475 has been marked TL
|
659
|
+
audioResponsePage.previewPlayPlaybackButton()
|
660
|
+
.trigger('mouseout')
|
661
|
+
.should('be.visible');
|
662
|
+
cy.log('Checking the current position of waveform cursor');
|
663
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
664
|
+
.then(($currWidth) => {
|
665
|
+
initialWidthWaveform = $currWidth[0].clientWidth
|
666
|
+
});
|
667
|
+
cy.log('Checking the current position of progress bar slider');
|
668
|
+
audioResponsePage.previewPlaybackSlider()
|
669
|
+
.then(($currWidth) => {
|
670
|
+
initialWidthProgressBar = $currWidth[0].valueAsNumber
|
671
|
+
});
|
672
|
+
cy.wait(4000);
|
673
|
+
cy.log('Checking the position of waveform cursor after 3 seconds');
|
674
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
675
|
+
.then(($finalWidth) => {
|
676
|
+
const finalWidth = $finalWidth[0].clientWidth
|
677
|
+
expect(finalWidth).to.equal(initialWidthWaveform)
|
678
|
+
});
|
679
|
+
cy.log('Checking the position of progress bar slider after 3 seconds');
|
680
|
+
audioResponsePage.previewPlaybackSlider()
|
681
|
+
.then(($finalWidth) => {
|
682
|
+
const finalWidth = $finalWidth[0].valueAsNumber
|
683
|
+
expect(finalWidth).to.equal(initialWidthProgressBar)
|
684
|
+
});
|
685
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
686
|
+
.verifyInnerText('Playback paused');
|
687
|
+
audioResponsePage.standardPreviewRecordTime()
|
688
|
+
.invoke('text')
|
689
|
+
.then(($timer) => {
|
690
|
+
const currentTimer = $timer.split(' / ')[0];
|
691
|
+
const currentSeconds = parseInt(currentTimer.split(':')[1], 10);
|
692
|
+
expect(currentSeconds).to.be.gte(2);
|
693
|
+
});
|
694
|
+
audioResponsePage.previewVolumeMeter()
|
695
|
+
.should('have.text', '0dB');
|
696
|
+
});
|
697
|
+
|
698
|
+
//TODO : Change selectors after https://redmine.zeuslearning.com/issues/518498 is marked TL
|
699
|
+
it('CSS of \'Preview\' section if playback is paused', { tags: 'css' }, () => {
|
700
|
+
audioResponsePage.previewPlaybackProgressBar()
|
701
|
+
.find('span[class*="MuiSlider-track"]')
|
702
|
+
.should('have.css', 'background-color', css.color.progressBarElapsedFill);
|
703
|
+
audioResponsePage.previewPlaybackProgressBar()
|
704
|
+
.find('span[class*="MuiSlider-rail"]')
|
705
|
+
.should('have.css', 'background-color', css.color.progressBarRemainingFill);
|
706
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
707
|
+
.verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
|
708
|
+
});
|
709
|
+
|
710
|
+
it('Accessibility of \'Preview\' section if if playback is paused', { tags: 'a11y' }, () => {
|
711
|
+
cy.checkAccessibility(audioResponsePage.previewTabQuestionWrapper());
|
712
|
+
});
|
713
|
+
|
714
|
+
it('When playback player is in paused state and user clicks on play icon, playback should get resumed and helptext should be updated to \'Playback...\'. Waveform, volume meter, progress bar and timer should again be getting updated. Play icon should get replaced with Pause icon.', () => {
|
715
|
+
let initialWidthWaveform
|
716
|
+
let initialWidthProgressBar
|
717
|
+
audioResponsePage.previewPlayPlaybackButton()
|
718
|
+
.click();
|
719
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
720
|
+
.verifyInnerText('Playback...');
|
721
|
+
audioResponsePage.previewPlaybackWaveform()
|
722
|
+
.should('be.visible');
|
723
|
+
audioResponsePage.previewVolumeMeter()
|
724
|
+
.should('be.visible');
|
725
|
+
audioResponsePage.previewVolumeControlButton()
|
726
|
+
.should('be.visible');
|
727
|
+
audioResponsePage.previewPausePlaybackButton()
|
728
|
+
.should('be.visible');
|
729
|
+
audioResponsePage.standardPreviewRetakeButton()
|
730
|
+
.should('be.visible');
|
731
|
+
audioResponsePage.standardPreviewRecordTime()
|
732
|
+
.should('be.visible');
|
733
|
+
audioResponsePage.standardPreviewRecordTime()
|
734
|
+
.invoke('text')
|
735
|
+
.then(($timer) => {
|
736
|
+
const currentTimer = $timer.split(' / ')[0];
|
737
|
+
const currentSeconds = parseInt(currentTimer.split(':')[1], 10);
|
738
|
+
expect(currentSeconds).to.be.gte(2);
|
739
|
+
});
|
740
|
+
cy.log('Checking the current position of waveform cursor');
|
741
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
742
|
+
.then(($currWidth) => {
|
743
|
+
initialWidthWaveform = $currWidth[0].clientWidth
|
744
|
+
});
|
745
|
+
cy.log('Checking the current position of progress bar slider');
|
746
|
+
audioResponsePage.previewPlaybackSlider()
|
747
|
+
.then(($currWidth) => {
|
748
|
+
initialWidthProgressBar = $currWidth[0].valueAsNumber
|
749
|
+
});
|
750
|
+
cy.log('Waiting a second before checking updated positions')
|
751
|
+
cy.wait(2000);
|
752
|
+
cy.log('Checking the position of waveform cursor after 1 seconds');
|
753
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
754
|
+
.then(($finalWidth) => {
|
755
|
+
const finalWidth = $finalWidth[0].clientWidth
|
756
|
+
expect(finalWidth).to.be.gt(initialWidthWaveform)
|
757
|
+
});
|
758
|
+
cy.log('Checking the position of progress bar slider after 1 seconds');
|
759
|
+
audioResponsePage.previewPlaybackSlider()
|
760
|
+
.then(($finalWidth) => {
|
761
|
+
const finalWidth = $finalWidth[0].valueAsNumber
|
762
|
+
expect(finalWidth).to.be.gt(initialWidthProgressBar)
|
763
|
+
});
|
764
|
+
});
|
765
|
+
});
|
766
|
+
|
767
|
+
describe('Preview tab of Standard recorder style- Retake my audio response', () => {
|
768
|
+
abortEarlySetup();
|
769
|
+
before(() => {
|
770
|
+
cy.log('Navigating to Audio Response question type');
|
771
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
772
|
+
cy.log('Setting Maximum recording length to 5 seconds');
|
773
|
+
audioResponsePage.steps.setMaximumRecorderLength(5);
|
774
|
+
cy.log('Switching to Preview tab');
|
775
|
+
audioResponsePage.steps.switchToPreviewTab();
|
776
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
777
|
+
.click();
|
778
|
+
cy.log('Starting a recording and letting it record until Maximum recording length is reached');
|
779
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
780
|
+
.verifyInnerText('Your response has been recorded');
|
781
|
+
});
|
782
|
+
|
783
|
+
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', () => {
|
784
|
+
audioResponsePage.standardPreviewRetakeButton()
|
785
|
+
.should('be.visible')
|
786
|
+
.and('be.enabled')
|
787
|
+
.click();
|
788
|
+
audioResponsePage.dialogBoxTitle()
|
789
|
+
.verifyInnerText('Retake');
|
790
|
+
audioResponsePage.retakePopupContent()
|
791
|
+
.verifyInnerText('Are you sure you want to overwrite the existing audio recording?');
|
792
|
+
audioResponsePage.confirmRetakeButton()
|
793
|
+
.should('be.visible')
|
794
|
+
.and('be.enabled')
|
795
|
+
.verifyInnerText('Confirm');
|
796
|
+
audioResponsePage.cancelRetakeButton()
|
797
|
+
.should('be.visible')
|
798
|
+
.and('be.enabled')
|
799
|
+
.verifyInnerText('Cancel');
|
800
|
+
});
|
801
|
+
|
802
|
+
it('CSS of \'Retake\' popup', { tags: 'css' }, () => {
|
803
|
+
audioResponsePage.dialogBox()
|
804
|
+
.should('have.css', 'border', `1px solid ${css.color.defaultDropdownBorder}`)
|
805
|
+
.and('have.css', 'background-color', css.color.defaultBackground);
|
806
|
+
audioResponsePage.dialogBoxTitle()
|
807
|
+
.verifyCSS(css.color.questionHeading, css.fontSize.heading, css.fontWeight.semibold);
|
808
|
+
audioResponsePage.dialogBoxContent()
|
809
|
+
.find('.retake-popup-content')
|
810
|
+
.should('have.css', 'border-top', `1px solid ${css.color.secondaryBtnBorder}`)
|
811
|
+
.verifyCSS(css.color.labels, css.fontSize.default, css.fontWeight.regular);
|
812
|
+
audioResponsePage.confirmRetakeButton()
|
813
|
+
.should('have.css', 'background-color', css.color.deleteBtn);
|
814
|
+
audioResponsePage.cancelRetakeButton()
|
815
|
+
.should('have.css', 'background-color', css.color.transparent);
|
816
|
+
});
|
817
|
+
|
818
|
+
it('Accessibility of \'Retake\' popup', { tags: 'a11y' }, () => {
|
819
|
+
cy.checkAccessibility(audioResponsePage.dialogBox());
|
820
|
+
});
|
821
|
+
|
822
|
+
it('When the user clicks on \'Cancel\' button, \'Retake\' popup should close and previous state of playback player should persist', () => {
|
823
|
+
audioResponsePage.cancelRetakeButton()
|
824
|
+
.click();
|
825
|
+
audioResponsePage.dialogBox()
|
826
|
+
.should('not.exist');
|
827
|
+
audioResponsePage.standardPreviewRetakeButton()
|
828
|
+
.should('be.visible');
|
829
|
+
audioResponsePage.previewPlayPlaybackButton()
|
830
|
+
.should('be.visible');
|
831
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
832
|
+
.should('be.visible')
|
833
|
+
.verifyInnerText('Your response has been recorded');
|
834
|
+
audioResponsePage.previewMicIcon()
|
835
|
+
.should('be.visible');
|
836
|
+
audioResponsePage.standardPreviewRecordingCompletedProgressBar()
|
837
|
+
.should('be.visible');
|
838
|
+
audioResponsePage.standardPreviewRecordTime()
|
839
|
+
.should('be.visible')
|
840
|
+
.verifyInnerText('00:05');
|
841
|
+
});
|
842
|
+
|
843
|
+
it('When the user clicks on Confirm button of the retake popup, the previous recording should get deleted and a new recording should begin', () => {
|
844
|
+
audioResponsePage.standardPreviewRetakeButton()
|
845
|
+
.click();
|
846
|
+
audioResponsePage.confirmRetakeButton()
|
847
|
+
.click();
|
848
|
+
audioResponsePage.dialogBox()
|
849
|
+
.should('not.exist');
|
850
|
+
audioResponsePage.standardPreviewRecorderHelpText()
|
851
|
+
.verifyInnerText('Recording...');
|
852
|
+
audioResponsePage.previewMaxRecordTime()
|
853
|
+
.should('be.visible');
|
854
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
855
|
+
.should('not.exist');
|
856
|
+
audioResponsePage.standardPreviewHelpTextOutsideContainer()
|
857
|
+
.should('not.exist');
|
858
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
859
|
+
.verifyInnerText('Your response has been recorded');
|
860
|
+
});
|
861
|
+
});
|
862
|
+
});
|