itemengine-cypress-automation 1.0.21 → 1.0.23
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponse/audioResponseAdditionalSettings.js +709 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseAdditionalSettingsBasic.js +151 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseControlsForRecordingResponse.js +308 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseControlsResponsePlayback.js +591 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseEditTabBasicSections.js +349 -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/package.json +1 -1
@@ -0,0 +1,591 @@
|
|
1
|
+
import { audioResponsePage } from '../../../pages/audioResponsePage';
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
|
5
|
+
describe('Create Item page - Audio response: Controls for response playback', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Controls for response playback- Play', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
14
|
+
cy.log('Setting \'Maximum record length\' to 5 seconds, so that I can record for a duration of 5 seconds without using cy.wait(5000)');
|
15
|
+
audioResponsePage.steps.setMaximumRecorderLength('5');
|
16
|
+
cy.log('Expand \'Customize recorder and playback controls (for student player)\' accordion')
|
17
|
+
audioResponsePage.steps.expandCustomizeRecorderAndPlaybackControlsAccordion();
|
18
|
+
});
|
19
|
+
|
20
|
+
it('In standard mode, when the \'Play\' option is selected the play icon button should be enabled in the playback player of preview tab', () => {
|
21
|
+
cy.log('Pre-step: Switching to Preview tab');
|
22
|
+
audioResponsePage.steps.switchToPreviewTab();
|
23
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
24
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
25
|
+
.click();
|
26
|
+
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
27
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
28
|
+
.should('be.visible');
|
29
|
+
audioResponsePage.previewPlayPlaybackButton()
|
30
|
+
.should('be.enabled');
|
31
|
+
});
|
32
|
+
|
33
|
+
it('In standard mode, when the play option is deselected the play icon button should be disabled in the preview tab and player should not able to playback the recording', () => {
|
34
|
+
cy.log('Pre-step : Switching to Edit tab and deselecting Play button');
|
35
|
+
audioResponsePage.steps.switchToEditTab();
|
36
|
+
audioResponsePage.playOptionButton()
|
37
|
+
.click()
|
38
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
39
|
+
cy.log('Switching to Preview tab');
|
40
|
+
audioResponsePage.steps.switchToPreviewTab();
|
41
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
42
|
+
.click();
|
43
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
44
|
+
.verifyInnerText('Your response has been recorded');
|
45
|
+
audioResponsePage.previewPlayPlaybackButton()
|
46
|
+
.should('be.visible')
|
47
|
+
.and('be.disabled');
|
48
|
+
});
|
49
|
+
|
50
|
+
it('In minimal mode, when the play option is selected the playback icon button should be enabled in the preview tab', () => {
|
51
|
+
cy.log('Pre-step: Switching to Edit tab and selecting minimal audio recorder style option from audio recorder style dropdown, and switching back to preview tab');
|
52
|
+
audioResponsePage.steps.switchToEditTab();
|
53
|
+
audioResponsePage.steps.switchToMinimalRecorderStyle();
|
54
|
+
audioResponsePage.playOptionButton()
|
55
|
+
.click()
|
56
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
57
|
+
audioResponsePage.steps.switchToPreviewTab();
|
58
|
+
audioResponsePage.minimalPreviewRecordButton()
|
59
|
+
.click();
|
60
|
+
audioResponsePage.minimalPreviewPlaybackButton()
|
61
|
+
.should('be.enabled');
|
62
|
+
});
|
63
|
+
|
64
|
+
it('In minimal mode, when the play option is deselected the playback button should be disabled in the preview tab and user should not able to playback the recording', () => {
|
65
|
+
cy.log('Pre-step: Switching to Edit tab');
|
66
|
+
audioResponsePage.steps.switchToEditTab();
|
67
|
+
audioResponsePage.playOptionButton()
|
68
|
+
.click()
|
69
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
70
|
+
cy.log('Switching to Preview tab');
|
71
|
+
audioResponsePage.steps.switchToPreviewTab();
|
72
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
73
|
+
audioResponsePage.minimalPreviewRecordButton()
|
74
|
+
.click();
|
75
|
+
audioResponsePage.minimalPreviewRecorderHelpText()
|
76
|
+
.should('have.text', 'Your response has been recorded');
|
77
|
+
audioResponsePage.minimalPreviewPlaybackButton()
|
78
|
+
.should('be.visible')
|
79
|
+
.and('be.disabled');
|
80
|
+
});
|
81
|
+
});
|
82
|
+
|
83
|
+
describe('Controls for response playback- Pause', () => {
|
84
|
+
abortEarlySetup();
|
85
|
+
before(() => {
|
86
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
87
|
+
cy.log('Setting \'Maximum record length\' to 5 seconds, so that I can record for a duration of 5 seconds without using cy.wait(5000)');
|
88
|
+
audioResponsePage.steps.setMaximumRecorderLength('5');
|
89
|
+
cy.log('Expand \'Customize recorder and playback controls (for student player)\' accordion');
|
90
|
+
audioResponsePage.steps.expandCustomizeRecorderAndPlaybackControlsAccordion();
|
91
|
+
});
|
92
|
+
|
93
|
+
it('In standard mode, when the \'Pause\' option is selected the pause icon button should be enabled in the preview tab', () => {
|
94
|
+
cy.log('Pre-step: Switching to Preview tab');
|
95
|
+
audioResponsePage.steps.switchToPreviewTab();
|
96
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
97
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
98
|
+
.click();
|
99
|
+
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
100
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
101
|
+
.should('be.visible');
|
102
|
+
audioResponsePage.previewPlayPlaybackButton()
|
103
|
+
.click();
|
104
|
+
audioResponsePage.previewPausePlaybackButton()
|
105
|
+
.should('be.enabled');
|
106
|
+
});
|
107
|
+
|
108
|
+
it('In standard mode, when the pause option is deselected the pause icon button should be disabled in the preview tab and player should not able to paused recorded response', () => {
|
109
|
+
cy.log('Pre-step: Switching to Edit tab');
|
110
|
+
audioResponsePage.steps.switchToEditTab();
|
111
|
+
audioResponsePage.pauseOptionButton()
|
112
|
+
.click()
|
113
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
114
|
+
cy.log('Switching to Preview tab');
|
115
|
+
audioResponsePage.steps.switchToPreviewTab();
|
116
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
117
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
118
|
+
.click();
|
119
|
+
audioResponsePage.previewPlayPlaybackButton()
|
120
|
+
.click();
|
121
|
+
audioResponsePage.previewPausePlaybackButton()
|
122
|
+
.should('be.visible')
|
123
|
+
.and('be.disabled');
|
124
|
+
});
|
125
|
+
|
126
|
+
it('In minimal mode, when the pause option is selected the pause icon button should be enabled in the preview tab', () => {
|
127
|
+
cy.log('Pre-step: Switching to Edit tab and selecting minimal audio recorder style option from audio recorder style dropdown');
|
128
|
+
audioResponsePage.steps.switchToEditTab();
|
129
|
+
audioResponsePage.steps.switchToMinimalRecorderStyle();
|
130
|
+
audioResponsePage.pauseOptionButton()
|
131
|
+
.click()
|
132
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
133
|
+
cy.log('Switching to Preview tab');
|
134
|
+
audioResponsePage.steps.switchToPreviewTab();
|
135
|
+
audioResponsePage.minimalPreviewRecordButton()
|
136
|
+
.click();
|
137
|
+
audioResponsePage.minimalPreviewRecorderHelpText()
|
138
|
+
.should('have.text', 'Your response has been recorded');
|
139
|
+
audioResponsePage.minimalPreviewPlaybackButton()
|
140
|
+
.click();
|
141
|
+
audioResponsePage.previewPausePlaybackButton()
|
142
|
+
.should('be.enabled');
|
143
|
+
});
|
144
|
+
|
145
|
+
it('In minimal mode, when the pause option is deselected the pause icon button should be disabled in the preview tab and player should not able to paused recorded response', () => {
|
146
|
+
cy.log('Pre-step: Switching to Edit tab');
|
147
|
+
audioResponsePage.steps.switchToEditTab();
|
148
|
+
audioResponsePage.pauseOptionButton()
|
149
|
+
.click()
|
150
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
151
|
+
cy.log('Switching to Preview tab');
|
152
|
+
audioResponsePage.steps.switchToPreviewTab();
|
153
|
+
audioResponsePage.minimalPreviewRecordButton()
|
154
|
+
.click();
|
155
|
+
audioResponsePage.minimalPreviewRecorderHelpText()
|
156
|
+
.should('have.text', 'Your response has been recorded');
|
157
|
+
audioResponsePage.minimalPreviewPlaybackButton()
|
158
|
+
.click();
|
159
|
+
audioResponsePage.previewPausePlaybackButton()
|
160
|
+
.should('be.visible')
|
161
|
+
.and('be.disabled');
|
162
|
+
});
|
163
|
+
});
|
164
|
+
|
165
|
+
describe('Controls for response playback- Seek', () => {
|
166
|
+
abortEarlySetup();
|
167
|
+
before(() => {
|
168
|
+
cy.log('Navigating to Audio Response question type');
|
169
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
170
|
+
cy.log('Expand \'Customize recorder and playback controls (for student player)\' accordion');
|
171
|
+
audioResponsePage.steps.expandCustomizeRecorderAndPlaybackControlsAccordion();
|
172
|
+
cy.log('Setting \'Maximum record length\' to 5 seconds, so that I can record for a duration of 5 seconds without using cy.wait(5000)');
|
173
|
+
audioResponsePage.steps.setMaximumRecorderLength('5');
|
174
|
+
});
|
175
|
+
|
176
|
+
//TODO: Verify outer-circle on hover of Progress bar slider
|
177
|
+
it('In standard mode, when the \'Seek\' option is selected the seek functionality should be enabled in the preview tab user should be able to seek the audio from the progress bar and waveform', () => {
|
178
|
+
let actualAudioSeekedInPercent = 50
|
179
|
+
cy.log('Pre-step : Switching to Preview tab');
|
180
|
+
audioResponsePage.steps.switchToPreviewTab();
|
181
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
182
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
183
|
+
.click();
|
184
|
+
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
185
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
186
|
+
.should('be.visible');
|
187
|
+
audioResponsePage.previewPlayPlaybackButton()
|
188
|
+
.click();
|
189
|
+
audioResponsePage.steps.waitForPlaybackToBeginStandardPreview();
|
190
|
+
audioResponsePage.previewPausePlaybackButton()
|
191
|
+
.click();
|
192
|
+
cy.log('Clicking at the middle of the progress bar to seek till 50% of the recording');
|
193
|
+
audioResponsePage.previewPlaybackProgressBar()
|
194
|
+
.click();
|
195
|
+
audioResponsePage.previewPlaybackSlider()
|
196
|
+
.should('have.attr', 'value', actualAudioSeekedInPercent);
|
197
|
+
audioResponsePage.previewWaveformTotalWidth()
|
198
|
+
.then(($totalWidth) => {
|
199
|
+
const totalWidth = $totalWidth[0].clientWidth
|
200
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
201
|
+
.then(($currWidth) => {
|
202
|
+
const currentWaveFormWidth = $currWidth[0].clientWidth
|
203
|
+
const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
|
204
|
+
expect(currentWaveFormWidthInPercent).to.be.closeTo(actualAudioSeekedInPercent, 1)
|
205
|
+
});
|
206
|
+
});
|
207
|
+
cy.log('Clicking on the waveform to seek till 25% of the recording');
|
208
|
+
audioResponsePage.previewPlaybackWaveform()
|
209
|
+
.then(($waveformDimensions) => {
|
210
|
+
const x = ($waveformDimensions[0].clientWidth) / 4
|
211
|
+
const y = ($waveformDimensions[0].clientHeight) / 2
|
212
|
+
audioResponsePage.previewPlaybackWaveform()
|
213
|
+
.click(x, y);
|
214
|
+
});
|
215
|
+
cy.log('Checking value of progress bar after seeking on waveform');
|
216
|
+
audioResponsePage.previewPlaybackSlider()
|
217
|
+
.then(($val) => {
|
218
|
+
actualAudioSeekedInPercent = 25
|
219
|
+
const value = $val[0].value
|
220
|
+
expect(Number(value)).to.be.closeTo(actualAudioSeekedInPercent, 1)
|
221
|
+
});
|
222
|
+
audioResponsePage.previewWaveformTotalWidth()
|
223
|
+
.then(($totalWidth) => {
|
224
|
+
actualAudioSeekedInPercent = 25
|
225
|
+
const totalWidth = $totalWidth[0].clientWidth
|
226
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
227
|
+
.then(($currWidth) => {
|
228
|
+
const currentWaveFormWidth = $currWidth[0].clientWidth
|
229
|
+
const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
|
230
|
+
expect(currentWaveFormWidthInPercent).to.be.closeTo(actualAudioSeekedInPercent, 1)
|
231
|
+
});
|
232
|
+
});
|
233
|
+
audioResponsePage.previewPlaybackSlider()
|
234
|
+
.should('be.visible');
|
235
|
+
audioResponsePage.previewPlaybackWaveform()
|
236
|
+
.realHover();
|
237
|
+
audioResponsePage.waveformCursor()
|
238
|
+
.should('be.visible');
|
239
|
+
cy.get('body')
|
240
|
+
.realHover({ position: 'topLeft' });
|
241
|
+
audioResponsePage.waveformCursor()
|
242
|
+
.should('not.be.visible');
|
243
|
+
});
|
244
|
+
|
245
|
+
it('In standard mode, when the \'Seek\' option is deselected, the progress bar should not have a slider handle and waveform should not have cursor if user hover on it and user should not be able to seek the audio from the progress bar and waveform', () => {
|
246
|
+
let actualAudioSeekedInPercent = 25
|
247
|
+
cy.log('Pre-step: Switching to Edit tab, deselecting \'Seek\' button, switching back to Preview tab and saving a record response');
|
248
|
+
audioResponsePage.steps.switchToEditTab();
|
249
|
+
audioResponsePage.seekOptionButton()
|
250
|
+
.click()
|
251
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
252
|
+
audioResponsePage.steps.switchToPreviewTab();
|
253
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
254
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
255
|
+
.click();
|
256
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
257
|
+
.verifyInnerText('Your response has been recorded');
|
258
|
+
audioResponsePage.previewPlayPlaybackButton()
|
259
|
+
.click();
|
260
|
+
audioResponsePage.steps.waitForPlaybackToBeginStandardPreview();
|
261
|
+
audioResponsePage.previewPausePlaybackButton()
|
262
|
+
.click();
|
263
|
+
cy.log('Clicking at the middle of the progress bar to seek till 50% of the recording');
|
264
|
+
audioResponsePage.previewPlaybackProgressBar()
|
265
|
+
.click();
|
266
|
+
audioResponsePage.previewPlaybackSlider()
|
267
|
+
.then(($val) => {
|
268
|
+
const value = $val[0].value
|
269
|
+
expect(Number(value)).to.be.closeTo(actualAudioSeekedInPercent, 5)
|
270
|
+
});
|
271
|
+
audioResponsePage.previewWaveformTotalWidth()
|
272
|
+
.then(($totalWidth) => {
|
273
|
+
const totalWidth = $totalWidth[0].clientWidth
|
274
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
275
|
+
.then(($currWidth) => {
|
276
|
+
const currentWaveFormWidth = $currWidth[0].clientWidth
|
277
|
+
const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
|
278
|
+
expect(currentWaveFormWidthInPercent).to.be.closeTo(actualAudioSeekedInPercent, 5)
|
279
|
+
});
|
280
|
+
});
|
281
|
+
cy.log('Clicking on the waveform to seek till 75% of the recording');
|
282
|
+
audioResponsePage.previewPlaybackWaveform()
|
283
|
+
.then(($waveformDimensions) => {
|
284
|
+
const x = $waveformDimensions[0].clientWidth - ($waveformDimensions[0].clientWidth) / 4
|
285
|
+
const y = ($waveformDimensions[0].clientHeight) / 2
|
286
|
+
audioResponsePage.previewPlaybackWaveform()
|
287
|
+
.click(x, y);
|
288
|
+
});
|
289
|
+
cy.log('Checking value of progress bar after seeking on waveform');
|
290
|
+
audioResponsePage.previewPlaybackSlider()
|
291
|
+
.then(($val) => {
|
292
|
+
const value = $val[0].value
|
293
|
+
expect(Number(value)).to.be.closeTo(actualAudioSeekedInPercent, 5)
|
294
|
+
});
|
295
|
+
audioResponsePage.previewWaveformTotalWidth()
|
296
|
+
.then(($totalWidth) => {
|
297
|
+
const totalWidth = $totalWidth[0].clientWidth
|
298
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
299
|
+
.then(($currWidth) => {
|
300
|
+
const currentWaveFormWidth = $currWidth[0].clientWidth
|
301
|
+
const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
|
302
|
+
expect(currentWaveFormWidthInPercent).to.be.closeTo(actualAudioSeekedInPercent, 5)
|
303
|
+
});
|
304
|
+
});
|
305
|
+
audioResponsePage.previewPlaybackSlider()
|
306
|
+
.should('not.be.visible');
|
307
|
+
audioResponsePage.previewPlaybackWaveform()
|
308
|
+
.realHover();
|
309
|
+
audioResponsePage.waveformCursor()
|
310
|
+
.should('not.be.visible');
|
311
|
+
});
|
312
|
+
|
313
|
+
it('In minimal mode, when \'Seek\' option is selected user should be able to seek the audio from the progress bar and waveform', () => {
|
314
|
+
let actualAudioSeekedInPercent = 50
|
315
|
+
cy.log('Pre-step: Switching to Edit tab and selecting minimal audio recorder style option from audio recorder style dropdown and switching back to preview tab and saving a recording response');
|
316
|
+
audioResponsePage.steps.switchToEditTab();
|
317
|
+
audioResponsePage.steps.switchToMinimalRecorderStyle();
|
318
|
+
audioResponsePage.seekOptionButton()
|
319
|
+
.click()
|
320
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
321
|
+
audioResponsePage.steps.switchToPreviewTab();
|
322
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
323
|
+
audioResponsePage.minimalPreviewRecordButton()
|
324
|
+
.click();
|
325
|
+
audioResponsePage.steps.waitForRecordingToStartMinimalPreview();
|
326
|
+
audioResponsePage.minimalPreviewRecorderHelpText()
|
327
|
+
.should('have.text', 'Your response has been recorded');
|
328
|
+
audioResponsePage.minimalPreviewPlaybackButton()
|
329
|
+
.click();
|
330
|
+
audioResponsePage.steps.waitForPlaybackToBeginMinimalPreview();
|
331
|
+
audioResponsePage.previewPausePlaybackButton()
|
332
|
+
.click();
|
333
|
+
cy.log('Clicking at the middle of the progress bar to seek till 50% of the recording');
|
334
|
+
audioResponsePage.previewPlaybackProgressBar()
|
335
|
+
.click();
|
336
|
+
audioResponsePage.previewPlaybackSlider()
|
337
|
+
.should('have.attr', 'value', actualAudioSeekedInPercent);
|
338
|
+
audioResponsePage.previewWaveformTotalWidth()
|
339
|
+
.then(($totalWidth) => {
|
340
|
+
const totalWidth = $totalWidth[0].clientWidth
|
341
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
342
|
+
.then(($currWidth) => {
|
343
|
+
const currentWaveFormWidth = $currWidth[0].clientWidth
|
344
|
+
const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
|
345
|
+
expect(currentWaveFormWidthInPercent).to.be.closeTo(actualAudioSeekedInPercent, 1)
|
346
|
+
});
|
347
|
+
});
|
348
|
+
cy.log('Clicking on the waveform to seek till 25% of the recording');
|
349
|
+
audioResponsePage.previewPlaybackWaveform()
|
350
|
+
.then(($waveformDimensions) => {
|
351
|
+
const x = ($waveformDimensions[0].clientWidth) / 4
|
352
|
+
const y = ($waveformDimensions[0].clientHeight) / 2
|
353
|
+
audioResponsePage.previewPlaybackWaveform()
|
354
|
+
.click(x, y);
|
355
|
+
});
|
356
|
+
cy.log('Checking value of progress bar after seeking on waveform');
|
357
|
+
audioResponsePage.previewPlaybackSlider()
|
358
|
+
.then(($val) => {
|
359
|
+
actualAudioSeekedInPercent = 25
|
360
|
+
const value = $val[0].value
|
361
|
+
expect(Number(value)).to.be.closeTo(actualAudioSeekedInPercent, 1)
|
362
|
+
});
|
363
|
+
audioResponsePage.previewWaveformTotalWidth()
|
364
|
+
.then(($totalWidth) => {
|
365
|
+
actualAudioSeekedInPercent = 25
|
366
|
+
const totalWidth = $totalWidth[0].clientWidth
|
367
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
368
|
+
.then(($currWidth) => {
|
369
|
+
const currentWaveFormWidth = $currWidth[0].clientWidth
|
370
|
+
const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
|
371
|
+
expect(currentWaveFormWidthInPercent).to.be.closeTo(actualAudioSeekedInPercent, 1)
|
372
|
+
});
|
373
|
+
});
|
374
|
+
audioResponsePage.previewPlaybackSlider()
|
375
|
+
.should('be.visible');
|
376
|
+
audioResponsePage.previewPlaybackWaveform()
|
377
|
+
.realHover();
|
378
|
+
audioResponsePage.waveformCursor()
|
379
|
+
.should('be.visible');
|
380
|
+
cy.get('body')
|
381
|
+
.realHover({ position: 'topLeft' });
|
382
|
+
audioResponsePage.waveformCursor()
|
383
|
+
.should('not.be.visible');
|
384
|
+
});
|
385
|
+
|
386
|
+
it('In minimal mode, when \'Seek\' option is deselected, on hover the progress bar should not have a slider handle and waveform should not have cursor if user hover on it and user should not able to change the play pointer position on the progress bar and waveform', () => {
|
387
|
+
let actualAudioSeekedInPercent = 25
|
388
|
+
cy.log('Pre-step : Switching to Edit tab, deselecting \'Seek\' and switching back to Preview tab and saving a recording response');
|
389
|
+
audioResponsePage.steps.switchToEditTab();
|
390
|
+
audioResponsePage.seekOptionButton()
|
391
|
+
.click()
|
392
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
393
|
+
audioResponsePage.steps.switchToPreviewTab();
|
394
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
395
|
+
audioResponsePage.minimalPreviewRecordButton()
|
396
|
+
.click();
|
397
|
+
audioResponsePage.minimalPreviewRecorderHelpText()
|
398
|
+
.should('have.text', 'Your response has been recorded');
|
399
|
+
audioResponsePage.minimalPreviewPlaybackButton()
|
400
|
+
.click();
|
401
|
+
audioResponsePage.steps.waitForPlaybackToBeginMinimalPreview();
|
402
|
+
audioResponsePage.previewPausePlaybackButton()
|
403
|
+
.click();
|
404
|
+
audioResponsePage.previewPlaybackSlider()
|
405
|
+
.should('not.be.visible');
|
406
|
+
cy.log('Clicking at the middle of the progress bar to seek till 50% of the recording');
|
407
|
+
audioResponsePage.previewPlaybackProgressBar()
|
408
|
+
.click();
|
409
|
+
audioResponsePage.previewPlaybackSlider()
|
410
|
+
.then(($val) => {
|
411
|
+
const value = $val[0].value
|
412
|
+
expect(Number(value)).to.be.closeTo(actualAudioSeekedInPercent, 5)
|
413
|
+
});
|
414
|
+
audioResponsePage.previewWaveformTotalWidth()
|
415
|
+
.then(($totalWidth) => {
|
416
|
+
const totalWidth = $totalWidth[0].clientWidth
|
417
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
418
|
+
.then(($currWidth) => {
|
419
|
+
const currentWaveFormWidth = $currWidth[0].clientWidth
|
420
|
+
const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
|
421
|
+
expect(currentWaveFormWidthInPercent).to.be.closeTo(actualAudioSeekedInPercent, 5)
|
422
|
+
});
|
423
|
+
});
|
424
|
+
cy.log('Clicking on the waveform to seek till 75% of the recording');
|
425
|
+
audioResponsePage.previewPlaybackWaveform()
|
426
|
+
.then(($waveformDimensions) => {
|
427
|
+
const x = $waveformDimensions[0].clientWidth - ($waveformDimensions[0].clientWidth) / 4
|
428
|
+
const y = ($waveformDimensions[0].clientHeight) / 2
|
429
|
+
audioResponsePage.previewPlaybackWaveform()
|
430
|
+
.click(x, y);
|
431
|
+
});
|
432
|
+
cy.log('Checking value of progress bar after seeking on waveform');
|
433
|
+
audioResponsePage.previewPlaybackSlider()
|
434
|
+
.then(($val) => {
|
435
|
+
const value = $val[0].value
|
436
|
+
expect(Number(value)).to.be.closeTo(actualAudioSeekedInPercent, 5)
|
437
|
+
});
|
438
|
+
audioResponsePage.previewWaveformTotalWidth()
|
439
|
+
.then(($totalWidth) => {
|
440
|
+
const actualAudioSeekedInPercent = 25
|
441
|
+
const totalWidth = $totalWidth[0].clientWidth
|
442
|
+
audioResponsePage.previewWaveformCurrentPositionWidth()
|
443
|
+
.then(($currWidth) => {
|
444
|
+
const currentWaveFormWidth = $currWidth[0].clientWidth
|
445
|
+
const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
|
446
|
+
expect(currentWaveFormWidthInPercent).to.be.closeTo(actualAudioSeekedInPercent, 5)
|
447
|
+
});
|
448
|
+
});
|
449
|
+
audioResponsePage.previewPlaybackSlider()
|
450
|
+
.should('not.be.visible');
|
451
|
+
audioResponsePage.previewPlaybackWaveform()
|
452
|
+
.realHover();
|
453
|
+
audioResponsePage.waveformCursor()
|
454
|
+
.should('not.be.visible');
|
455
|
+
});
|
456
|
+
});
|
457
|
+
|
458
|
+
describe('Controls for response playback- Volume Control', () => {
|
459
|
+
abortEarlySetup();
|
460
|
+
before(() => {
|
461
|
+
cy.log('Navigating to Audio Response question type');
|
462
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
463
|
+
cy.log('Setting \'Maximum record length\' to 5 seconds, so that I can record for a duration of 5 seconds without using cy.wait(5000)');
|
464
|
+
audioResponsePage.steps.setMaximumRecorderLength('5');
|
465
|
+
audioResponsePage.steps.expandCustomizeRecorderAndPlaybackControlsAccordion();
|
466
|
+
});
|
467
|
+
|
468
|
+
it('In standard mode, when the \'Volume Control\' option is selected the volume control icon button should be enabled in the preview tab', () => {
|
469
|
+
cy.log('Pre-step : Switches to Preview tab and saves a recording');
|
470
|
+
audioResponsePage.steps.switchToPreviewTab();
|
471
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
472
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
473
|
+
.click();
|
474
|
+
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
475
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
476
|
+
.should('be.visible');
|
477
|
+
audioResponsePage.previewPlayPlaybackButton()
|
478
|
+
.click();
|
479
|
+
audioResponsePage.previewVolumeControlButton()
|
480
|
+
.should('be.visible')
|
481
|
+
.and('be.enabled');
|
482
|
+
});
|
483
|
+
|
484
|
+
it('In standard mode, when the volume control option is deselected \'Volume control\' should not be displayed on the playback player', () => {
|
485
|
+
cy.log('Pre-step : User switches to Edit tab, deselects \'Volume control\' button, switches back to Preview tab and saves a recording');
|
486
|
+
audioResponsePage.steps.switchToEditTab();
|
487
|
+
audioResponsePage.volumeControlOptionButton()
|
488
|
+
.click()
|
489
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
490
|
+
cy.log('Switching to Preview tab');
|
491
|
+
audioResponsePage.steps.switchToPreviewTab();
|
492
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
493
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
494
|
+
.click();
|
495
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
496
|
+
.verifyInnerText('Your response has been recorded');
|
497
|
+
audioResponsePage.previewPlayPlaybackButton()
|
498
|
+
.click();
|
499
|
+
audioResponsePage.previewVolumeControlButton()
|
500
|
+
.should('not.exist');
|
501
|
+
});
|
502
|
+
|
503
|
+
it('In minimal mode, when the volume control option is selected the volume control icon button should be enabled in the preview tab', () => {
|
504
|
+
cy.log('Pre-step: Switching to Edit tab and selecting minimal audio recorder style option from audio recorder style dropdown');
|
505
|
+
audioResponsePage.steps.switchToEditTab();
|
506
|
+
audioResponsePage.steps.switchToMinimalRecorderStyle();
|
507
|
+
audioResponsePage.volumeControlOptionButton()
|
508
|
+
.click()
|
509
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
510
|
+
cy.log('Switching to Preview tab');
|
511
|
+
audioResponsePage.steps.switchToPreviewTab();
|
512
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
513
|
+
audioResponsePage.minimalPreviewRecordButton()
|
514
|
+
.click();
|
515
|
+
audioResponsePage.minimalPreviewRecorderHelpText()
|
516
|
+
.should('have.text', 'Your response has been recorded');
|
517
|
+
audioResponsePage.minimalPreviewPlaybackButton()
|
518
|
+
.click();
|
519
|
+
audioResponsePage.previewVolumeControlButton()
|
520
|
+
.should('be.enabled')
|
521
|
+
.and('be.visible');
|
522
|
+
});
|
523
|
+
|
524
|
+
it('In minimal mode, when the volume control option is deselected the volume control button should not be displayed in the preview tab', () => {
|
525
|
+
cy.log('Pre-step : Switching to Edit tab, deselecting \'Volume control\' button and switching back to Preview tab');
|
526
|
+
audioResponsePage.steps.switchToEditTab();
|
527
|
+
audioResponsePage.volumeControlOptionButton()
|
528
|
+
.click()
|
529
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
530
|
+
audioResponsePage.steps.switchToPreviewTab();
|
531
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
532
|
+
audioResponsePage.minimalPreviewRecordButton()
|
533
|
+
.click();
|
534
|
+
audioResponsePage.minimalPreviewRecorderHelpText()
|
535
|
+
.should('have.text', 'Your response has been recorded');
|
536
|
+
audioResponsePage.minimalPreviewPlaybackButton()
|
537
|
+
.click();
|
538
|
+
audioResponsePage.previewVolumeControlButton()
|
539
|
+
.should('not.exist');
|
540
|
+
});
|
541
|
+
});
|
542
|
+
|
543
|
+
describe('Controls for response playback- Playback overlay', () => {
|
544
|
+
abortEarlySetup();
|
545
|
+
before(() => {
|
546
|
+
cy.log('Navigating to Audio Response question type');
|
547
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
548
|
+
cy.log('Setting \'Maximum record length\' to 5 seconds, so that I can record for a duration of 5 seconds without using cy.wait(5000)');
|
549
|
+
audioResponsePage.steps.setMaximumRecorderLength('5');
|
550
|
+
cy.log('Selecing \'Minimal\' Recorder style and switching to Preview tab');
|
551
|
+
audioResponsePage.steps.switchToMinimalRecorderStyle();
|
552
|
+
cy.log('Expand \'Customize recorder and playback controls (for student player)\' accordion');
|
553
|
+
audioResponsePage.steps.expandCustomizeRecorderAndPlaybackControlsAccordion();
|
554
|
+
});
|
555
|
+
|
556
|
+
it('In minimal mode, when the \'Playback overlay\' option is selected the playback overlay should be displayed in the preview tab', () => {
|
557
|
+
cy.log('Pre-step: Switching to Preview tab and saving a recording response');
|
558
|
+
audioResponsePage.steps.switchToPreviewTab();
|
559
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
560
|
+
audioResponsePage.minimalPreviewRecordButton()
|
561
|
+
.click();
|
562
|
+
audioResponsePage.steps.waitForRecordingToStartMinimalPreview();
|
563
|
+
audioResponsePage.minimalPreviewRecorderHelpText()
|
564
|
+
.should('be.visible');
|
565
|
+
audioResponsePage.minimalPreviewPlaybackButton()
|
566
|
+
.click();
|
567
|
+
audioResponsePage.minimalPreviewPlaybackOverlay()
|
568
|
+
.should('be.visible');
|
569
|
+
});
|
570
|
+
|
571
|
+
it('In minimal mode, when the \'Playback overlay\' option is deselected overlay should not be displayed in preview tab. User should be able to stop playback by clicking on stop button', () => {
|
572
|
+
cy.log('Pre-step : Switching to Edit tab and deselecting \'Playback overlay\'');
|
573
|
+
audioResponsePage.steps.switchToEditTab();
|
574
|
+
audioResponsePage.playbackOverlayOptionButton()
|
575
|
+
.click()
|
576
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
577
|
+
audioResponsePage.steps.switchToPreviewTab();
|
578
|
+
cy.log('Pre-step: Switching to Preview tab');
|
579
|
+
audioResponsePage.steps.switchToPreviewTab();
|
580
|
+
cy.log('Clicking on start recording and letting it record until maximum recorder length of 5 seconds is reached');
|
581
|
+
audioResponsePage.minimalPreviewRecordButton()
|
582
|
+
.click();
|
583
|
+
audioResponsePage.minimalPreviewPlaybackButton()
|
584
|
+
.click();
|
585
|
+
audioResponsePage.minimalPreviewPlaybackOverlay()
|
586
|
+
.should('not.exist')
|
587
|
+
audioResponsePage.minimalPreviewStopPlaybackButton()
|
588
|
+
.should('be.enabled')
|
589
|
+
});
|
590
|
+
});
|
591
|
+
});
|