itemengine-cypress-automation 1.0.253-TEMSmokeTestUpdates-82559a5.0 → 1.0.254-UpdatedRepo4thNov-c5b0050.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAddFeatureRadioButton.js +231 -0
  2. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAddTranscriptRadioButton .js +213 -0
  3. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAudioPlayerStyle.js +148 -0
  4. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabStudentViewSettings.js +249 -0
  5. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerHeaderSectionAndButtons.js +164 -0
  6. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTab.js +444 -0
  7. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabSupportedFileTypes.js +102 -0
  8. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabTranscript.js +134 -0
  9. package/cypress/e2e/ILC/CkEditorEquationEditor/equationEditorBasicFile.js +46 -0
  10. package/cypress/e2e/ILC/CkEditorInsertTable/insertTableEditorBasicFile.js +98 -0
  11. package/cypress/e2e/ILC/CkEditorInsertTable/tableDimension&FooterProperties.js +147 -0
  12. package/cypress/e2e/ILC/CkEditorInsertTable/tableHeaders.js +127 -0
  13. package/cypress/e2e/ILC/CkEditorInsertTable/tableRowAndColumn.js +71 -0
  14. package/cypress/e2e/ILC/CkEditorInsertTable/tableStyle.js +154 -0
  15. package/cypress/e2e/ILC/Compass/compassPreviewContent.smoke.js +1 -0
  16. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +41 -17
  17. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +24 -12
  18. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +47 -20
  19. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +43 -16
  20. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +5 -5
  21. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +52 -21
  22. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionBasic.js +23 -11
  23. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +55 -21
  24. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +53 -21
  25. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +48 -19
  26. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneBasic.js +23 -11
  27. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +47 -17
  28. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +50 -19
  29. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +0 -2
  30. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +3 -0
  31. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +0 -3
  32. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +2 -1
  33. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +4 -4
  34. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +261 -0
  35. package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +4 -2
  36. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +4 -2
  37. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +1 -1
  38. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneAlternateAnswerPopup.js +2 -2
  39. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +5 -3
  40. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -2
  41. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -2
  42. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAlternateAnswerPopup.js +1 -0
  43. package/cypress/e2e/ILC/GridFill/customizeLayoutFillColor.js +3 -0
  44. package/cypress/e2e/ILC/GridFill/customizeLayoutFillImageBackgroundImage.js +15 -0
  45. package/cypress/e2e/ILC/GridFill/customizeLayoutSectionShadeCellsGridBorders.js +10 -0
  46. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +2 -1
  47. package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +3 -2
  48. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +56 -8
  49. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +1 -1
  50. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  51. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +1 -1
  52. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +4 -4
  53. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  54. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +1 -1
  55. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +3 -3
  56. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +2 -2
  57. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +16 -16
  58. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViewsFormulaTemplate.smoke.js +4 -5
  59. package/cypress/e2e/ILC/TextEntryMath/customSettings.js +8 -22
  60. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +19 -19
  61. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -2
  62. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +5 -5
  63. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +1 -4
  64. package/cypress/e2e/ILC/ToolAudioPlayerNew/studentViewSettings.js +8 -2
  65. package/cypress/fixtures/theme/ilc.json +9 -5
  66. package/cypress/pages/components/ckEditorAudioPlayerComponent.js +615 -0
  67. package/cypress/pages/components/ckEditorEquationEditorComponent.js +41 -0
  68. package/cypress/pages/components/ckEditorInsertTableComponent.js +741 -0
  69. package/cypress/pages/components/essayResponseCommonComponents.js +145 -7
  70. package/cypress/pages/components/imageCanvasComponent.js +2 -2
  71. package/cypress/pages/components/index.js +2 -1
  72. package/cypress/pages/components/layoutSectionComponent.js +25 -4
  73. package/cypress/pages/components/numberLineCommonComponent.js +39 -0
  74. package/cypress/pages/components/optionsWrapperComponent.js +1 -1
  75. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -0
  76. package/cypress/pages/dragAndDropIntoCategoriesPage.js +28 -0
  77. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -1
  78. package/cypress/pages/graphingPage.js +8 -8
  79. package/cypress/pages/gridFillPage.js +11 -11
  80. package/cypress/pages/multipleSelectionPage.js +12 -0
  81. package/cypress/pages/singleSelectionPage.js +1 -1
  82. package/cypress/pages/textEntryMathPage.js +18 -0
  83. package/cypress/pages/textEntryMathWithImagePage.js +15 -2
  84. package/cypress/pages/textSelectionPage.js +7 -1
  85. package/package.json +1 -1
