itemengine-cypress-automation 1.0.113 → 1.0.115

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.js +489 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.js +482 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +488 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +92 -0
  5. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +229 -0
  6. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  7. package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +67 -0
  8. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -1
  9. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +11 -11
  10. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +529 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +108 -190
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +83 -155
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +104 -315
  14. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +121 -135
  15. package/cypress/e2e/ILC/EssayResponseMath/createItem.js +17 -0
  16. package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +203 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +121 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +236 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsBasic.js +255 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +237 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +236 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  23. package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +43 -0
  24. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +187 -0
  25. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
  26. package/cypress/e2e/ILC/ShortTextResponseNew/checkAnswerFunctionalityForAllViews.smoke.js +99 -0
  27. package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +97 -0
  28. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +74 -0
  29. package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +83 -0
  30. package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +109 -0
  31. package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +66 -0
  32. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +326 -0
  33. package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +163 -0
  34. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +8 -8
  35. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +3 -3
  36. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +154 -0
  37. package/cypress/pages/audioResponsePage.js +523 -66
  38. package/cypress/pages/components/autoScoredScoringPreviewTab.js +2 -0
  39. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +6 -5
  40. package/cypress/pages/components/equationEditorFlyout.js +11 -0
  41. package/cypress/pages/components/essayResponseCommonComponents.js +290 -19
  42. package/cypress/pages/components/figOverImageCanvasComponent.js +1 -1
  43. package/cypress/pages/components/maximumRecorderLengthComponent.js +32 -15
  44. package/cypress/pages/components/playbackControlsBaseComponent.js +9 -1
  45. package/cypress/pages/components/questionInputFieldComponent.js +0 -7
  46. package/cypress/pages/dragAndDropIntoCategoriesPage.js +3 -3
  47. package/cypress/pages/essayResponseBasicPage.js +1 -26
  48. package/cypress/pages/essayResponsePage.js +21 -284
  49. package/cypress/pages/shortTextResponsePage.js +142 -103
  50. package/cypress/pages/textEntryMathPage.js +58 -7
  51. package/package.json +1 -1
  52. package/scripts/sorry-cypress.mjs +1 -1
@@ -1,5 +1,5 @@
1
1
  import utilities from "../support/helpers/utilities";
2
- import { createQuestionBasePage, questionInstructionsComponent, scoringSectionBaseEditTab, maximumRecorderLengthComponent, commonComponents, playbackControlsBaseComponent } from "./components"
2
+ import { createQuestionBasePage, questionInstructionsComponent, scoringSectionBaseEditTab, maximumRecorderLengthComponent, commonComponents, playbackControlsBaseComponent, autoScoredScoringPreviewTab, studentViewSettingsLabelComponent } from "./components"
3
3
  import { dialogBoxBase } from "./dialogBoxBase";
4
4
  const css = Cypress.env('css');
5
5
 
