itemengine-cypress-automation 1.0.115 → 1.0.117

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/{barRecorderStyle.js → barRecorderStyle.smoke.js} +183 -179
  2. package/cypress/e2e/ILC/AudioResponseNew/{compactRecorderStyle.js → compactRecorderStyle.smoke.js} +179 -177
  3. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +2 -1
  4. package/cypress/e2e/ILC/AudioResponseNew/{standardRecorderStyle.js → standardRecorderStyle.smoke.js} +197 -195
  5. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +3 -3
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +5 -5
  7. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +17 -17
  8. package/cypress/e2e/ILC/DrawingResponse/{drawingResponsePreviewTabContents.js → drawingResponsePreviewTabContents.smoke.js} +3 -3
  9. package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -0
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -2
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -2
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -2
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingPenaltyScoring.js +1 -2
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +3 -5
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -2
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsBasic.js +3 -6
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +1 -2
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -2
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsBasic.js +3 -6
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -2
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +1 -2
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -2
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +3 -6
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +1 -2
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabScoringSection.js +276 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +1 -2
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +73 -0
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -1
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/allOrNothingPenaltyScoring.js +1 -1
  33. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/conditionalCheckboxScoring.js +4 -4
  34. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/manuallyAndNonScored.js +2 -2
  35. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  36. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +3 -3
  37. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +1 -1
  38. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  39. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +2 -2
  40. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  41. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +1 -1
  42. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  43. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +1 -1
  44. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +6 -6
  45. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/checkAnswerFunctionalityForAllViews.smoke.js +1 -1
  46. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
  47. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
  48. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
  49. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
  50. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +2 -1
  51. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +1 -1
  52. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  53. package/cypress/pages/audioResponsePage.js +13 -6
  54. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +0 -27
  55. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
  56. package/cypress/pages/components/commonComponents.js +1 -1
  57. package/cypress/pages/components/figOverImageCanvasComponent.js +1 -1
  58. package/cypress/pages/components/playbackControlsBaseComponent.js +3 -1
  59. package/cypress/pages/components/scoringSectionBaseEditTab.js +0 -9
  60. package/cypress/pages/drawingResponsePage.js +2 -2
  61. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +14 -16
  62. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +112 -3
  63. package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -1
  64. package/cypress/pages/readingRulerPage.js +1 -1
  65. package/cypress/pages/shortTextResponsePage.js +8 -8
  66. package/package.json +2 -2
  67. package/scripts/sorry-cypress.mjs +1 -1
  68. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -432
  69. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +0 -134
@@ -3,12 +3,14 @@ import { audioResponsePage } from "../../../pages/audioResponsePage";
3
3
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
4
  import utilities from "../../../support/helpers/utilities";
5
5
  const css = Cypress.env('css');