@@ -0,0 +1,615 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ import { dialogBoxBase } from "../dialogBoxBase";
3
+ import { createQuestionBasePage } from "../components/createQuestionBasePage.js";
4
+ import { questionInstructionsComponent } from "../components/questionInstructionsComponent";
5
+ import { audioResponsePage } from "../audioResponsePage";
6
+ import { audioPlayerPage } from "../audioPlayerPage.js";
7
+ const css = Cypress.env('css');
8
+
9
+ const selectors = {
10
+ ...createQuestionBasePage,
11
+ ...dialogBoxBase,
12
+ ...questionInstructionsComponent,
13
+ ...audioResponsePage,
14
+ ...audioPlayerPage,
15
+ audioPlayerIcon: () => cy.get('[title="Audio Player"]'),
16
+ tableIcon: () => cy.get('[title="Insert Table"]'),
17
+ linkIcon: () => cy.get('[title="Link (Ctrl+K)"]'),
18
+ ckEditorToolDialogBox: () => cy.get('[aria-labelledby="alert-dialog-title"]'),
19
+ ckEditorToolDialogBoxTitle: () => cy.get('#alert-dialog-title'),
20
+ ckEditorToolDialogBoxCloseIcon: () => cy.get('[data-at="close-button"]'),
21
+ ckEditorToolAudioPlayerBlock: () => cy.get('.audioplayer-wrapper'),
22
+ ckEditorToolAudioPlayerDragHandle: () => cy.get('.cke_widget_drag_handler_container'),
23
+ inputTypeFile: () => cy.get('input[type="file"]'),
24
+ inputTypeTranscriptFile: () => cy.get('.upload-transcript-file input[type="file"]'),
25
+ linkUploadTab: () => cy.get('a[title="Upload"]'),
26
+ sendItToServer: () => cy.get('[title="Send it to the Server"]'),
27
+ okButton: () => cy.get('.action-btn-wrapper .action-button').eq(0),
28
+ cancelButton: () => cy.get('.action-btn-wrapper .action-button').eq(1),
29
+ addUrlButton: () => cy.get('.add-url-opt-label'),
30
+ addAudioButton: () => cy.get('.add-audio-opt-label'),
31
+ addAudioURLRadioButton: () => cy.get('input[value="Add audio URL"]'),
32
+ uploadAudioFileRadioButton: () => cy.get('input[value="Upload audio file"]'),
33
+ fileUploadProgressBar: () => cy.get('.uploadAudioFile .audio-player-form-progressbar'),
34
+ //Upload section
35
+ uploadLabel: () => cy.get('.upload-audio-label'),
36
+ fileNameLabel: () => cy.get('.filename-audio-label'),
37
+ chooseFileButton: () => cy.get('.uploadAudioFile .file-input-btn-wrapper button'),
38
+ noFileChosenLabel: () => cy.get('.selected-file-wrapper'),
39
+ uploadedFileNameLabel: () => cy.get('.selected-file-wrapper'),
40
+ //Error
41
+ sourceUrlInputFieldErrorMessage: () => cy.get('.error-text-message'),
42
+ uploadFileSectionErrorMessage: () => cy.get('[class*="AudioPlayerFormstyles__ErrorBlock"]'),
43
+ uploadTranscriptFileSectionErrorMessage: () => cy.get('.upload-transcript-file [class*="AudioPlayerFormstyles__ErrorBlock"]'),
44
+ //prompt
45
+ promptInputField: () => cy.get('[role="textbox"][title="Prompt"]'),
46
+ //Source URL Input field
47
+ sourceUrlLabel: () => cy.get('.source-url-text-field'),
48
+ //Transcript section
49
+ transcriptLabel: () => cy.get('.transcript-label'),
50
+ uploadTranscriptFileLabel: () => cy.get('.upload-transcript-opt-label'),
51
+ uploadTranscriptFileRadioButton: () => cy.get('.transcript-upload-input'),
52
+ typeInTranscriptLabel: () => cy.get('.type-in-transcript-opt-label'),
53
+ typeInTranscriptRadioButton: () => cy.get('.transcript-type-in-input'),
54
+ uploadTranscriptLabel: () => cy.get('.upload-transcript-file-label'),
55
+ transcriptFileNameLabel: () => cy.get('.filename-transcript-label'),
56
+ chooseTranscriptFileButton: () => cy.get('.upload-transcript-file .file-input-btn-wrapper button'),
57
+ transcriptFileUploadProgressBar: () => cy.get('.upload-transcript-file .audio-player-form-progressbar'),
58
+ typeInTranscriptInputFieldLabel: () => cy.get('.transcript-text-field'),
59
+ typeInTranscriptInputField: () => cy.get('[aria-label="Transcript"]'),
60
+ //Transcript section Preview
61
+ transcriptButton: () => cy.get('.audio-transcript-icon-wr'),
62
+ playbackPlayer: () => cy.get('.audio-resource-preview-wrapper'),
63
+ transcriptModal: () => cy.get('.transcript-wrapper'),
64
+ transcriptModalTitle: () => cy.get('.transcript-title'),
65
+ transcriptModalCloseButton: () => cy.get('[aria-label="Close"]'),
66
+ transcriptModalContent: () => cy.get('.transcript-content'),
67
+ //Student view settings
68
+ studentViewSettingLabel: () => cy.get('[class*="AudioPlayerFormstyles__StudentViewSettingLabel"]'),
69
+ customizePlayerLayoutSettings: () => cy.get('[data-testid="custom-ui-playback-accordion-label"]'),
70
+ allowStudentsToDownloadAudioLabel: () => cy.get('.allow-students-to-download-audio-label').eq(0),
71
+ allowStudentsToDownloadAudioCheckBox: () => cy.get('input[name*="allow-students-to-download"]'),
72
+ limitPlayAttempts: () => cy.get('[name*="limit-play-attempts"]'),
73
+ limitPlayAttemptsLabel: () => cy.get('.allow-students-to-download-audio-label').eq(1),
74
+ playbackLimitLabel: () => cy.get('.playback-limit-text-field'),
75
+ playbackLimitInputField: () => cy.get('input[aria-label="Playback Limit"]'),
76
+ customizeUIControlAccordionLabel: () => cy.get('[data-testid="custom-ui-playback-accordion-label"]'),
77
+ customizeUIControlsForPlaybackChevronIcon: () => cy.get('[class*="AudioPlayerFormstyles__CustomUIPlaybackLabelStyle"]').parents('[role="button"]').find('svg'),
78
+ customizeUIControlAccordion: () => cy.get('[data-ngie-testid="custom-ui-playback-accordion"]'),
79
+ customizeControlPauseButton: () => cy.get('[value="pause"]'),
80
+ customizeControlSeekButton: () => cy.get('[value="seek"]'),
81
+ customizeControlPlayBackSpeedButton: () => cy.get('[value="playbackSpeed"]'),
82
+ customizeControlAddPinButton: () => cy.get('[value="addPin"]'),
83
+ customizeControlForwardBackwardButton: () => cy.get('[value="forwardBackward"]'),
84
+ customizeControlVolumeButton: () => cy.get('[value="volumeControl"]'),
85
+ customizeControlTimerButton: () => cy.get('[value="timer"]'),
86
+ customizeControlProgressBarButton: () => cy.get('[value="progressBar"]'),
87
+ selectedButtonIcon: () => cy.get('.selected-button-wrapper'),
88
+ unCheckAllButton: () => cy.get('.uncheck-button'),
89
+ //Audio Player Style
90
+ audioPlayerStyleWrapper: () => cy.get('[class*="AudioPlayerFormstyles__PlayerTypePlaybackLimitWrapper"]'),
91
+ audioPlayerStyleLabel: () => cy.get('.player-style-label'),
92
+ compactPlayerOptionsLabel: () => cy.get('.options-label').eq(1),
93
+ //Preview
94
+ playbackPlayButton: () => cy.get('button[aria-label="Play"]'),
95
+ playbackPauseButton: () => cy.get('button[aria-label="Pause"]'),
96
+ audioFileSrc: () => cy.get('.audio-player-toolbar audio'),
97
+ playbackTimer: () => cy.get('.audio-player-current-time'),
98
+ playbackLimitHelpText: () => cy.get('.playback-limit-remaining'),
99
+ playbackDownloadButton: () => cy.get('.audio-download-icon-wr'),
100
+ playbackSlider: () => cy.get('input[aria-label="Slider bar"]'),
101
+ }
102
+
103
+ const steps = {
104
+ ...createQuestionBasePage.steps,
105
+ ...questionInstructionsComponent.steps,
106
+ ...audioResponsePage.steps,
107
+ ...audioPlayerPage.steps,
108
+
109
+ verifyAddAudioURLCheckedState: () => {
110
+ ckEditorAudioPlayerComponent.addAudioURLRadioButton()
111
+ .should('be.checked');
112
+ },
113
+
114
+ verifyAddAudioURLUncheckedState: () => {
115
+ ckEditorAudioPlayerComponent.addAudioURLRadioButton()
116
+ .should('not.be.checked');
117
+ },
118
+
119
+ verifyUploadAudioFileCheckedState: () => {
120
+ ckEditorAudioPlayerComponent.uploadAudioFileRadioButton()
121
+ .should('be.checked');
122
+ },
123
+
124
+ verifyUploadAudioFileUncheckedState: () => {
125
+ ckEditorAudioPlayerComponent.uploadAudioFileRadioButton()
126
+ .should('not.be.checked');
127
+ },
128
+
129
+ focusInAndFocusOutOfSourceURLInputField: () => {
130
+ ckEditorAudioPlayerComponent.sourceUrlInputField()
131
+ .click()
132
+ .blur();
133
+ },
134
+
135
+ verifyUploadTranscriptFileCheckedState: () => {
136
+ ckEditorAudioPlayerComponent.uploadTranscriptFileRadioButton()
137
+ .should('be.checked');
138
+ },
139
+
140
+ verifyUploadTranscriptFileUncheckedState: () => {
141
+ ckEditorAudioPlayerComponent.uploadTranscriptFileRadioButton()
142
+ .should('not.be.checked');
143
+ },
144
+
145
+ verifyTypeInTranscriptCheckedState: () => {
146
+ ckEditorAudioPlayerComponent.typeInTranscriptRadioButton()
147
+ .should('be.checked');
148
+ },
149
+
150
+ verifyAllowStudentsToDownloadAudioCheckboxNotChecked: () => {
151
+ ckEditorAudioPlayerComponent.allowStudentsToDownloadAudioCheckBox()
152
+ .should('not.be.checked');
153
+ },
154
+
155
+ verifyAllowStudentsToDownloadAudioCheckboxChecked: () => {
156
+ ckEditorAudioPlayerComponent.allowStudentsToDownloadAudioCheckBox()
157
+ .should('be.checked');
158
+ },
159
+
160
+ checkUncheckAllowStudentsToDownloadAudioCheckbox: () => {
161
+ ckEditorAudioPlayerComponent.allowStudentsToDownloadAudioCheckBox()
162
+ .click();
163
+ },
164
+
165
+ verifyCustomizeUIControlAccordionChevronIcon: () => {
166
+ ckEditorAudioPlayerComponent.customizeUIControlsForPlaybackChevronIcon()
167
+ .should('be.visible');
168
+ },
169
+
170
+ verifyCustomizeUIControlAccordionCollapsedState: () => {
171
+ ckEditorAudioPlayerComponent.customizeUIControlAccordion()
172
+ .should('have.attr', 'aria-expanded', 'false');
173
+ },
174
+
175
+ verifyCustomizeUIControlAccordionExpandedState: () => {
176
+ ckEditorAudioPlayerComponent.customizeUIControlAccordion()
177
+ .should('have.attr', 'aria-expanded', 'true');
178
+ },
179
+
180
+ verifyCustomizeControlPauseButtonSelectedState: () => {
181
+ ckEditorAudioPlayerComponent.customizeControlPauseButton()
182
+ .should('have.attr', 'aria-pressed', 'true')
183
+ .within(() => {
184
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.selectedButtonIcon(), 'visible');
185
+ });
186
+ },
187
+
188
+ verifyCustomizeControlSeekButtonSelectedState: () => {
189
+ ckEditorAudioPlayerComponent.customizeControlSeekButton()
190
+ .should('have.attr', 'aria-pressed', 'true')
191
+ .within(() => {
192
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.selectedButtonIcon(), 'visible');
193
+ });
194
+ },
195
+
196
+ verifyCustomizeControlPlayBackSpeedButtonSelectedState: () => {
197
+ ckEditorAudioPlayerComponent.customizeControlPlayBackSpeedButton()
198
+ .should('have.attr', 'aria-pressed', 'true')
199
+ .within(() => {
200
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.selectedButtonIcon(), 'visible');
201
+ });
202
+ },
203
+
204
+ verifyCustomizeControlAddPinButtonSelectedState: () => {
205
+ ckEditorAudioPlayerComponent.customizeControlAddPinButton()
206
+ .should('have.attr', 'aria-pressed', 'true')
207
+ .within(() => {
208
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.selectedButtonIcon(), 'visible');
209
+ });
210
+ },
211
+
212
+ verifyCustomizeControlForwardBackwardButtonSelectedState: () => {
213
+ ckEditorAudioPlayerComponent.customizeControlForwardBackwardButton()
214
+ .should('have.attr', 'aria-pressed', 'true')
215
+ .within(() => {
216
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.selectedButtonIcon(), 'visible');
217
+ });
218
+ },
219
+
220
+ verifyCustomizeControlPauseButtonDeselectedState: () => {
221
+ ckEditorAudioPlayerComponent.customizeControlPauseButton()
222
+ .should('have.attr', 'aria-pressed', 'false')
223
+ .within(() => {
224
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.selectedButtonIcon(), 'hidden');
225
+ });
226
+ },
227
+
228
+ verifyCustomizeControlSeekButtonDeselectedState: () => {
229
+ ckEditorAudioPlayerComponent.customizeControlSeekButton()
230
+ .should('have.attr', 'aria-pressed', 'false')
231
+ .within(() => {
232
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.selectedButtonIcon(), 'hidden');
233
+ });
234
+ },
235
+
236
+ verifyCustomizeControlPlayBackSpeedButtonDeselectedState: () => {
237
+ ckEditorAudioPlayerComponent.customizeControlPlayBackSpeedButton()
238
+ .should('have.attr', 'aria-pressed', 'false')
239
+ .within(() => {
240
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.selectedButtonIcon(), 'hidden');
241
+ });
242
+ },
243
+
244
+ verifyCustomizeControlAddPinButtonDeselectedState: () => {
245
+ ckEditorAudioPlayerComponent.customizeControlAddPinButton()
246
+ .should('have.attr', 'aria-pressed', 'false')
247
+ .within(() => {
248
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.selectedButtonIcon(), 'hidden');
249
+ });
250
+ },
251
+
252
+ verifyCustomizeControlForwardBackwardButtonDeselectedState: () => {
253
+ ckEditorAudioPlayerComponent.customizeControlForwardBackwardButton()
254
+ .should('have.attr', 'aria-pressed', 'false')
255
+ .within(() => {
256
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.selectedButtonIcon(), 'hidden');
257
+ });
258
+ },
259
+
260
+ verifyUnCheckAllButtonInDisabledState: () => {
261
+ ckEditorAudioPlayerComponent.unCheckAllButton()
262
+ .should('have.attr', 'disabled');
263
+ },
264
+
265
+ switchToEditTab: () => {
266
+ createQuestionBasePage.editTab()
267
+ .click()
268
+ .should('have.attr', 'aria-selected', 'true');
269
+ },
270
+
271
+ switchToPreviewTab: () => {
272
+ cy.wait(2000);
273
+ createQuestionBasePage.previewTab()
274
+ .click()
275
+ .should('have.attr', 'aria-selected', 'true');
276
+ },
277
+
278
+ seekProgressBarSliderToCenter: () => {
279
+ ckEditorAudioPlayerComponent.playbackProgressBar()
280
+ .click();
281
+ },
282
+
283
+ verifyPlaybackProgressBarSliderEnabledState: () => {
284
+ ckEditorAudioPlayerComponent.playbackSlider()
285
+ .should('be.enabled');
286
+ },
287
+
288
+ verifyPlaybackProgressBarSliderDisabledState: () => {
289
+ ckEditorAudioPlayerComponent.playbackSlider()
290
+ .should('be.disabled');
291
+ },
292
+
293
+ verifyPlaybackPlayButtonDisabledState: () => {
294
+ ckEditorAudioPlayerComponent.playbackPlayButton()
295
+ .should('be.disabled');
296
+ },
297
+
298
+ verifyPlaybackTranscriptButtonEnabledState: () => {
299
+ ckEditorAudioPlayerComponent.transcriptButton()
300
+ .should('be.enabled');
301
+ },
302
+
303
+ verifyWindowOpenMethodAfterClickingOnDownloadAudioButton: () => {
304
+ cy.window()
305
+ .then((win) => {
306
+ cy.stub(win, 'open')
307
+ .as('windowOpen')
308
+ });
309
+ ckEditorAudioPlayerComponent.playbackDownloadButton()
310
+ .click();
311
+ cy.get('@windowOpen')
312
+ .should('be.calledWith', '');
313
+ },
314
+
315
+ verifyPlaybackPauseButtonEnabledState: () => {
316
+ ckEditorAudioPlayerComponent.playbackPauseButton()
317
+ .should('be.enabled');
318
+ },
319
+
320
+ verifyPlaybackPauseButtonDisabledState: () => {
321
+ ckEditorAudioPlayerComponent.playbackPauseButton()
322
+ .should('be.disabled');
323
+ },
324
+
325
+ clearInPromptInputField: () => {
326
+ ckEditorAudioPlayerComponent.questionInstructionsInputField()
327
+ .clear();
328
+ },
329
+
330
+ focusInAndFocusOutOfPlaybackLimitInputField: () => {
331
+ ckEditorAudioPlayerComponent.playbackLimitInputField()
332
+ .click()
333
+ .blur();
334
+ },
335
+
336
+ focusInQuestionInstructionsInputField: () => {
337
+ ckEditorAudioPlayerComponent.questionInstructionsInputField()
338
+ .click();
339
+ },
340
+
341
+ focusInAndFocusOutOfQuestionInstructionsInputField: () => {
342
+ ckEditorAudioPlayerComponent.questionInstructionsInputField()
343
+ .click()
344
+ .blur();
345
+ },
346
+
347
+ focusInPromptInputField: () => {
348
+ ckEditorAudioPlayerComponent.promptInputField()
349
+ .click();
350
+ cy.scrollTo('top');
351
+ },
352
+
353
+ selectAudioPlayerOptionFromCKEditorToolbar: () => {
354
+ ckEditorAudioPlayerComponent.audioPlayerIcon()
355
+ .eq(0)
356
+ .click();
357
+ },
358
+
359
+ clickOnAudioPlayerBlock: () => {
360
+ ckEditorAudioPlayerComponent.ckEditorToolAudioPlayerBlock()
361
+ .dblclick();
362
+ },
363
+
364
+ clickOnTranscriptButton: () => {
365
+ ckEditorAudioPlayerComponent.transcriptButton()
366
+ .click();
367
+ },
368
+
369
+ closeTranscriptModal: () => {
370
+ ckEditorAudioPlayerComponent.transcriptModalCloseButton()
371
+ .click();
372
+ },
373
+
374
+ clickOnOKButton: () => {
375
+ ckEditorAudioPlayerComponent.okButton()
376
+ .click();
377
+ },
378
+
379
+ clickOnCancelButton: () => {
380
+ ckEditorAudioPlayerComponent.cancelButton()
381
+ .click();
382
+ },
383
+
384
+ clickOnAddUrlRadioButton: () => {
385
+ ckEditorAudioPlayerComponent.addUrlButton()
386
+ .click();
387
+ },
388
+
389
+ clickOnAddAudioRadioButton: () => {
390
+ ckEditorAudioPlayerComponent.addAudioButton()
391
+ .click();
392
+ },
393
+
394
+ clickOnLimitPlayAttempts: () => {
395
+ ckEditorAudioPlayerComponent.limitPlayAttempts()
396
+ .click();
397
+ },
398
+
399
+ clickOnTypeInTranscriptRadioButton: () => {
400
+ ckEditorAudioPlayerComponent.typeInTranscriptRadioButton()
401
+ .click();
402
+ },
403
+
404
+ clickOnCustomizeUIControlAccordion: () => {
405
+ ckEditorAudioPlayerComponent.customizeUIControlAccordion()
406
+ .click();
407
+ },
408
+
409
+ clickOnCustomizeControlPauseButton: () => {
410
+ ckEditorAudioPlayerComponent.customizeControlPauseButton()
411
+ .click();
412
+ },
413
+
414
+ clickOnCustomizeControlSeekButton: () => {
415
+ ckEditorAudioPlayerComponent.customizeControlSeekButton()
416
+ .click();
417
+ },
418
+
419
+ clickOnCustomizeControlPlayBackSpeedButton: () => {
420
+ ckEditorAudioPlayerComponent.customizeControlPlayBackSpeedButton()
421
+ .click();
422
+ },
423
+
424
+ clickOnCustomizeControlAddPinButton: () => {
425
+ ckEditorAudioPlayerComponent.customizeControlAddPinButton()
426
+ .click();
427
+ },
428
+
429
+ clickOnCustomizeControlForwardBackwardButton: () => {
430
+ ckEditorAudioPlayerComponent.customizeControlForwardBackwardButton()
431
+ .click();
432
+ },
433
+
434
+ clickOnCustomizeControlVolumeButton: () => {
435
+ ckEditorAudioPlayerComponent.customizeControlVolumeButton()
436
+ .click();
437
+ },
438
+
439
+ clickOnCustomizeControlTimerButton: () => {
440
+ ckEditorAudioPlayerComponent.customizeControlTimerButton()
441
+ .click();
442
+ },
443
+
444
+ clickOnCustomizeControlProgressBarButton: () => {
445
+ ckEditorAudioPlayerComponent.customizeControlProgressBarButton()
446
+ .click();
447
+ },
448
+
449
+ clickOnUnCheckAllButton: () => {
450
+ ckEditorAudioPlayerComponent.unCheckAllButton()
451
+ .click();
452
+ },
453
+
454
+ /**
455
+ * Enters text into the source URL input field on the audio player popup.
456
+ * @param {string} text - The text to be entered into the source URL input field.
457
+ * @returns {void}
458
+ */
459
+ enterTextInSourceURLInputField: (text) => {
460
+ ckEditorAudioPlayerComponent.sourceUrlInputField()
461
+ .type(text, { delay: 0 })
462
+ .blur();
463
+ },
464
+
465
+ /**
466
+ * Enters text into the transcript input field on the audio player popup.
467
+ * @param {string} text - The text to be entered into the transcript input field.
468
+ */
469
+ enterTextInTranscriptInputField: (text) => {
470
+ ckEditorAudioPlayerComponent.typeInTranscriptInputField()
471
+ .type(text, { delay: 0 })
472
+ .blur();
473
+ },
474
+
475
+ clearTextInSourceURLInputField: () => {
476
+ ckEditorAudioPlayerComponent.sourceUrlInputField()
477
+ .clear();
478
+ },
479
+
480
+ clickOnUploadAudioFileRadioButton: () => {
481
+ ckEditorAudioPlayerComponent.uploadAudioFileRadioButton()
482
+ .click();
483
+ },
484
+
485
+ startPlayback: () => {
486
+ ckEditorAudioPlayerComponent.playbackPlayButton()
487
+ .click();
488
+ },
489
+
490
+ pausePlayback: () => {
491
+ ckEditorAudioPlayerComponent.playbackPauseButton()
492
+ .click();
493
+ },
494
+
495
+ waitForPlaybackToBegin: () => {
496
+ steps.waitForAudioFileSrcToLoad();
497
+ ckEditorAudioPlayerComponent.playbackTimer()
498
+ .should('have.text', '00:01');
499
+ },
500
+
501
+ waitForAudioFileSrcToLoad: () => {
502
+ ckEditorAudioPlayerComponent.audioFileSrc()
503
+ .should('have.attr', 'src')
504
+ .and('not.be.empty');
505
+ },
506
+
507
+ /**
508
+ * Uploads a file to the audio player by attaching the file located at the specified filePath.
509
+ * @param {string} file name of the file in fixtures/upload folder
510
+ * @description this function uploads a file
511
+ */
512
+ uploadFile: (file) => {
513
+ ckEditorAudioPlayerComponent.inputTypeFile()
514
+ .attachFile(`uploads/${file}`);
515
+ },
516
+
517
+ /**
518
+ * Uploads a transcript file to the audio player by attaching the file located at the specified filePath.
519
+ * @param {string} file name of the file in fixtures/upload folder
520
+ * @description this function uploads a transcript file
521
+ */
522
+ uploadTranscriptFile: (file) => {
523
+ ckEditorAudioPlayerComponent.inputTypeTranscriptFile()
524
+ .attachFile(`uploads/${file}`);
525
+ },
526
+
527
+ /**
528
+ * Sets the playback limit value in the audio player's input field.
529
+ * @param {string|number} value - The value to set as the playback limit.
530
+ * @returns {void}
531
+ */
532
+ setPlaybackLimit: (value) => {
533
+ ckEditorAudioPlayerComponent.playbackLimitInputField()
534
+ .clear()
535
+ .type(value);
536
+ cy.wait(2000);
537
+ },
538
+
539
+ /**
540
+ * Verifies that the playback limit input field in the audio player has the expected value.
541
+ * @param {string|number} value - The expected value to be verified.
542
+ * @returns {void}
543
+ */
544
+ verifyPlaybackLimitInputFieldValue: (value) => {
545
+ ckEditorAudioPlayerComponent.playbackLimitInputField()
546
+ .should('have.attr', 'value', value);
547
+ },
548
+ }
549
+
550
+ const tests = {
551
+ ...questionInstructionsComponent.tests,
552
+ ...audioResponsePage.tests,
553
+ ...audioPlayerPage.tests,
554
+
555
+ verifyCkEditorToolHeader: (tool) => {
556
+ let selector;
557
+
558
+ if (tool == 'Audio Player') {
559
+ selector = ckEditorAudioPlayerComponent.audioPlayerIcon
560
+ } else {
561
+ return `Invalid tool: ${tool}`
562
+ }
563
+ it(`\'${tool}\' icon should be displayed in CKEditor of input field`, () => {
564
+ utilities.verifyElementVisibilityState(selector(), 'visible');
565
+ selector()
566
+ .should('have.attr', 'title', `${tool}`);
567
+ });
568
+
569
+ it(`CSS of \'${tool}\' icon`, { tags: 'css' }, () => {
570
+ utilities.verifyCSS(selector(), {
571
+ 'fill': 'rgb(0, 0, 0)',
572
+ });
573
+ });
574
+
575
+ it(`Accessibility of \'${tool}\' icon`, { tags: 'a11y' }, () => {
576
+ cy.checkAccessibility(selector());
577
+ });
578
+
579
+ it(`When user clicks on \'${tool}\' icon, \'${tool}\' popup should be displayed`, () => {
580
+ ckEditorAudioPlayerComponent.steps.selectAudioPlayerOptionFromCKEditorToolbar();
581
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.ckEditorToolDialogBox(), 'visible');
582
+ utilities.verifyInnerText(ckEditorAudioPlayerComponent.ckEditorToolDialogBoxTitle(), 'Audio player');
583
+ });
584
+
585
+ it(`\'${tool}\' label should be displayed in popup header along with cross icon.`, () => {
586
+ utilities.verifyInnerText(ckEditorAudioPlayerComponent.ckEditorToolDialogBoxTitle(), 'Audio player');
587
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.ckEditorToolDialogBoxTitle(), 'visible');
588
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.ckEditorToolDialogBoxCloseIcon(), 'visible');
589
+ });
590
+
591
+ it(`CSS of \'${tool}\' label`, { tags: 'css' }, () => {
592
+ utilities.verifyCSS(ckEditorAudioPlayerComponent.ckEditorToolDialogBoxTitle().find('.dialog-title-wrapper'), {
593
+ 'color': 'rgb(72, 72, 72)',
594
+ 'font-size': '12px',
595
+ 'font-weight': '700'
596
+ });
597
+ });
598
+
599
+ it(`Accessibility of \'${tool}\' Popup`, { tags: 'a11y' }, () => {
600
+ cy.checkAccessibility(ckEditorAudioPlayerComponent.ckEditorToolDialogBox());
601
+ });
602
+
603
+ it(`When user clicks on cross icon present in popup, \'${tool}\' popup should close.`, () => {
604
+ ckEditorAudioPlayerComponent.ckEditorToolDialogBoxCloseIcon()
605
+ .click();
606
+ utilities.verifyElementVisibilityState(ckEditorAudioPlayerComponent.ckEditorToolDialogBox(), 'notExist');
607
+ });
608
+ }
609
+ }
610
+
611
+ export const ckEditorAudioPlayerComponent = {
612
+ ...selectors,
613
+ steps,
614
+ tests
615
+ }
@@ -0,0 +1,41 @@
1
+ import { dialogBoxBase } from "../dialogBoxBase";
2
+ import { createQuestionBasePage } from "../components/createQuestionBasePage.js";
3
+ const css = Cypress.env('css');
4
+
5
+ const selectors = {
6
+ ...createQuestionBasePage,
7
+ ...dialogBoxBase,
8
+ //Basic
9
+ equationEditorIcon: () => cy.get('.cke_button__nextgeneqneditor_icon'),
10
+ equationEditorLabel: () => cy.get('[class*="EquationEditorstyles__Heading"]'),
11
+ buttonOk: () => cy.get('.ok-btn'),
12
+ buttonCancel: () => cy.get('.cancel-btn'),
13
+ //Aria Label
14
+ ariaLabelText: () => cy.get('[class*="EquationEditorstyles__AriaLabelText"]').eq(1),
15
+ chevronDownIcon: () => cy.get('[class*="EquationEditorstyles__ChevronDownIconWrapper"]'),
16
+ //Select Mode
17
+ selectModeLabel: () => cy.get('[class*="EquationEditorstyles__SelectModeLabel"]'),
18
+ editorButton: () => cy.get('[aria-label="Editor"]'),
19
+ editorLabel: () => cy.get('[class*="EquationEditorstyles__RadioButtonLabel"]').eq(0),
20
+ latexCodeButton: () => cy.get('[aria-label="LaTex code"]'),
21
+ latexCodeLabel: () => cy.get('[class*="EquationEditorstyles__RadioButtonLabel"]').eq(1),
22
+ mathMLButton: () => cy.get('[aria-label="MathML"]'),
23
+ mathMLLabel: () => cy.get('[class*="EquationEditorstyles__RadioButtonLabel"]').eq(2),
24
+ }
25
+
26
+ const steps = {
27
+ selectEquationEditorOptionFromCKEditorToolbar: () => {
28
+ ckEditorEquationEditorComponent.equationEditorIcon()
29
+ .eq(0)
30
+ .click();
31
+ },
32
+ }
33
+
34
+ const tests = {
35
+ }
36
+
37
+ export const ckEditorEquationEditorComponent = {
38
+ ...selectors,
39
+ steps,
40
+ tests
41
+ }