@@ -10,8 +10,11 @@ const selectors = {
10
10
  ...questionInstructionsComponent,
11
11
  ...maximumRecorderLengthComponent,
12
12
  ...playbackControlsBaseComponent,
13
+ ...studentViewSettingsLabelComponent,
13
14
  recordedResponseHelpText: () => cy.get('[class*="preview-help-text"]'),
14
15
  playbackWaveform: () => cy.get('.audio-wave-form'),
16
+ playbackWaveformTotalWidth: () => cy.get('.audio-wave-form wave wave canvas'),
17
+ playbackWaveformCurrentPositionWidth: () => cy.get('.audio-wave-form wave wave'),
15
18
  //standard style
16
19
  standardPreviewStartRecordingButton: () => cy.get('.standard-audio-recorder-mic [role="button"]'),
17
20
  standardPreviewStopRecordingButton: () => cy.get('.standard-recorder-stop-btn'),
@@ -42,25 +45,68 @@ const selectors = {
42
45
  waveformCursor: () => cy.get('.audio-wave-form-cursor-div'),
43
46
  standardRecorderStyleButton: () => cy.get('[data-ngie-testid="standard-toggle-button"]'),
44
47
  barRecorderStyleButton: () => cy.get('[data-ngie-testid="bar-toggle-button"]'),
45
- minimalRecorderStyleButton: () => cy.get('[data-ngie-testid="minimal-toggle-button"]'),
46
- //minimal style
47
- minimalPreviewRecordButton: () => cy.get('.recorder-buttons-wrapper .record-button'),
48
- minimalPreviewPauseRecordingButton: () => cy.get('.recorder-buttons-wrapper .pause-button'),
49
- minimalPreviewStopRecordingButton: () => cy.get('.recorder-buttons-wrapper .stop-button'),
50
- minimalPreviewResumeRecordingButton: () => cy.get('.recorder-buttons-wrapper .record-button'),
51
- minimalPreviewRetakeButton: () => cy.get('.play-back-btn-wrapper .record-button'),
52
- minimalPreviewPlayPlaybackButton: () => cy.get('.play-back-btn-wrapper .play-back-button'),
53
- minimalPreviewPausePlaybackButton: () => cy.get('.play-back-btn-wrapper .play-back-button'),
54
- minimalPreviewRecordingHelpText: () => cy.get('.minimal-recording-text'),
55
- minimalPreviewRecorderHelpText: () => cy.get('.minimal-record-helper-text-wrapper'),
56
- minimalPreviewRecordingTimer: () => cy.get('.minimal-recording-timer'),
57
- minimalPreviewVolumeMeter: () => cy.get('.audio-volume-meter-wrapper'),
58
- minimalPreviewPlaybackPlayButton: () => cy.get('.play-back-button'),
59
- minimalPreviewPlaybackTime: () => cy.get('.minimal-playback-timer'),
48
+ compactRecorderStyleButton: () => cy.get('[data-ngie-testid="compact-toggle-button"]'),
49
+ //compact style
50
+ compactPreviewRecordButton: () => cy.get('.recorder-buttons-wrapper .record-button'),
51
+ compactPreviewPauseRecordingButton: () => cy.get('.recorder-buttons-wrapper .pause-button'),
52
+ compactPreviewStopRecordingButton: () => cy.get('.recorder-buttons-wrapper .stop-button'),
53
+ compactPreviewResumeRecordingButton: () => cy.get('.recorder-buttons-wrapper .record-button'),
54
+ compactPreviewRetakeButton: () => cy.get('.play-back-btn-wrapper .record-button'),
55
+ compactPreviewPlayPlaybackButton: () => cy.get('.play-back-btn-wrapper .play-back-button'),
56
+ compactPreviewPausePlaybackButton: () => cy.get('.play-back-btn-wrapper .play-back-button'),
57
+ compactPreviewRecordingHelpText: () => cy.get('.minimal-recording-text'),
58
+ compactPreviewRecorderHelpText: () => cy.get('.response-recorded'),
59
+ compactPreviewRecordingTimer: () => cy.get('.minimal-recording-timer'),
60
+ compactPreviewVolumeMeter: () => cy.get('.audio-volume-meter-wrapper'),
61
+ compactPreviewPlaybackPlayButton: () => cy.get('.play-back-button'),
62
+ compactPreviewPlaybackTime: () => cy.get('.minimal-playback-timer'),
60
63
  //Retake dialogue box
61
64
  confirmRetakeButton: () => cy.get('.action-btn-wrapper button').eq(1),
62
65
  cancelRetakeButton: () => cy.get('.action-btn-wrapper button').eq(0),
63
- retakePopupContent: () => cy.get('.retake-popup-content')
66
+ retakePopupContent: () => cy.get('.retake-popup-content'),
67
+ customizePlaybackControlsAccordion: () => cy.get('.customize-accordion .ngie-accordion-summary'),
68
+ controlsForPlaybackLabel: () => cy.get('.response-playback-title').eq(0),
69
+ controlsForPlaybackPlayButton: () => cy.get('[data-ngie-testid="play-toggle-button"]'),
70
+ controlsForPlaybackPlayButtonLabel: () => cy.get('.customize-accordion [class*="CustomizeToolbarSelectionstyles__Label"]').eq(0),
71
+ controlsForPlaybackPauseButton: () => cy.get('[data-ngie-testid="pause-toggle-button"]'),
72
+ controlsForPlaybackPauseButtonLabel: () => cy.get('.customize-accordion [class*="CustomizeToolbarSelectionstyles__Label"]').eq(1),
73
+ controlsForPlaybackSeekButton: () => cy.get('[data-ngie-testid="seek-toggle-button"]'),
74
+ controlsForPlaybackSeekButtonLabel: () => cy.get('.customize-accordion [class*="CustomizeToolbarSelectionstyles__Label"]').eq(2),
75
+ controlsForPlaybackVolumeButton: () => cy.get('[data-ngie-testid="volume-toggle-button"]'),
76
+ controlsForPlaybackVolumeButtonLabel: () => cy.get('.customize-accordion [class*="CustomizeToolbarSelectionstyles__Label"]').eq(3),
77
+ controlsForPlaybackPlaybackSpeedButton: () => cy.get('[data-ngie-testid="playback-speed-toggle-button"]'),
78
+ controlsForPlaybackPlaybackSpeedButtonLabel: () => cy.get('.customize-accordion [class*="CustomizeToolbarSelectionstyles__Label"]').eq(4),
79
+ //Audio indicators
80
+ audioIndicatorsProgressIndicatorButton: () => cy.get('[data-ngie-testid="progress-indicator-toggle-button"]'),
81
+ audioIndicatorsProgressIndicatorButtonLabel: () => cy.get('.audio-indicator .control-footer').eq(0),
82
+ audioIndicatorsAudioWaveButton: () => cy.get('[data-ngie-testid="audio-wave-toggle-button"]'),
83
+ audioIndicatorsAudioWaveButtonLabel: () => cy.get('.audio-indicator .control-footer').eq(1),
84
+ audioIndicatorsTimerButton: () => cy.get('[data-ngie-testid="timer-toggle-button"]'),
85
+ audioIndicatorsTimerButtonLabel: () => cy.get('.audio-indicator .control-footer').eq(2),
86
+ audioIndicatorsVolumeMeterButton: () => cy.get('[data-ngie-testid="volume-meter-toggle-button"]'),
87
+ audioIndicatorsVolumeMeterButtonLabel: () => cy.get('.audio-indicator .control-footer').eq(3),
88
+ audioIndicatorsLabel: () => cy.get('.audio-indicator .response-playback-title'),
89
+ audioRecorderStyleLabel: () => cy.get('.recorder-style-label'),
90
+ stopRecordingIfSilenceIsDetectedLabel: () => cy.get('.stop-recording-length-label'),
91
+ stopRecordingIfSilenceIsDetectedInputField: () => cy.get('.stop-recording-input-wrapper input'),
92
+ stopRecordingIfSilenceIsDetectedSecsToggleButton: () => cy.get('.stop-recording-input-wrapper [data-ngie-testid="secs-toggle-button"]'),
93
+ stopRecordingIfSilenceIsDetectedMinsToggleButton: () => cy.get('.stop-recording-input-wrapper [data-ngie-testid="mins-toggle-button"]'),
94
+ limitNumberOfRetakeCheckboxLabel: () => cy.get('[data-ngie-testid="limit-number-of-retake-checkbox"] .MuiFormControlLabel-label'),
95
+ limitNumberOfRetakeCheckbox: () => cy.get('[data-ngie-testid="limit-number-of-retake-checkbox"] input'),
96
+ //bar recorder style
97
+ //Reminder: post a bug for selectors being the same as standard recorder style
98
+ barPreviewRecordTime: () => cy.get('.standard-record-timer'),
99
+ barPreviewPlaybackTime: () => cy.get('.standard-record-timer-wrapper'),
100
+ barPreviewStartRecordingButton: () => cy.get('.rec-button'),
101
+ barPreviewStopRecordingButton: () => cy.get('.standard-recorder-stop-btn'),
102
+ barPreviewPauseRecordingButton: () => cy.get('.standard-recorder-pause-btn'),
103
+ barPreviewResumeRecordingButton: () => cy.get('.standard-recorder-resume-btn'),
104
+ barPreviewRetakeButton: () => cy.get('.standard-recorder-retake-btn'),
105
+ showStudentsTheRetakeLimitsOnTooltipCheckbox: () => cy.get('[data-ngie-testid="show-students-the-retake-limits-on-tooltip-checkbox"] input'),
106
+ showStudentsTheRetakeLimitsOnTooltipCheckboxLabel: () => cy.get('[data-ngie-testid="show-students-the-retake-limits-on-tooltip-checkbox"] .MuiFormControlLabel-label'),
107
+ retakeLimitLabel: () => cy.get('.retake-limit-label'),
108
+ retakeLimitInputField: () => cy.get('.retake-limit-wrapper input'),
109
+ barPreviewPlaybackWrapper: () => cy.get('.audio-response-wrapper')
64
110
  }
65
111
 
66
112
  const steps = {
@@ -160,7 +206,7 @@ const steps = {
160
206
  .click();
161
207
  },
162
208
 
163
- waitForPlaybackToBegin: () => {
209
+ waitForPlaybackToBeginStandardPreview: () => {
164
210
  audioResponsePage.standardPreviewPlaybackTime()
165
211
  .should('contain', '00:01/')
166
212
  },
@@ -181,21 +227,26 @@ const steps = {
181
227
  /**
182
228
  * Verifies the playback elapsed time displayed on the audio response page.
183
229
  * @param {number} time - The expected elapsed time in seconds.
184
- * @param {("Standard" | "Minimal")} recorderStyle - The style of the recorder ('Standard' or 'Minimal').
230
+ * @param {("Standard" | "Compact")} recorderStyle - The style of the recorder ('Standard' or 'Compact').
185
231
  * @throws {Error} Will throw an error if the provided recorder style is invalid.
186
232
  * @returns {void}
187
233
  */
188
234
  verifyPlaybackElapsedTime: (time, recorderStyle) => {
189
235
  let playbackTimeElement;
190
236
 
191
- if (recorderStyle === 'Standard') {
192
- playbackTimeElement = audioResponsePage.standardPreviewPlaybackTime();
193
- } else if (recorderStyle === 'Minimal') {
194
- playbackTimeElement = audioResponsePage.minimalPreviewPlaybackTime();
195
- } else {
196
- throw new Error('Invalid recorder style');
197
- }
198
-
237
+ switch (recorderStyle) {
238
+ case 'Standard':
239
+ playbackTimeElement = audioResponsePage.standardPreviewPlaybackTime();
240
+ break;
241
+ case 'Bar':
242
+ playbackTimeElement = audioResponsePage.barPreviewPlaybackTime();
243
+ break;
244
+ case 'Compact':
245
+ playbackTimeElement = audioResponsePage.compactPreviewPlaybackTime();
246
+ break;
247
+ default:
248
+ throw new Error('Invalid recorder style');
249
+ };
199
250
  playbackTimeElement
200
251
  .invoke('text')
201
252
  .then(text => {
@@ -203,13 +254,13 @@ const steps = {
203
254
  let currentElapsedTimerMinutes = Number(elapsedTime.split(':')[0]);
204
255
  let currentElapsedTimerSeconds = Number(elapsedTime.split(':')[1]);
205
256
  let currentTotalElapsedTimerSeconds = currentElapsedTimerMinutes * 60 + currentElapsedTimerSeconds;
206
- expect(currentTotalElapsedTimerSeconds).to.equal(time);
257
+ expect(currentTotalElapsedTimerSeconds).to.closeTo(time, 1);
207
258
  });
208
259
  },
209
260
 
210
261
  /**
211
262
  * Selects the audio recorder style based on the provided style.
212
- * @param {('Standard' | 'Bar' | 'Minimal')} recorderStyle - The style of the audio recorder to select.
263
+ * @param {('Standard' | 'Bar' | 'Compact')} recorderStyle - The style of the audio recorder to select.
213
264
  * @throws {Error} Will throw an error if an invalid recorder style is provided.
214
265
  */
215
266
  selectAudioRecorderStyle: (recorderStyle) => {
@@ -224,8 +275,8 @@ const steps = {
224
275
  .click()
225
276
  .should('have.class', 'ngie-toggle-button-selected');
226
277
  break;
227
- case 'Minimal':
228
- audioResponsePage.minimalRecorderStyleButton()
278
+ case 'Compact':
279
+ audioResponsePage.compactRecorderStyleButton()
229
280
  .click()
230
281
  .should('have.class', 'ngie-toggle-button-selected');
231
282
  break;
@@ -234,18 +285,18 @@ const steps = {
234
285
  }
235
286
  },
236
287
 
237
- startRecordingMinimalPreview: () => {
238
- audioResponsePage.minimalPreviewRecordButton()
288
+ startRecordingCompactPreview: () => {
289
+ audioResponsePage.compactPreviewRecordButton()
239
290
  .click();
240
291
  },
241
292
 
242
- stopRecordingMinimalPreview: () => {
243
- audioResponsePage.minimalPreviewStopRecordingButton()
293
+ stopRecordingCompactPreview: () => {
294
+ audioResponsePage.compactPreviewStopRecordingButton()
244
295
  .click();
245
296
  },
246
297
 
247
- waitForRecordingToStartMinimalPreview: () => {
248
- audioResponsePage.minimalPreviewRecordingTimer()
298
+ waitForRecordingToStartCompactPreview: () => {
299
+ audioResponsePage.compactPreviewRecordingTimer()
249
300
  .should('contain', '00:01 /')
250
301
  },
251
302
 
@@ -260,37 +311,37 @@ const steps = {
260
311
  },
261
312
 
262
313
  /**
263
- * Verifies the recorded time displayed in the minimal preview player on the audio response page.
314
+ * Verifies the recorded time displayed in the compact preview player on the audio response page.
264
315
  * @param {string} recordingTime - The current recorded time in the format 'mm:ss'.
265
316
  * @param {string} totalTime - The total duration of the audio in the format 'mm:ss'.
266
317
  * @returns {undefined}
267
318
  */
268
- verifyRecordingTimeMinimalPreview: (recordingTime, totalTime) => {
269
- utilities.verifyTextContent(audioResponsePage.minimalPreviewRecordingTimer(), `${recordingTime} / ${totalTime}`)
319
+ verifyRecordingTimeCompactPreview: (recordingTime, totalTime) => {
320
+ utilities.verifyTextContent(audioResponsePage.compactPreviewRecordingTimer(), `${recordingTime} / ${totalTime}`)
270
321
  },
271
322
 
272
323
  /**
273
- * Verifies the playback time displayed in the minimal preview player on the audio response page.
324
+ * Verifies the playback time displayed in the compact preview player on the audio response page.
274
325
  * @param {string} playbackTime - The current playback time in the format 'mm:ss'.
275
326
  * @param {string} totalTime - The total duration of the audio in the format 'mm:ss'.
276
327
  * @returns {undefined}
277
328
  */
278
- verifyPlaybackTimeMinimalPreview: (playbackTime, totalTime) => {
279
- utilities.verifyTextContent(audioResponsePage.minimalPreviewPlaybackTime(), `${playbackTime}/${totalTime}`);
329
+ verifyPlaybackTimeCompactPreview: (playbackTime, totalTime) => {
330
+ utilities.verifyTextContent(audioResponsePage.compactPreviewPlaybackTime(), `${playbackTime}/${totalTime}`);
280
331
  },
281
332
 
282
- pauseRecordingMinimalPreview: () => {
283
- audioResponsePage.minimalPreviewPauseRecordingButton()
333
+ pauseRecordingCompactPreview: () => {
334
+ audioResponsePage.compactPreviewPauseRecordingButton()
284
335
  .click();
285
336
  },
286
337
 
287
- resumeRecordingMinimalPreview: () => {
288
- audioResponsePage.minimalPreviewResumeRecordingButton()
338
+ resumeRecordingCompactPreview: () => {
339
+ audioResponsePage.compactPreviewResumeRecordingButton()
289
340
  .click();
290
341
  },
291
342
 
292
- verifyRecordingLengthAfterResumingMinimalPreview: () => {
293
- audioResponsePage.minimalPreviewRecordingTimer()
343
+ verifyRecordingLengthAfterResumingCompactPreview: () => {
344
+ audioResponsePage.compactPreviewRecordingTimer()
294
345
  .invoke('text')
295
346
  .then(($timer) => {
296
347
  const currentTimer = $timer.split(' / ')[0];
@@ -299,8 +350,8 @@ const steps = {
299
350
  });
300
351
  },
301
352
 
302
- stopRecordingMinimalPreview: () => {
303
- audioResponsePage.minimalPreviewStopRecordingButton()
353
+ stopRecordingCompactPreview: () => {
354
+ audioResponsePage.compactPreviewStopRecordingButton()
304
355
  .click();
305
356
  },
306
357
 
@@ -310,15 +361,15 @@ const steps = {
310
361
  },
311
362
 
312
363
  /**
313
- * Records and saves audio during the minimal preview recording process.
364
+ * Records and saves audio during the compact preview recording process.
314
365
  * @param {number} time - The duration (in milliseconds) to record audio before saving.
315
366
  * @throws {Error} Throws an error if there is an issue during the recording and saving process.
316
367
  */
317
- recordAndSaveAudioMinimalPreview: (time) => {
318
- audioResponsePage.steps.startRecordingMinimalPreview();
319
- audioResponsePage.steps.waitForRecordingToStartMinimalPreview();
368
+ recordAndSaveAudioCompactPreview: (time) => {
369
+ audioResponsePage.steps.startRecordingCompactPreview();
370
+ audioResponsePage.steps.waitForRecordingToStartCompactPreview();
320
371
  audioResponsePage.steps.addWaitToRecordAudio(time - 1000);
321
- audioResponsePage.steps.stopRecordingMinimalPreview();
372
+ audioResponsePage.steps.stopRecordingCompactPreview();
322
373
  },
323
374
 
324
375
  cancelRetake: () => {
@@ -331,18 +382,18 @@ const steps = {
331
382
  .click();
332
383
  },
333
384
 
334
- startPlaybackMinimalPreview: () => {
335
- audioResponsePage.minimalPreviewPlayPlaybackButton()
385
+ startPlaybackCompactPreview: () => {
386
+ audioResponsePage.compactPreviewPlayPlaybackButton()
336
387
  .click();
337
388
  },
338
389
 
339
- waitForPlaybackToBeginMinimalPreview: () => {
340
- audioResponsePage.minimalPreviewPlaybackTime()
390
+ waitForPlaybackToBeginCompactPreview: () => {
391
+ audioResponsePage.compactPreviewPlaybackTime()
341
392
  .should('contain', '00:01/')
342
393
  },
343
394
 
344
- pausePlaybackMinimalPreview: () => {
345
- audioResponsePage.minimalPreviewPausePlaybackButton()
395
+ pausePlaybackCompactPreview: () => {
396
+ audioResponsePage.compactPreviewPausePlaybackButton()
346
397
  .click();
347
398
  },
348
399
 
@@ -354,18 +405,18 @@ const steps = {
354
405
  utilities.verifyElementVisibilityState(audioResponsePage.cancelRetakeButton(), 'visible');
355
406
  },
356
407
 
357
- retakeRecordingMinimalPreview: () => {
358
- audioResponsePage.minimalPreviewRetakeButton()
408
+ retakeRecordingCompactPreview: () => {
409
+ audioResponsePage.compactPreviewRetakeButton()
359
410
  .click();
360
411
  },
361
412
 
362
- pauseAndVerifyProgressBarSliderPositionMinimalPreview: () => {
413
+ pauseAndVerifyProgressBarSliderPositionCompactPreview: () => {
363
414
  let initialWidthProgressBar
364
415
  playbackControlsBaseComponent.progressBarSlider()
365
416
  .then(($currWidth) => {
366
417
  initialWidthProgressBar = $currWidth[0].valueAsNumber
367
418
  });
368
- audioResponsePage.steps.pausePlaybackMinimalPreview();
419
+ audioResponsePage.steps.pausePlaybackCompactPreview();
369
420
  playbackControlsBaseComponent.progressBarSlider()
370
421
  .then(($finalWidth) => {
371
422
  cy.log('The assertion is verifying the value synchronously i.e in real time')
@@ -373,6 +424,410 @@ const steps = {
373
424
  expect(finalWidth).to.closeTo(initialWidthProgressBar, 5)
374
425
  });
375
426
  },
427
+
428
+ verifyCustomizePlaybackControlsAccordionCollapsedState: () => {
429
+ audioResponsePage.customizePlaybackControlsAccordion()
430
+ .should('have.attr', 'aria-expanded', 'false');
431
+ },
432
+
433
+ expandCustomizePlaybackControlsAccordion: () => {
434
+ audioResponsePage.customizePlaybackControlsAccordion()
435
+ .click()
436
+ .should('have.attr', 'aria-expanded', 'true');
437
+ },
438
+
439
+ collapseCustomizePlaybackControlsAccordion: () => {
440
+ audioResponsePage.customizePlaybackControlsAccordion()
441
+ .click()
442
+ .should('have.attr', 'aria-expanded', 'false');
443
+ },
444
+
445
+ verifyControlsForPlaybackPlayButtonSelectedState: () => {
446
+ audioResponsePage.controlsForPlaybackPlayButton()
447
+ .within(() => {
448
+ utilities.verifyElementVisibilityState(commonComponents.tickIconForOptionButtons(), 'visible');
449
+ });
450
+ },
451
+
452
+ verifyControlsForPlaybackPauseButtonSelectedState: () => {
453
+ audioResponsePage.controlsForPlaybackPauseButton()
454
+ .within(() => {
455
+ utilities.verifyElementVisibilityState(commonComponents.tickIconForOptionButtons(), 'visible');
456
+ });
457
+ },
458
+
459
+ verifyControlsForPlaybackSeekButtonSelectedState: () => {
460
+ audioResponsePage.controlsForPlaybackSeekButton()
461
+ .within(() => {
462
+ utilities.verifyElementVisibilityState(commonComponents.tickIconForOptionButtons(), 'visible');
463
+ });
464
+ },
465
+
466
+ verifyControlsForPlaybackVolumeButtonSelectedState: () => {
467
+ audioResponsePage.controlsForPlaybackVolumeButton()
468
+ .within(() => {
469
+ utilities.verifyElementVisibilityState(commonComponents.tickIconForOptionButtons(), 'visible');
470
+ });
471
+ },
472
+
473
+ verifyControlsForPlaybackPlaybackSpeedButtonSelectedState: () => {
474
+ audioResponsePage.controlsForPlaybackPlaybackSpeedButton()
475
+ .within(() => {
476
+ utilities.verifyElementVisibilityState(commonComponents.tickIconForOptionButtons(), 'visible');
477
+ });
478
+ },
479
+
480
+ deselectControlsForPlaybackPlayButton: () => {
481
+ audioResponsePage.controlsForPlaybackPlayButton()
482
+ .click()
483
+ .should('have.class', 'ngie-toggle-button-not-selected')
484
+ },
485
+
486
+ selectControlsForPlaybackPlayButton: () => {
487
+ audioResponsePage.controlsForPlaybackPlayButton()
488
+ .click()
489
+ .should('have.class', 'ngie-toggle-button-selected')
490
+ },
491
+
492
+ deselectControlsForPlaybackPauseButton: () => {
493
+ audioResponsePage.controlsForPlaybackPauseButton()
494
+ .click()
495
+ .should('have.class', 'ngie-toggle-button-not-selected')
496
+ },
497
+
498
+ deselectControlsForPlaybackSeekButton: () => {
499
+ audioResponsePage.controlsForPlaybackSeekButton()
500
+ .click()
501
+ .should('have.class', 'ngie-toggle-button-not-selected')
502
+ },
503
+
504
+ selectControlsForPlaybackSeekButton: () => {
505
+ audioResponsePage.controlsForPlaybackSeekButton()
506
+ .click()
507
+ .should('have.class', 'ngie-toggle-button-selected')
508
+ },
509
+
510
+ selectControlsForPlaybackPauseButton: () => {
511
+ audioResponsePage.controlsForPlaybackPauseButton()
512
+ .click()
513
+ .should('have.class', 'ngie-toggle-button-selected')
514
+ },
515
+
516
+ verifyPausePlaybackButtonEnabledState: () => {
517
+ utilities.verifyElementNotDisabled(audioResponsePage.previewPausePlaybackButton())
518
+ },
519
+
520
+ verifyPausePlaybackButtonEnabledStateCompactPreview: () => {
521
+ utilities.verifyElementNotDisabled(audioResponsePage.compactPreviewPausePlaybackButton())
522
+ },
523
+
524
+ selectControlsForPlaybackVolumeButton: () => {
525
+ audioResponsePage.controlsForPlaybackVolumeButton()
526
+ .click()
527
+ .should('have.class', 'ngie-toggle-button-selected')
528
+ },
529
+
530
+ deselectControlsForPlaybackVolumeButton: () => {
531
+ audioResponsePage.controlsForPlaybackVolumeButton()
532
+ .click()
533
+ .should('have.class', 'ngie-toggle-button-not-selected')
534
+ },
535
+
536
+ deselectControlsForPlaybackPlaybackSpeedButton: () => {
537
+ audioResponsePage.controlsForPlaybackPlaybackSpeedButton()
538
+ .click()
539
+ .should('have.class', 'ngie-toggle-button-not-selected')
540
+ },
541
+
542
+ selectControlsForPlaybackPlaybackSpeedButton: () => {
543
+ audioResponsePage.controlsForPlaybackPlaybackSpeedButton()
544
+ .click()
545
+ .should('have.class', 'ngie-toggle-button-selected')
546
+ },
547
+
548
+ verifyAudioIndicatorsProgressIndicatorButtonDeselectedState: () => {
549
+ audioResponsePage.audioIndicatorsProgressIndicatorButton()
550
+ .should('have.class', 'ngie-toggle-button-not-selected');
551
+ },
552
+
553
+ verifyAudioIndicatorsAudioWaveformButtonDeselectedState: () => {
554
+ audioResponsePage.audioIndicatorsAudioWaveButton()
555
+ .should('have.class', 'ngie-toggle-button-not-selected');
556
+ },
557
+
558
+ selectAudioIndicatorsProgressIndicatorButton: () => {
559
+ audioResponsePage.audioIndicatorsProgressIndicatorButton()
560
+ .click()
561
+ .should('have.class', 'ngie-toggle-button-selected');
562
+ },
563
+
564
+ verifyAudioWaveformProgressPosition: (actualAudioSeekedInPercent) => {
565
+ audioResponsePage.playbackWaveform()
566
+ .then(($totalWidth) => {
567
+ const totalWidth = $totalWidth[0].clientWidth
568
+ audioResponsePage.playbackWaveformCurrentPositionWidth()
569
+ .then(($currWidth) => {
570
+ const currentWaveFormWidth = $currWidth[0].clientWidth
571
+ const currentWaveFormWidthInPercent = (currentWaveFormWidth / totalWidth) * 100
572
+ expect(currentWaveFormWidthInPercent).to.be.closeTo(actualAudioSeekedInPercent, 5)
573
+ });
574
+ });
575
+
576
+ },
577
+
578
+ seekPlaybackWaveformTo75Percent: () => {
579
+ audioResponsePage.playbackWaveform()
580
+ .then(($waveformDimensions) => {
581
+ const x = $waveformDimensions[0].clientWidth - ($waveformDimensions[0].clientWidth) / 4
582
+ const y = ($waveformDimensions[0].clientHeight) / 2
583
+ audioResponsePage.playbackWaveform()
584
+ .click(x, y);
585
+ });
586
+ },
587
+
588
+ verifyStandardRecorderStyleToggleButtonSelectedState: () => {
589
+ audioResponsePage.standardRecorderStyleButton()
590
+ .should('have.class', 'ngie-toggle-button-selected');
591
+ },
592
+
593
+ verifyAudioIndicatorsTimeButtonSelectedState: () => {
594
+ audioResponsePage.audioIndicatorsTimerButton()
595
+ .should('have.class', 'ngie-toggle-button-selected');
596
+ },
597
+
598
+ verifyAudioIndicatorsProgressIndicatorButtonSelectedState: () => {
599
+ audioResponsePage.audioIndicatorsProgressIndicatorButton()
600
+ .should('have.class', 'ngie-toggle-button-selected');
601
+ },
602
+
603
+ verifyAudioIndicatorsAudioWaveButtonSelectedState: () => {
604
+ audioResponsePage.audioIndicatorsAudioWaveButton()
605
+ .should('have.class', 'ngie-toggle-button-selected');
606
+ },
607
+
608
+ verifyAudioIndicatorsVolumeMeterButtonSelectedState: () => {
609
+ audioResponsePage.audioIndicatorsVolumeMeterButton()
610
+ .should('have.class', 'ngie-toggle-button-selected');
611
+ },
612
+
613
+ verifyAudioIndicatorsAudioWaveButtonSelectedState: () => {
614
+ audioResponsePage.audioIndicatorsAudioWaveButton()
615
+ .should('have.class', 'ngie-toggle-button-selected');
616
+ },
617
+
618
+ /**
619
+ * Verifies the value of the input field for stopping recording if silence is detected.
620
+ * @param {string} value - The expected value of the input field.
621
+ */
622
+ verifyStopRecordingIfSilenceIsDetectedInputFieldValue: (value) => {
623
+ audioResponsePage.stopRecordingIfSilenceIsDetectedInputField()
624
+ .should('have.attr', 'value', value)
625
+ },
626
+
627
+ verifyStopRecordingIfSilenceIsDetectedSecsToggleButtonSelectedState: () => {
628
+ audioResponsePage.stopRecordingIfSilenceIsDetectedSecsToggleButton()
629
+ .should('have.class', 'ngie-toggle-button-selected');
630
+ },
631
+
632
+ /**
633
+ * Sets the duration after which recording should stop if silence is detected.
634
+ * @param {string} value - The duration after which recording should stop if silence is detected.
635
+ */
636
+ setStopRecordingIfSilenceIsDetectedAfter: (value) => {
637
+ audioResponsePage.stopRecordingIfSilenceIsDetectedInputField()
638
+ .type(value)
639
+ },
640
+
641
+ focusInStopRecordingIfSilenceIsDetectedInputField: () => {
642
+ audioResponsePage.stopRecordingIfSilenceIsDetectedInputField()
643
+ .clear()
644
+ .blur();
645
+ },
646
+
647
+ limitNumberOfRetakeCheckboxUncheckedState: () => {
648
+ audioResponsePage.limitNumberOfRetakeCheckbox()
649
+ .should('not.be.checked');
650
+ },
651
+
652
+ deselectAudioIndicatorsTimerButton: () => {
653
+ audioResponsePage.audioIndicatorsTimerButton()
654
+ .click()
655
+ .should('have.class', 'ngie-toggle-button-not-selected');
656
+ audioResponsePage.audioIndicatorsTimerButton()
657
+ .within(() => {
658
+ utilities.verifyElementVisibilityState(commonComponents.tickIconForOptionButtons(), 'hidden');
659
+ });
660
+ },
661
+
662
+ startRecordingBarPreview: () => {
663
+ audioResponsePage.barPreviewStartRecordingButton()
664
+ .click();
665
+ },
666
+
667
+ waitForRecordingToStartBarPreview: () => {
668
+ audioResponsePage.barPreviewRecordTime()
669
+ .should('contain', '00:01 /')
670
+ },
671
+
672
+ stopRecordingBarPreview: () => {
673
+ audioResponsePage.barPreviewStopRecordingButton()
674
+ .click();
675
+ },
676
+
677
+ selectAudioIndicatorsTimerButton: () => {
678
+ audioResponsePage.audioIndicatorsTimerButton()
679
+ .click()
680
+ .should('have.class', 'ngie-toggle-button-selected');
681
+ },
682
+
683
+ deselectAudioIndicatorsPlaybackIndicatorButton: () => {
684
+ audioResponsePage.audioIndicatorsProgressIndicatorButton()
685
+ .click()
686
+ .should('have.class', 'ngie-toggle-button-not-selected');
687
+ audioResponsePage.audioIndicatorsProgressIndicatorButton()
688
+ .within(() => {
689
+ utilities.verifyElementVisibilityState(commonComponents.tickIconForOptionButtons(), 'hidden');
690
+ });
691
+ },
692
+
693
+ deselectAudioIndicatorsAudioWaveButton: () => {
694
+ audioResponsePage.audioIndicatorsAudioWaveButton()
695
+ .click()
696
+ .should('have.class', 'ngie-toggle-button-not-selected');
697
+ audioResponsePage.audioIndicatorsAudioWaveButton()
698
+ .within(() => {
699
+ utilities.verifyElementVisibilityState(commonComponents.tickIconForOptionButtons(), 'hidden');
700
+ });
701
+ },
702
+
703
+ deselectAudioIndicatorsVolumeMeterButton: () => {
704
+ audioResponsePage.audioIndicatorsVolumeMeterButton()
705
+ .click()
706
+ .should('have.class', 'ngie-toggle-button-not-selected');
707
+ audioResponsePage.audioIndicatorsVolumeMeterButton()
708
+ .within(() => {
709
+ utilities.verifyElementVisibilityState(commonComponents.tickIconForOptionButtons(), 'hidden');
710
+ });
711
+ },
712
+
713
+ selectAudioIndicatorsVolumeMeterButton: () => {
714
+ audioResponsePage.audioIndicatorsVolumeMeterButton()
715
+ .click()
716
+ .should('have.class', 'ngie-toggle-button-selected');
717
+ },
718
+
719
+ verifyShowStudentsTheRetakeLimitsOnTooltipCheckboxUncheckedState: () => {
720
+ audioResponsePage.showStudentsTheRetakeLimitsOnTooltipCheckbox()
721
+ .should('not.be.checked');
722
+ },
723
+
724
+ checkLimitNumberOfRetakeCheckbox: () => {
725
+ audioResponsePage.limitNumberOfRetakeCheckbox()
726
+ .click()
727
+ .should('be.checked');
728
+ },
729
+
730
+ /**
731
+ * Verifies the value of the retake limit input field.
732
+ * @param {string} value - The expected value of the retake limit input field.
733
+ */
734
+ verifyRetakeLimitInputFieldValue: (value) => {
735
+ audioResponsePage.retakeLimitInputField()
736
+ .should('have.attr', 'value', value)
737
+ },
738
+
739
+ /**
740
+ * Sets the retake limit value.
741
+ * @param {string} value - The value to set as the retake limit.
742
+ */
743
+ setRetakeLimit: (value) => {
744
+ audioResponsePage.retakeLimitInputField()
745
+ .clear()
746
+ .type(value)
747
+ .should('have.attr', 'value', value)
748
+ },
749
+
750
+ /**
751
+ * Verifies the recorded time displayed in the bar preview player on the audio response page.
752
+ * @param {string} recordingTime - The current recorded time in the format 'mm:ss'.
753
+ * @param {string} totalTime - The total duration of the audio in the format 'mm:ss'.
754
+ */
755
+ verifyRecordingTimeBarPreview: (recordingTime, totalTime) => {
756
+ utilities.verifyTextContent(audioResponsePage.barPreviewRecordTime(), `${recordingTime} / ${totalTime}`)
757
+ },
758
+
759
+ pauseRecordingBarPreview: () => {
760
+ audioResponsePage.barPreviewPauseRecordingButton()
761
+ .click();
762
+ },
763
+
764
+ resumeRecordingBarPreview: () => {
765
+ audioResponsePage.barPreviewResumeRecordingButton()
766
+ .click();
767
+ },
768
+
769
+ /**
770
+ * Verifies the playback time displayed in the bar preview player on the audio response page.
771
+ * @param {string} playbackTime - The current playback time in the format 'mm:ss'.
772
+ * @param {string} totalTime - The total duration of the audio in the format 'mm:ss'.
773
+ * @returns {undefined}
774
+ */
775
+ verifyPlaybackTimeBarPreview: (playbackTime, totalTime) => {
776
+ utilities.verifyTextContent(audioResponsePage.barPreviewPlaybackTime(), `${playbackTime}/${totalTime}`);
777
+ },
778
+
779
+ /**
780
+ * Records and saves audio during the bar preview recording process.
781
+ * @param {number} time - The duration (in milliseconds) to record audio before saving.
782
+ * @throws {Error} Throws an error if there is an issue during the recording and saving process.
783
+ */
784
+ recordAndSaveAudioBarPreview: (time) => {
785
+ audioResponsePage.steps.startRecordingBarPreview();
786
+ audioResponsePage.steps.waitForRecordingToStartBarPreview();
787
+ audioResponsePage.steps.addWaitToRecordAudio(time - 1000);
788
+ audioResponsePage.steps.stopRecordingBarPreview();
789
+ },
790
+
791
+ waitForPlaybackToBeginBarPreview: () => {
792
+ audioResponsePage.barPreviewPlaybackTime()
793
+ .should('contain', '00:01/')
794
+ },
795
+
796
+ verifyRecordingLengthAfterResumingBarPreview: () => {
797
+ audioResponsePage.barPreviewRecordTime()
798
+ .invoke('text')
799
+ .then(($timer) => {
800
+ const currentTimer = $timer.split(' / ')[0];
801
+ const currentSeconds = parseInt(currentTimer.split(':')[1], 10);
802
+ expect(currentSeconds).to.be.gte(3);
803
+ });
804
+ },
805
+
806
+ retakeRecordingBarPreview: () => {
807
+ audioResponsePage.barPreviewRetakeButton()
808
+ .click();
809
+ },
810
+
811
+ verifyResponseIsRecordedHelpText: () => {
812
+ utilities.verifyInnerText(audioResponsePage.recordedResponseHelpText(), 'Your response has been recorded.');
813
+ },
814
+
815
+ checkShowStudentsTheRetakeLimitsOnTooltipCheckbox: () => {
816
+ audioResponsePage.showStudentsTheRetakeLimitsOnTooltipCheckbox()
817
+ .click()
818
+ .should('be.checked');
819
+ },
820
+
821
+ uncheckShowStudentsTheRetakeLimitsOnTooltipCheckbox: () => {
822
+ audioResponsePage.showStudentsTheRetakeLimitsOnTooltipCheckbox()
823
+ .click()
824
+ .should('not.be.checked');
825
+ },
826
+
827
+ clearRetakeLimitInputField: () => {
828
+ audioResponsePage.retakeLimitInputField()
829
+ .clear();
830
+ }
376
831
  }
377
832
 
378
833
  const tests = {
@@ -381,6 +836,8 @@ const tests = {
381
836
  ...scoringSectionBaseEditTab.tests,
382
837
  ...maximumRecorderLengthComponent.tests,
383
838
  ...playbackControlsBaseComponent.tests,
839
+ ...autoScoredScoringPreviewTab.tests,
840
+ ...studentViewSettingsLabelComponent.tests,
384
841
  verifyRetakePopupCSSAndA11y: () => {
385
842
  it('CSS of \'Retake\' popup', { tags: 'css' }, () => {
386
843
  utilities.verifyCSS(dialogBoxBase.dialogBox(), {