6
+ const grepTags = Cypress.env('grepTags');
7
+
6
8
  describe('Preview of Audio response for bar audio recorder style', () => {
7
9
  before(() => {
8
10
  cy.loginAs('admin');
9
11
  });
10
12
 
11
- describe('Preview of bar audio recorder style', () => {
13
+ describe('Preview of bar audio recorder style', { tags: 'smoke' }, () => {
12
14
  abortEarlySetup();
13
15
  before(() => {
14
16
  audioResponsePage.steps.navigateToCreateQuestion('audio response');
@@ -241,7 +243,7 @@ describe('Preview of Audio response for bar audio recorder style', () => {
241
243
  });
242
244
  });
243
245
 
244
- describe('Playback player : Default state', () => {
246
+ describe('Playback player : Default state', { tags: 'smoke' }, () => {
245
247
  abortEarlySetup();
246
248
  before(() => {
247
249
  audioResponsePage.steps.navigateToCreateQuestion('audio response');
@@ -305,185 +307,187 @@ describe('Preview of Audio response for bar audio recorder style', () => {
305
307
  });
306
308
  });
307
309
 
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`, () => {
310
+ if (!grepTags || !grepTags.includes('smoke')) {
311
+ describe('Playback player : Play, pause and seek', () => {
312
+ let actualAudioSeekedInPercent = 50
313
+ abortEarlySetup();
314
+ before(() => {
315
+ audioResponsePage.steps.navigateToCreateQuestion('audio response');
316
+ cy.barsPreLoaderWait();
317
+ audioResponsePage.steps.selectAudioRecorderStyle('Bar');
318
+ audioResponsePage.steps.switchToPreviewTab();
319
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(10000);
320
+ });
321
+
322
+ 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', () => {
323
+ audioResponsePage.playbackPlayButton()
324
+ .verifyTooltip('Play');
325
+ });
326
+
327
+ 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.', () => {
328
+ audioResponsePage.steps.startPlayback();
329
+ audioResponsePage.steps.waitForPlaybackToBeginBarPreview();
330
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:03', '00:10');
331
+ });
332
+
333
+ 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', () => {
334
+ audioResponsePage.playbackPauseButton()
335
+ .verifyTooltip('Pause');
336
+ });
337
+
338
+ it('CSS of \'Preview\' section if playback is initiated', { tags: 'css' }, () => {
339
+ utilities.verifyCSS(audioResponsePage.barPreviewPlaybackTime(), {
340
+ 'color': css.color.liText,
341
+ 'font-size': css.fontSize.small,
342
+ 'font-weight': css.fontWeight.bold
343
+ });
344
+ utilities.verifyCSS(audioResponsePage.playbackPauseButton().find('svg rect'), {
345
+ 'fill': css.color.secondaryBtnBg
346
+ });
347
+ utilities.verifyCSS(audioResponsePage.playbackPauseButton().find('svg path'), {
348
+ 'stroke': css.color.secondaryBtnActive
349
+ });
350
+ });
351
+
352
+ it('Accessibility of \'Preview\' section if playback is initiated', { tags: 'a11y' }, () => {
353
+ cy.checkAccessibility(audioResponsePage.barPreviewPlaybackWrapper());
354
+ });
355
+
356
+ 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', () => {
441
357
  audioResponsePage.steps.resetQuestionPreview();
442
- audioResponsePage.steps.recordAndSaveAudioBarPreview(12000);
443
- utilities.hoverOverElement(audioResponsePage.playbackSpeedButton());
444
- audioResponsePage.steps.selectPlaybackSpeed(`${playbackSpeedOptions[index]}x`);
358
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(10000);
445
359
  audioResponsePage.steps.startPlayback();
446
360
  audioResponsePage.steps.waitForPlaybackToBeginBarPreview();
447
- audioResponsePage.steps.addWaitToPlayAudio(4000);
448
- audioResponsePage.steps.pausePlayback();
449
- audioResponsePage.steps.verifyPlaybackElapsedTime(1 + (4 * playbackSpeedOptions[index]), 'Bar');
361
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:05', '00:10');
362
+ audioResponsePage.steps.pauseAndVerifyProgressBarSliderPosition();
363
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:05', '00:10');
364
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
365
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'notExist');
366
+ });
367
+
368
+ it('CSS of \'Preview\' section if playback is paused', { tags: 'css' }, () => {
369
+ utilities.verifyCSS(audioResponsePage.playbackPlayButton().find('svg rect'), {
370
+ 'fill': css.color.secondaryBtnBg
371
+ });
372
+ utilities.verifyCSS(audioResponsePage.playbackPlayButton().find('svg path'), {
373
+ 'stroke': css.color.secondaryBtnActive
374
+ });
375
+ });
376
+
377
+ it('Accessibility of \'Preview\' section if if playback is paused', { tags: 'a11y' }, () => {
378
+ cy.checkAccessibility(audioResponsePage.barPreviewPlaybackWrapper());
379
+ });
380
+
381
+ 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.', () => {
382
+ audioResponsePage.steps.startPlayback();
383
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'visible');
384
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'notExist');
450
385
  });
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
- });
386
+
387
+ 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', () => {
388
+ audioResponsePage.steps.seekProgressBarSliderToCenter();
389
+ audioResponsePage.steps.addWaitToPlayAudio(1000);
390
+ audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
391
+ });
392
+
393
+ 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', () => {
394
+ audioResponsePage.steps.pausePlayback();
395
+ audioResponsePage.steps.seekProgressBarSliderToCenter();
396
+ audioResponsePage.steps.startPlayback();
397
+ audioResponsePage.steps.addWaitToPlayAudio(5000);
398
+ audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
399
+ });
400
+
401
+ it('When the audio playback is completed, the \'Pause\' button should get replaced with \'Play\' button', () => {
402
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:45', '00:45');
403
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
404
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'notExist');
405
+ audioResponsePage.steps.verifyProgressBarSliderPosition(99);
406
+ });
407
+
408
+ it('CSS of progress bar in hover state', { tags: 'css' }, () => {
409
+ audioResponsePage.steps.hoverOnProgressBarSlider();
410
+ utilities.verifyCSS(audioResponsePage.progressBarSlider().parents('span[class*="MuiSlider-thumb"]'), {
411
+ 'box-shadow': `${css.color.progressBarSliderHoverBackground} 0px 0px 0px 8px`
412
+ });
413
+ });
414
+ });
415
+
416
+ describe('Playback player : Volume control', () => {
417
+ abortEarlySetup();
418
+ before(() => {
419
+ audioResponsePage.steps.navigateToCreateQuestion('audio response');
420
+ cy.barsPreLoaderWait();
421
+ audioResponsePage.steps.selectAudioRecorderStyle('Bar');
422
+ audioResponsePage.steps.switchToPreviewTab();
423
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(10000);
424
+ });
425
+
426
+ audioResponsePage.tests.verifyVolumeControlFunctionality();
427
+ });
428
+
429
+ describe('Playback player : Playback speed', () => {
430
+ const playbackSpeedOptions = ['1', '1.25', '1.5', '2'];
431
+ abortEarlySetup();
432
+ before(() => {
433
+ audioResponsePage.steps.navigateToCreateQuestion('audio response');
434
+ cy.barsPreLoaderWait();
435
+ audioResponsePage.steps.selectAudioRecorderStyle('Bar');
436
+ audioResponsePage.steps.switchToPreviewTab();
437
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(10000);
438
+ });
439
+
440
+ audioResponsePage.tests.verifyPlaybackSpeedContents();
441
+
442
+ for (let index = 0; index < playbackSpeedOptions.length; index++) {
443
+ it(`When the user selects playback speed option ${playbackSpeedOptions[index]}x, the audio playback speed should be changed accordingly`, () => {
444
+ audioResponsePage.steps.resetQuestionPreview();
445
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(12000);
446
+ utilities.hoverOverElement(audioResponsePage.playbackSpeedButton());
447
+ audioResponsePage.steps.selectPlaybackSpeed(`${playbackSpeedOptions[index]}x`);
448
+ audioResponsePage.steps.startPlayback();
449
+ audioResponsePage.steps.waitForPlaybackToBeginBarPreview();
450
+ audioResponsePage.steps.addWaitToPlayAudio(4000);
451
+ audioResponsePage.steps.pausePlayback();
452
+ audioResponsePage.steps.verifyPlaybackElapsedTime(1 + (4 * playbackSpeedOptions[index]), 'Bar');
453
+ });
454
+ };
455
+ });
456
+
457
+ describe('Playback player : Retake my audio response', () => {
458
+ abortEarlySetup();
459
+ before(() => {
460
+ audioResponsePage.steps.navigateToCreateQuestion('audio response');
461
+ cy.barsPreLoaderWait();
462
+ audioResponsePage.steps.selectAudioRecorderStyle('Bar');
463
+ audioResponsePage.steps.setMaximumRecorderLength(10);
464
+ audioResponsePage.steps.switchToPreviewTab();
465
+ audioResponsePage.steps.recordAndSaveAudioBarPreview(5000);
466
+ });
467
+
468
+ 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', () => {
469
+ audioResponsePage.steps.retakeRecordingBarPreview();
470
+ utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'Retake');
471
+ audioResponsePage.steps.verifyRetakePopupContents();
472
+ });
473
+
474
+ audioResponsePage.tests.verifyRetakePopupCSSAndA11y();
475
+
476
+ it('When the user clicks on \'Cancel\' button, \'Retake\' popup should close and previous state of playback player should persist', () => {
477
+ audioResponsePage.steps.cancelRetake();
478
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
479
+ utilities.verifyElementVisibilityState(audioResponsePage.barPreviewRetakeButton(), 'visible');
480
+ utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
481
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:00', '00:05');
482
+ });
483
+
484
+ it('When the user clicks on Confirm button of the retake popup, the previous recording should get deleted and a new recording should begin', () => {
485
+ audioResponsePage.steps.retakeRecordingBarPreview();
486
+ audioResponsePage.steps.confirmRetake();
487
+ audioResponsePage.steps.verifyRecordingTimeBarPreview('00:02', '15:00');
488
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
489
+ utilities.verifyInnerText(audioResponsePage.recordingStatusText(), 'Recording...');
490
+ });
491
+ });
492
+ };
489
493
  });