itemengine-cypress-automation 1.0.105 → 1.0.106

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +129 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +482 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +123 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +554 -0
  5. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -41
  6. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +5 -3
  7. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +284 -0
  8. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +412 -0
  9. package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +203 -0
  10. package/cypress/e2e/ILC/EssayResponse/equationEditorCategories2.js +340 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +336 -0
  14. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
  15. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
  16. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +253 -0
  17. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +266 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +57 -640
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +1 -2
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +209 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +209 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +303 -0
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingPenaltyScoring.js +68 -0
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsBasic.js +149 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +218 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +191 -0
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +219 -0
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +240 -0
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +107 -0
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/manuallyAndNonScored.js +1 -1
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +0 -2
  33. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +408 -0
  34. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +2 -2
  35. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
  36. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +2 -2
  37. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +1 -0
  38. package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +0 -6
  39. package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +242 -0
  40. package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +99 -0
  41. package/cypress/e2e/ILC/Passage/passageEditTab.js +241 -0
  42. package/cypress/e2e/ILC/Passage/passageHeaderSection.js +73 -0
  43. package/cypress/e2e/ILC/Passage/passagePreviewTab.js +246 -0
  44. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +138 -33
  45. package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +30 -6
  46. package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +167 -101
  47. package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +1 -1
  48. package/cypress/e2e/ILC/SingleSelection/headerSection.js +20 -5
  49. package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +1 -0
  50. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +12 -7
  51. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +1336 -0
  52. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +419 -0
  53. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +443 -0
  54. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +411 -0
  55. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +411 -0
  56. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +45 -0
  57. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
  58. package/cypress/fixtures/specialAndMathCharacters.js +2 -0
  59. package/cypress/fixtures/theme/ilc.json +4 -2
  60. package/cypress/pages/audioResponsePage.js +326 -165
  61. package/cypress/pages/components/additionalSettingsPanel.js +1 -1
  62. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
  63. package/cypress/pages/components/backgroundImageUploadComponent.js +162 -2
  64. package/cypress/pages/components/colorPopupComponent.js +115 -26
  65. package/cypress/pages/components/customizeMathCharacterComponent.js +133 -0
  66. package/cypress/pages/components/customizeSpecialCharacterComponent.js +74 -4
  67. package/cypress/pages/components/editCategoryFlyout.js +164 -2
  68. package/cypress/pages/components/equationEditorFlyout.js +36 -1
  69. package/cypress/pages/components/essayResponseCommonComponents.js +0 -2
  70. package/cypress/pages/components/figOverImageCanvasComponent.js +587 -134
  71. package/cypress/pages/components/index.js +2 -1
  72. package/cypress/pages/components/playbackControlsBaseComponent.js +137 -2
  73. package/cypress/pages/correctAnswerViewPage.js +12 -1
  74. package/cypress/pages/drawingResponsePage.js +26 -151
  75. package/cypress/pages/essayResponseMathPage.js +28 -16
  76. package/cypress/pages/essayResponsePage.js +187 -7
  77. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +78 -14
  78. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +178 -221
  79. package/cypress/pages/fillInTheGapsOverImageTextPage.js +79 -0
  80. package/cypress/pages/multipleSelectionPage.js +1 -1
  81. package/cypress/pages/readingRulerPage.js +219 -104
  82. package/cypress/pages/singleSelectionPage.js +1 -0
  83. package/cypress/pages/textEntryMathPage.js +17 -6
  84. package/cypress/pages/videoResponsePage.js +0 -8
  85. package/package.json +1 -1
  86. package/scripts/sorry-cypress.mjs +1 -1
@@ -1,105 +1,62 @@
1
- import { createQuestionBasePage, questionInstructionsComponent, additionalSettingsPanel, commonComponents, scoringSectionBase, previewScoringAndShowCorrectAnswerComponent, maximumRecorderLengthComponent } from "../pages/components";
2
1
  import utilities from "../support/helpers/utilities";
2
+ import { createQuestionBasePage, questionInstructionsComponent, scoringSectionBaseEditTab, maximumRecorderLengthComponent, commonComponents, playbackControlsBaseComponent } from "./components"
3
3
  import { dialogBoxBase } from "./dialogBoxBase";
4
+ const css = Cypress.env('css');
4
5
 
5
6
  const selectors = {
6
- ...additionalSettingsPanel,
7
7
  ...createQuestionBasePage,
8
8
  ...commonComponents,
9
- ...dialogBoxBase,
10
- ...scoringSectionBase,
9
+ ...scoringSectionBaseEditTab,
11
10
  ...questionInstructionsComponent,
12
- audioRecorderStyleLabel: () => cy.get('#Audio-Recorder-Style-dropdown-label'),
13
- audioRecorderStyleDropdown: () => cy.get('#Audio-Recorder-Style-select'),
14
- audioRecorderStyleListOptions: (optionIndex) => cy.get('[aria-labelledby="Audio-Recorder-Style-dropdown-label Audio-Recorder-Style-placeholder"] li[role="option"]').eq(optionIndex),
15
- audioRecorderStyleList: () => cy.get('.dropdown-list'),
16
- stopRecordingIfSilenceIsDetectedLabel: () => cy.get('.stop-recording-length-label'),
17
- stopRecordingIfSilenceIsDetectedInputFieldSecsSuffix: () => cy.get('.audio-stop-recording-suffix'),
18
- stopRecordingIfSilenceIsDetectedInputField: () => cy.get('.stop-recording-on-silence-time-input-field input'),
19
- recorderAndPlaybackControlsOptionButtonIcon: () => cy.get('.ngie-toggle-button-icon'),
20
- //Customize recorder and playback controls (for student player)
21
- customizeRecorderAndPlaybackControlsAccordionChevronIcon: () => cy.get('.customize-accordion [class*="expandIconWrapper"]'),
22
- customizeRecorderAndPlaybackControlsAccordionLabel: () => cy.get('.customize_recorder_label'),
23
- customizeRecorderAndPlaybackControlsAccordion: () => cy.get('.customize-accordion [role="button"]'),
24
- customizeRecorderAndPlaybackControlsSection: () => cy.get('.customize-accordion'),
25
- recorderAndPlaybackControlsOptionButtonLabel: () => cy.get('.ngie-toggle-button-label'),
26
- //Controls for recording response
27
- controlsForRecordingResponseLabel: () => cy.get('.customize-accordion .ngie-toggle-button-title').eq(0),
28
- startRecordingOptionButton: () => cy.get('[data-ngie-testid="start-recording-toggle-button"]'),
29
- pauseRecordingOptionButton: () => cy.get('[data-ngie-testid="pause-recording-toggle-button"]'),
30
- stopRecordingOptionButton: () => cy.get('[data-ngie-testid="stop-recording-toggle-button"]'),
31
- recordingCueOptionButton: () => cy.get('[data-ngie-testid="recording-cue-toggle-button"]'),
32
- recordingOverlayOptionButton: () => cy.get('[value="recorderOverlay"]'),
33
- //Controls for response playback
34
- controlsForResponsePlaybackLabel: () => cy.get('.customize-accordion .ngie-toggle-button-title').eq(1),
35
- playOptionButton: () => cy.get('[data-ngie-testid="play-toggle-button"]'),
36
- pauseOptionButton: () => cy.get('[data-ngie-testid="pause-toggle-button"]'),
37
- seekOptionButton: () => cy.get('[data-ngie-testid="seek-toggle-button"]'),
38
- volumeControlOptionButton: () => cy.get('[data-ngie-testid="volume-control-toggle-button"]'),
39
- playbackOverlayOptionButton: () => cy.get('[value="playbackOverlay"]'),
40
- //Advanced recorder options
41
- playerSettingsLabel: () => cy.get('.accordion_label'),
42
- advancedRecorderOptionsLabel: () => cy.get('.advanced-recorder-settings .ngie-toggle-button-title'),
43
- advancedRecorderOptionsSection: () => cy.get('[class*="AdditionalOptionstyles__AudioResponseButtonWrapper"]'),
44
- timerOptionButton: () => cy.get('[data-ngie-testid="timer-toggle-button"]'),
45
- progressBarOptionButton: () => cy.get('[data-ngie-testid="progress-bar-toggle-button"]'),
46
- volumeMeterOptionButton: () => cy.get('[data-ngie-testid="volume-meter-toggle-button"]'),
47
- waveformOptionButton: () => cy.get('[data-ngie-testid="waveform-toggle-button"]'),
48
- waveformCursor: () => cy.get('.audio-wave-form-cursor-div'),
49
- //Maximum width for audio recorder
50
- maximumWidthForAudioRecorderLabel: () => cy.get('#max-width-audio-label'),
51
- maximumWidthForAudioRecorderInputField: () => cy.get('.max-width-audio-recorder-input-field input'),
52
- //Allow teachers to download student responses
53
- allowTeachersToDownloadStudentResponsesCheckboxLabel: () => cy.get('[data-ngie-testid="allow-teachers-to-download-student-response-checkbox"] .MuiFormControlLabel-label'),
54
- allowTeachersToDownloadStudentResponsesCheckbox: () => cy.get('[data-ngie-testid="allow-teachers-to-download-student-response-checkbox"] input'),
55
- //Preview tab
56
- previewPlaybackProgressBar: () => cy.get('.audio-playback-slider-wrapper'),//same for minimal
57
- previewPlaybackSlider: () => cy.get('input[aria-label="Slider bar"]'),//same for minimal
58
- previewPlaybackWaveform: () => cy.get('.audio-wave-form'),//same for minimal
59
- previewMaxRecordTime: () => cy.get('.standard-record-timer'),
60
- previewVolumeControlButton: () => cy.get('.audio-player-icon'),//same for minimal
61
- previewMicIcon: () => cy.get('.audio-response-icon'),
62
- previewVolumeMeter: () => cy.get('.volume-meter'),
63
- previewRecordProgressBar: () => cy.get('.audio-progress-bar-wrapper'),
64
- previewVolumeControlSlider: () => cy.get('[class*="VolumeControlstyle__StyledSlider"]'),
65
- previewWaveformTotalWidth: () => cy.get('.audio-wave-form wave wave canvas'),
66
- previewWaveformCurrentPositionWidth: () => cy.get('.audio-wave-form wave wave'),
67
- previewMicGlowAnimation: () => cy.get('.standard-audio-recorder-inprogress'),
68
- previewMutedVolumeControlIcon: () => cy.get('.audio-mute-icon-wr'),
69
- previewUnmutedVolumeControlIcon: () => cy.get('.audio-volume-icon-wr'),
70
- previewPlayPlaybackButton: () => cy.get('.standard-recorder-play-pause-btn[aria-label="Play"]'),//same for minimal
71
- previewPausePlaybackButton: () => cy.get('.standard-recorder-play-pause-btn[aria-label="Pause"]'),//same for minimal
11
+ ...maximumRecorderLengthComponent,
12
+ ...playbackControlsBaseComponent,
13
+ recordedResponseHelpText: () => cy.get('[class*="preview-help-text"]'),
14
+ playbackWaveform: () => cy.get('.audio-wave-form'),
72
15
  //standard style
73
- standardPreviewStartRecordingButton: () => cy.get('.standardRecorderStart-btn'),
74
- standardPreviewStopRecordingButton: () => cy.get('.standardRecorderStop-btn'),
75
- standardPreviewPauseRecordingButton: () => cy.get('.standardRecorderPause-btn'),
76
- standardPreviewPlayerHelpText: () => cy.get('.standard-recorder-player-text-wrapper'),
16
+ standardPreviewStartRecordingButton: () => cy.get('.standard-audio-recorder-mic [role="button"]'),
17
+ standardPreviewStopRecordingButton: () => cy.get('.standard-recorder-stop-btn'),
18
+ standardPreviewPauseRecordingButton: () => cy.get('.standard-recorder-pause-btn'),
77
19
  standardPreviewRecorderHelpText: () => cy.get('.standard-click-record-to-begin'),
78
- standardPreviewRecordTime: () => cy.get('.standard-record-timer-wrapper'),
79
- standardPreviewResumeRecordingButton: () => cy.get('.standardRecorderResume-btn'),
20
+ standardPreviewRecordTime: () => cy.get('.standard-record-timer'),
21
+ standardPreviewResumeRecordingButton: () => cy.get('.standard-recorder-resume-btn'),
80
22
  standardPreviewRetakeButton: () => cy.get('.standard-recorder-retake-btn'),
81
- standardPreviewDisabledPlayButton: () => cy.get('.standard-recorder-play-btn'),
82
- standardPreviewRecordingCompletedProgressBar: () => cy.get('.standard-playback-slider-wrapper'),
83
- standardPreviewHelpTextOutsideContainer: () => cy.get('.standard-preview-help-text'),
84
23
  standardPreviewRecorderWrapper: () => cy.get('.standard-recorder-wrapper'),
85
24
  standardPreviewPlaybackWrapper: () => cy.get('.standard-audio-playback-wrapper'),
25
+ standardPreviewPlaybackTime: () => cy.get('.standard-record-timer-wrapper'),
26
+ allowMicrophoneAccessHelpText: () => cy.get('.microphone-access .microphone-label'),
27
+ microphoneIcon: () => cy.get('.microphone-access svg'),
28
+ startRecordingCountDown: () => cy.get('.count-down-number'),
29
+ recordingStatusText: () => cy.get('.indicator-label'),
30
+ recordingStatusIcon: () => cy.get('.red-circle'),
31
+ previewMaxRecordTime: () => cy.get('.standard-record-timer'),
32
+ savingStatusText: () => cy.get('.uploading-status .indicator-label'),
33
+ hourGlassIcon: () => cy.get('.saving-icon'),
34
+ previewVolumeMeter: () => cy.get('.volume-meter'),
35
+ playbackProgressBar: () => cy.get('.audio-playback-slider-wrapper'),
36
+ previewPlaybackSlider: () => cy.get('input[aria-label="Slider bar"]'),
37
+ previewPausePlaybackButton: () => cy.get('.standard-recorder-play-pause-btn[aria-label="Pause"]'),
38
+ downloadAudioButton: () => cy.get('.download-btn'),
39
+ micGlowAnimation: () => cy.get('.blur-wrapper'),
40
+ recordingMicIcon: () => cy.get('[data-name="Icon awesome-microphone"]'),
41
+ pauseIcon: () => cy.get('.pause-icon-block'),
42
+ waveformCursor: () => cy.get('.audio-wave-form-cursor-div'),
43
+ standardRecorderStyleButton: () => cy.get('[data-ngie-testid="standard-toggle-button"]'),
44
+ barRecorderStyleButton: () => cy.get('[data-ngie-testid="bar-toggle-button"]'),
45
+ minimalRecorderStyleButton: () => cy.get('[data-ngie-testid="minimal-toggle-button"]'),
86
46
  //minimal style
87
- minimalPreviewRecordButton: () => cy.get('.record-button[type="button"]'),
88
- minimalPreviewRetakeButton: () => cy.get('.retake-button[type="button"]'),
89
- minimalPreviewStopRecordingButton: () => cy.get('.stop-button[type="button"]'),
90
- minimalPreviewPlaybackButton: () => cy.get('.playback-button[type="button"]'),
91
- minimalPreviewPauseRecordingButton: () => cy.get('.minimal-recording-pause-btn'),
92
- minimalPreviewStopPlaybackButton: () => cy.get('.playback-stop-button[type="button"]'),
93
- minimalPreviewRecorderFlyoutHelpText: () => cy.get('.minimal-recording-text'),
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'),
94
55
  minimalPreviewRecorderHelpText: () => cy.get('.minimal-record-helper-text-wrapper'),
95
- minimalPreviewRecordingOverlay: () => cy.get('.recorder-flyout-wrapper'),
96
- minimalPreviewOverlayArrow: () => cy.get('.flyout-arrow'),
97
- minimalPreviewPlaybackOverlay: () => cy.get('.minimal-audio-playback-wrapper'),
98
- minimalPreviewResumeRecordingButton: () => cy.get('.minimal-recording-resume-btn'),
99
56
  minimalPreviewRecordingTimer: () => cy.get('.minimal-recording-timer'),
100
- minimalPreviewPlaybackTimer: () => cy.get('.minimal-playback-timer'),
101
- minimalPreviewPlaybackFlyoutHelpText: () => cy.get('.minimal-playback-text'),
102
- minimalPreviewRecorderWrapper: () => cy.get('.minimal-recorder-wrapper'),
57
+ minimalPreviewVolumeMeter: () => cy.get('.audio-volume-meter-wrapper'),
58
+ minimalPreviewPlaybackPlayButton: () => cy.get('.play-back-button'),
59
+ minimalPreviewPlaybackTime: () => cy.get('.minimal-playback-timer'),
103
60
  //Retake dialogue box
104
61
  confirmRetakeButton: () => cy.get('.action-btn-wrapper button').eq(1),
105
62
  cancelRetakeButton: () => cy.get('.action-btn-wrapper button').eq(0),
@@ -109,91 +66,83 @@ const selectors = {
109
66
  const steps = {
110
67
  ...createQuestionBasePage.steps,
111
68
  ...questionInstructionsComponent.steps,
112
- ...additionalSettingsPanel.steps,
113
- ...scoringSectionBase.steps,
69
+ ...scoringSectionBaseEditTab.steps,
114
70
  ...questionInstructionsComponent.steps,
115
71
  ...maximumRecorderLengthComponent.steps,
116
- switchToMinimalRecorderStyle: () => {
117
- audioResponsePage.audioRecorderStyleDropdown()
118
- .click();
119
- audioResponsePage.audioRecorderStyleListOptions(1)
120
- .click();
121
- },
122
-
123
- expandCustomizeRecorderAndPlaybackControlsAccordion: () => {
124
- audioResponsePage.customizeRecorderAndPlaybackControlsAccordion()
125
- .click()
126
- .should('have.attr', 'aria-expanded', 'true');
127
- },
128
-
129
- collapseCustomizeRecorderAndPlaybackControlsAccordion: () => {
130
- audioResponsePage.customizeRecorderAndPlaybackControlsAccordion()
131
- .click()
132
- .should('have.attr', 'aria-expanded', 'false');
133
- },
134
-
135
- setStopRecordingIfSilenceIsDetectedAfter: (length) => {
136
- audioResponsePage.stopRecordingIfSilenceIsDetectedInputField()
137
- .clear()
138
- .type(length)
139
- .blur();
140
- },
141
-
72
+ ...playbackControlsBaseComponent.steps,
142
73
  startRecordingStandardPreview: () => {
143
74
  audioResponsePage.standardPreviewStartRecordingButton()
144
75
  .click();
145
76
  },
146
77
 
78
+ verifyRecordingCountDownNotExists: () => {
79
+ utilities.verifyElementVisibilityState(audioResponsePage.startRecordingCountDown(), 'notExist');
80
+ },
81
+
147
82
  waitForRecordingToStartStandardPreview: () => {
148
83
  audioResponsePage.previewMaxRecordTime()
149
84
  .should('contain', '00:01 /')
150
85
  },
151
86
 
152
- pauseRecordingStandardPreview: () => {
153
- audioResponsePage.standardPreviewPauseRecordingButton()
154
- .click();
155
- },
156
-
157
87
  /**
158
- * Verifies the recorded audio preview time against the expected time.
159
- * @param {string} time - The expected preview time to verify.
160
- * @throws {Error} Throws an error if the preview time does not match the expected time.
88
+ * Verifies the recorded time displayed in the standard preview player on the audio response page.
89
+ * @param {string} recordingTime - The current recorded time in the format 'mm:ss'.
90
+ * @param {string} totalTime - The total duration of the audio in the format 'mm:ss'.
91
+ * @returns {undefined}
161
92
  */
162
- verifyRecordingTimeStandardPreview: (time) => {
163
- audioResponsePage.previewMaxRecordTime()
164
- .should('have.text', time)
93
+ verifyRecordingTimeStandardPreview: (recordingTime, totalTime) => {
94
+ utilities.verifyTextContent(audioResponsePage.previewMaxRecordTime(), `${recordingTime} / ${totalTime}`)
165
95
  },
166
96
 
167
- resumeRecordingStandardPreview: () => {
168
- audioResponsePage.standardPreviewResumeRecordingButton()
97
+ stopRecordingStandardPreview: () => {
98
+ audioResponsePage.standardPreviewStopRecordingButton()
169
99
  .click();
170
100
  },
171
101
 
172
102
  /**
173
- * Verifies the recording status against the expected status for the standard preview recorder.
174
- * @param {string} recordingStatus - The expected recording status to verify.
175
- * @throws {Error} Throws an error if the recording status does not match the expected status.
103
+ * Verifies the playback time displayed in the standard preview player on the audio response page.
104
+ * @param {string} playbackTime - The current playback time in the format 'mm:ss'.
105
+ * @param {string} totalTime - The total duration of the audio in the format 'mm:ss'.
106
+ * @returns {undefined}
176
107
  */
177
- verifyRecordingStatusStandardPreview: (recordingStatus) => {
178
- utilities.verifyInnerText(audioResponsePage.standardPreviewRecorderHelpText(), recordingStatus);
179
- utilities.verifyElementVisibilityState(audioResponsePage.standardPreviewRecorderHelpText(), 'visible');
108
+ verifyPlaybackTimeStandardPreview: (playbackTime, totalTime) => {
109
+ utilities.verifyTextContent(audioResponsePage.standardPreviewPlaybackTime(), `${playbackTime}/${totalTime}`);
180
110
  },
181
111
 
112
+ /**
113
+ * Adds a wait period to pause test execution, typically used to simulate recording audio for a specified duration.
114
+ * @param {number} time - The duration (in milliseconds) to wait to simulate audio recording.
115
+ * @returns {void}
116
+ */
117
+ addWaitToRecordAudio: (time) => {
118
+ cy.wait(time)
119
+ },
120
+
121
+ /**
122
+ * Verifies the displayed volume meter value in decibels (dB).
123
+ * @param {string} valueInDb - The expected value of the volume meter in decibels (dB).
124
+ */
182
125
  verifyVolumeMeterInDb: (valueInDb) => {
183
126
  audioResponsePage.previewVolumeMeter()
184
127
  .should('have.text', valueInDb);
185
128
  },
186
129
 
187
- waitForRecordingToStartMinimalPreview: () => {
188
- audioResponsePage.minimalPreviewRecordingTimer()
189
- .should('contain', '00:01 /')
130
+ pauseRecordingStandardPreview: () => {
131
+ audioResponsePage.standardPreviewPauseRecordingButton()
132
+ .click();
190
133
  },
191
134
 
192
- stopRecordingStandardPreview: () => {
193
- audioResponsePage.standardPreviewStopRecordingButton()
135
+ resumeRecordingStandardPreview: () => {
136
+ audioResponsePage.standardPreviewResumeRecordingButton()
194
137
  .click();
195
138
  },
196
139
 
140
+ verifyMicGlowAnimationNotVisible: () => {
141
+ audioResponsePage.micGlowAnimation()
142
+ .should('not.have.css', 'background-color', css.color.micGlowAnimation)
143
+ .and('have.css', 'background-color', css.color.transparent);
144
+ },
145
+
197
146
  /**
198
147
  * Records and saves audio during the standard preview recording process.
199
148
  * @param {number} time - The duration (in milliseconds) to record audio before saving.
@@ -206,6 +155,85 @@ const steps = {
206
155
  audioResponsePage.steps.stopRecordingStandardPreview();
207
156
  },
208
157
 
158
+ startPlayback: () => {
159
+ audioResponsePage.playbackPlayButton()
160
+ .click();
161
+ },
162
+
163
+ waitForPlaybackToBegin: () => {
164
+ audioResponsePage.standardPreviewPlaybackTime()
165
+ .should('contain', '00:01/')
166
+ },
167
+
168
+ pausePlayback: () => {
169
+ audioResponsePage.playbackPauseButton()
170
+ .click();
171
+ },
172
+
173
+ /**
174
+ * Adds a wait period to pause test execution, typically used to wait for audio playback to complete.
175
+ * @param {number} time - The duration (in milliseconds) to wait.
176
+ */
177
+ addWaitToPlayAudio: (time) => {
178
+ cy.wait(time)
179
+ },
180
+
181
+ /**
182
+ * Verifies the playback elapsed time displayed on the audio response page.
183
+ * @param {number} time - The expected elapsed time in seconds.
184
+ * @param {("Standard" | "Minimal")} recorderStyle - The style of the recorder ('Standard' or 'Minimal').
185
+ * @throws {Error} Will throw an error if the provided recorder style is invalid.
186
+ * @returns {void}
187
+ */
188
+ verifyPlaybackElapsedTime: (time, recorderStyle) => {
189
+ let playbackTimeElement;
190
+
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
+
199
+ playbackTimeElement
200
+ .invoke('text')
201
+ .then(text => {
202
+ let elapsedTime = text.split('/')[0];
203
+ let currentElapsedTimerMinutes = Number(elapsedTime.split(':')[0]);
204
+ let currentElapsedTimerSeconds = Number(elapsedTime.split(':')[1]);
205
+ let currentTotalElapsedTimerSeconds = currentElapsedTimerMinutes * 60 + currentElapsedTimerSeconds;
206
+ expect(currentTotalElapsedTimerSeconds).to.equal(time);
207
+ });
208
+ },
209
+
210
+ /**
211
+ * Selects the audio recorder style based on the provided style.
212
+ * @param {('Standard' | 'Bar' | 'Minimal')} recorderStyle - The style of the audio recorder to select.
213
+ * @throws {Error} Will throw an error if an invalid recorder style is provided.
214
+ */
215
+ selectAudioRecorderStyle: (recorderStyle) => {
216
+ switch (recorderStyle) {
217
+ case 'Standard':
218
+ audioResponsePage.standardRecorderStyleButton()
219
+ .click()
220
+ .should('have.class', 'ngie-toggle-button-selected');
221
+ break;
222
+ case 'Bar':
223
+ audioResponsePage.barRecorderStyleButton()
224
+ .click()
225
+ .should('have.class', 'ngie-toggle-button-selected');
226
+ break;
227
+ case 'Minimal':
228
+ audioResponsePage.minimalRecorderStyleButton()
229
+ .click()
230
+ .should('have.class', 'ngie-toggle-button-selected');
231
+ break;
232
+ default:
233
+ throw new Error('Invalid recorder style');
234
+ }
235
+ },
236
+
209
237
  startRecordingMinimalPreview: () => {
210
238
  audioResponsePage.minimalPreviewRecordButton()
211
239
  .click();
@@ -216,49 +244,182 @@ const steps = {
216
244
  .click();
217
245
  },
218
246
 
219
- waitForPlaybackToBeginStandardPreview: () => {
220
- audioResponsePage.standardPreviewRecordTime()
221
- .find('.standard-recorder-time-wrapper')
222
- .should('have.text', '00:01')
247
+ waitForRecordingToStartMinimalPreview: () => {
248
+ audioResponsePage.minimalPreviewRecordingTimer()
249
+ .should('contain', '00:01 /')
223
250
  },
224
251
 
225
- waitForPlaybackToBeginMinimalPreview: () => {
226
- audioResponsePage.minimalPreviewPlaybackTimer()
227
- .find('[class*="MinimalAudioPlayerstyles__TimeWrapper"]')
228
- .should('have.text', '00:01')
252
+ verifyRecordingLengthAfterResumingStandardPreview: () => {
253
+ audioResponsePage.previewMaxRecordTime()
254
+ .invoke('text')
255
+ .then(($timer) => {
256
+ const currentTimer = $timer.split(' / ')[0];
257
+ const currentSeconds = parseInt(currentTimer.split(':')[1], 10);
258
+ expect(currentSeconds).to.be.gte(3);
259
+ });
229
260
  },
230
261
 
231
262
  /**
232
- * Adds a wait period to pause test execution, typically used to wait for audio playback to complete.
233
- * @param {number} time - The duration (in milliseconds) to wait.
234
- * @returns {void}
263
+ * Verifies the recorded time displayed in the minimal preview player on the audio response page.
264
+ * @param {string} recordingTime - The current recorded time in the format 'mm:ss'.
265
+ * @param {string} totalTime - The total duration of the audio in the format 'mm:ss'.
266
+ * @returns {undefined}
235
267
  */
236
- addWaitForPlayback: (time) => {
237
- cy.wait(time)
268
+ verifyRecordingTimeMinimalPreview: (recordingTime, totalTime) => {
269
+ utilities.verifyTextContent(audioResponsePage.minimalPreviewRecordingTimer(), `${recordingTime} / ${totalTime}`)
238
270
  },
239
271
 
240
272
  /**
241
- * Adds a wait period to pause test execution, typically used to simulate recording audio for a specified duration.
242
- * @param {number} time - The duration (in milliseconds) to wait to simulate audio recording.
243
- * @returns {void}
273
+ * Verifies the playback time displayed in the minimal preview player on the audio response page.
274
+ * @param {string} playbackTime - The current playback time in the format 'mm:ss'.
275
+ * @param {string} totalTime - The total duration of the audio in the format 'mm:ss'.
276
+ * @returns {undefined}
244
277
  */
245
- addWaitToRecordAudio: (time) => {
246
- cy.wait(time)
247
- }
278
+ verifyPlaybackTimeMinimalPreview: (playbackTime, totalTime) => {
279
+ utilities.verifyTextContent(audioResponsePage.minimalPreviewPlaybackTime(), `${playbackTime}/${totalTime}`);
280
+ },
281
+
282
+ pauseRecordingMinimalPreview: () => {
283
+ audioResponsePage.minimalPreviewPauseRecordingButton()
284
+ .click();
285
+ },
286
+
287
+ resumeRecordingMinimalPreview: () => {
288
+ audioResponsePage.minimalPreviewResumeRecordingButton()
289
+ .click();
290
+ },
291
+
292
+ verifyRecordingLengthAfterResumingMinimalPreview: () => {
293
+ audioResponsePage.minimalPreviewRecordingTimer()
294
+ .invoke('text')
295
+ .then(($timer) => {
296
+ const currentTimer = $timer.split(' / ')[0];
297
+ const currentSeconds = parseInt(currentTimer.split(':')[1], 10);
298
+ expect(currentSeconds).to.be.gte(6);
299
+ });
300
+ },
301
+
302
+ stopRecordingMinimalPreview: () => {
303
+ audioResponsePage.minimalPreviewStopRecordingButton()
304
+ .click();
305
+ },
306
+
307
+ retakeRecordingStandardPreview: () => {
308
+ audioResponsePage.standardPreviewRetakeButton()
309
+ .click();
310
+ },
311
+
312
+ /**
313
+ * Records and saves audio during the minimal preview recording process.
314
+ * @param {number} time - The duration (in milliseconds) to record audio before saving.
315
+ * @throws {Error} Throws an error if there is an issue during the recording and saving process.
316
+ */
317
+ recordAndSaveAudioMinimalPreview: (time) => {
318
+ audioResponsePage.steps.startRecordingMinimalPreview();
319
+ audioResponsePage.steps.waitForRecordingToStartMinimalPreview();
320
+ audioResponsePage.steps.addWaitToRecordAudio(time - 1000);
321
+ audioResponsePage.steps.stopRecordingMinimalPreview();
322
+ },
323
+
324
+ cancelRetake: () => {
325
+ audioResponsePage.cancelRetakeButton()
326
+ .click();
327
+ },
328
+
329
+ confirmRetake: () => {
330
+ audioResponsePage.confirmRetakeButton()
331
+ .click();
332
+ },
333
+
334
+ startPlaybackMinimalPreview: () => {
335
+ audioResponsePage.minimalPreviewPlayPlaybackButton()
336
+ .click();
337
+ },
338
+
339
+ waitForPlaybackToBeginMinimalPreview: () => {
340
+ audioResponsePage.minimalPreviewPlaybackTime()
341
+ .should('contain', '00:01/')
342
+ },
343
+
344
+ pausePlaybackMinimalPreview: () => {
345
+ audioResponsePage.minimalPreviewPausePlaybackButton()
346
+ .click();
347
+ },
348
+
349
+ verifyRetakePopupContents: () => {
350
+ utilities.verifyInnerText(audioResponsePage.retakePopupContent(), 'Are you sure you want to overwrite the existing audio recording?');
351
+ utilities.verifyInnerText(audioResponsePage.confirmRetakeButton(), 'Confirm');
352
+ utilities.verifyElementVisibilityState(audioResponsePage.confirmRetakeButton(), 'visible');
353
+ utilities.verifyInnerText(audioResponsePage.cancelRetakeButton(), 'Cancel');
354
+ utilities.verifyElementVisibilityState(audioResponsePage.cancelRetakeButton(), 'visible');
355
+ },
356
+
357
+ retakeRecordingMinimalPreview: () => {
358
+ audioResponsePage.minimalPreviewRetakeButton()
359
+ .click();
360
+ },
361
+
362
+ pauseAndVerifyProgressBarSliderPositionMinimalPreview: () => {
363
+ let initialWidthProgressBar
364
+ playbackControlsBaseComponent.progressBarSlider()
365
+ .then(($currWidth) => {
366
+ initialWidthProgressBar = $currWidth[0].valueAsNumber
367
+ });
368
+ audioResponsePage.steps.pausePlaybackMinimalPreview();
369
+ playbackControlsBaseComponent.progressBarSlider()
370
+ .then(($finalWidth) => {
371
+ cy.log('The assertion is verifying the value synchronously i.e in real time')
372
+ const finalWidth = $finalWidth[0].valueAsNumber
373
+ expect(finalWidth).to.closeTo(initialWidthProgressBar, 5)
374
+ });
375
+ },
248
376
  }
249
377
 
250
378
  const tests = {
251
379
  ...createQuestionBasePage.tests,
252
380
  ...questionInstructionsComponent.tests,
253
- ...additionalSettingsPanel.tests,
254
- ...scoringSectionBase.tests,
255
- ...questionInstructionsComponent.tests,
256
- ...previewScoringAndShowCorrectAnswerComponent.tests,
257
- ...maximumRecorderLengthComponent.tests
381
+ ...scoringSectionBaseEditTab.tests,
382
+ ...maximumRecorderLengthComponent.tests,
383
+ ...playbackControlsBaseComponent.tests,
384
+ verifyRetakePopupCSSAndA11y: () => {
385
+ it('CSS of \'Retake\' popup', { tags: 'css' }, () => {
386
+ utilities.verifyCSS(dialogBoxBase.dialogBox(), {
387
+ 'border': `1px solid ${css.color.defaultDropdownBorder}`,
388
+ 'background-color': css.color.defaultBackground
389
+ });
390
+ utilities.verifyCSS(dialogBoxBase.dialogBoxTitle(), {
391
+ 'color': css.color.questionHeading,
392
+ 'font-size': css.fontSize.heading,
393
+ 'font-weight': css.fontWeight.semibold
394
+ });
395
+ utilities.verifyCSS(dialogBoxBase.dialogBoxContent().find('.retake-popup-content'), {
396
+ 'border-top': `1px solid ${css.color.secondaryBtnBorder}`,
397
+ 'color': css.color.labels,
398
+ 'font-size': css.fontSize.default,
399
+ 'font-weight': css.fontWeight.regular
400
+ });
401
+ utilities.verifyCSS(audioResponsePage.confirmRetakeButton(), {
402
+ 'background-color': css.color.deleteBtn,
403
+ 'color': css.color.whiteText,
404
+ 'font-size': css.fontSize.default,
405
+ 'font-weight': css.fontWeight.semibold
406
+ });
407
+ utilities.verifyCSS(audioResponsePage.cancelRetakeButton(), {
408
+ 'background-color': css.color.secondaryBtnBg,
409
+ 'color': css.color.secondaryBtn,
410
+ 'font-size': css.fontSize.default,
411
+ 'font-weight': css.fontWeight.semibold
412
+ });
413
+ });
414
+
415
+ it('Accessibility of \'Retake\' popup', { tags: 'a11y' }, () => {
416
+ cy.checkAccessibility(dialogBoxBase.dialogBox());
417
+ });
418
+ }
258
419
  }
259
420
 
260
421
  export const audioResponsePage = {
261
422
  ...selectors,
262
- tests,
263
- steps
423
+ steps,
424
+ tests
264
425
  }
@@ -11,7 +11,7 @@ const selectors = {
11
11
  additionalSettingsAcknowledgementsLabel: () => cy.get('.additional-settings-detail-wrapper .additional-settings-label').eq(2),
12
12
  additionalSettingsTeacherGuidelinesInputField: () => cy.get('[title="Teacher Scoring Guidelines"]'),
13
13
  additionalSettingsSampleAnswerInputField: () => cy.get('[title="Sample Answer"]'),
14
- additionalSettingsAcknowledgementsInputField: () => cy.get('[title="acknowledgements & references"]'),
14
+ additionalSettingsAcknowledgementsInputField: () => cy.get('[title="acknowledgements and references"]'),
15
15
  //Font-size dropdown
16
16
  fontSizeLabel: () => cy.get('#Font-Size-dropdown-label'),
17
17
  fontSizeDropdown: () => cy.get('#Font-Size-select'),
@@ -8,7 +8,7 @@ const selectors = {
8
8
  specifyCorrectAnswerLabel: () => cy.get('.set-correct-answer-label'),
9
9
  specifyCorrectAnswerHelpText: () => cy.get('.edit-set-correct-answer-help-text'),
10
10
  specifyCorrectAnswerSectionWrapper: () => cy.get('.edit-question-auto-scored-set-correct-answer-wrapper'),
11
- alternativeAnswerButton: () => cy.get('[class*="AddAlternateAnswer"] button'),
11
+ alternativeAnswerButton: () => cy.get('[class*="AlternateAnswer"] button'),
12
12
  //TODO: Need to update the selector of correct answer accordion once a unique selector is made available
13
13
  correctAnswerAccordion: () => cy.get('.correct-answer-accordion [role="button"]').eq(0),
14
14
  alternativeAnswerAccordion: () => cy.get('.correct-answer-accordion .ngie-accordion-summary'),