itemengine-cypress-automation 1.0.104 → 1.0.106

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) 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/deploy/smoke/run.sh +1 -1
  86. package/package.json +1 -1
  87. package/scripts/sorry-cypress.mjs +1 -1
@@ -52,4 +52,5 @@ export * from './enableOuterBorderComponent';
52
52
  export * from './customizeSpecialCharacterComponent';
53
53
  export * from './opacityComponent';
54
54
  export * from './imageActionsComponent';
55
- export * from './createCustomCategoryFlyout'
55
+ export * from './createCustomCategoryFlyout';
56
+ export * from './customizeMathCharacterComponent';
@@ -1,12 +1,25 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ import { commonComponents } from "./commonComponents";
3
+ const css = Cypress.env('css');
4
+
1
5
  const selectors = {
2
6
  volumeControlButton: () => cy.get('.audio-player-icon'),
3
7
  volumeControlSlider: () => cy.get('.audio-volume-control-slider'),
4
8
  muteVolumeIcon: () => cy.get('.audio-mute-icon-wr'),
5
9
  unmutedVolumeIcon: () => cy.get('.audio-volume-icon-wr'),
6
- progressBar: () => cy.get('.progress-bar-wrapper'),
10
+ progressBar: () => cy.get('[class*="progress-bar-wrapper"]'),
7
11
  progressBarSlider: () => cy.get('input[aria-label="Slider bar"]'),
8
12
  playbackPlayButton: () => cy.get('button[aria-label="Play"]'),
9
13
  playbackPauseButton: () => cy.get('button[aria-label="Pause"]'),
14
+ playbackSpeedButton: () => cy.get('.playback-speed-button'),
15
+ playbackSpeedOptionsList: () => cy.get('.playback-speed-menu-list'),
16
+ playbackSpeedOption: (ariaLabel = null) => {
17
+ if (ariaLabel) {
18
+ return cy.get(`.speed-option[aria-label*="${ariaLabel}"]`)
19
+ } else {
20
+ return cy.get('.speed-option')
21
+ }
22
+ },
10
23
  }
11
24
 
12
25
  const steps = {
@@ -155,9 +168,131 @@ const steps = {
155
168
  playbackControlsBaseComponent.playbackPauseButton()
156
169
  .should('be.disabled');
157
170
  },
171
+
172
+ verifyPlaybackSpeedListOptions: () => {
173
+ const playbackSpeedOptions = ['1x', '1.25x', '1.5x', '2x'];
174
+ playbackSpeedOptions.forEach((option, optionIndex) => {
175
+ utilities.verifyInnerText(utilities.getNthElement(playbackControlsBaseComponent.playbackSpeedOption(), optionIndex), option);
176
+ });
177
+ },
178
+
179
+ /**
180
+ * Verifies the selected state of the playback speed option.
181
+ * @param {string} speed - The playback speed option to verify.
182
+ * @returns {void}
183
+ */
184
+ verifyPlaybackSpeedOptionSelectedState: (speed) => {
185
+ playbackControlsBaseComponent.playbackSpeedOption(speed)
186
+ .should('have.class', 'selected-speed-option')
187
+ },
188
+
189
+ /**
190
+ * @description Selects a playback speed option for the video player.
191
+ * @param {string} playbackSpeed - The desired playback speed to be selected from "1x", "1.25x" "1.5x", "2x".
192
+ * @throws {Error} Throws an error if the specified playback speed option is not found.
193
+ */
194
+ selectPlaybackSpeed: (playbackSpeed) => {
195
+ playbackControlsBaseComponent.playbackSpeedOption(playbackSpeed)
196
+ .click();
197
+ },
198
+ }
199
+
200
+ const tests = {
201
+ verifyVolumeControlFunctionality: () => {
202
+ it('When the user hovers over \'Volume control\' button, volume control settings should open and by default it should be set to full volume and on hovering away from the button, the volume slider should disappear', () => {
203
+ playbackControlsBaseComponent.steps.hoverOnVolumeControlButton();
204
+ utilities.verifyElementVisibilityState(playbackControlsBaseComponent.volumeControlSlider(), 'visible');
205
+ playbackControlsBaseComponent.steps.verifyVolumeOfPlaybackPlayer('100');
206
+ utilities.hoverAwayFromElement();
207
+ utilities.verifyElementVisibilityState(playbackControlsBaseComponent.volumeControlSlider(), 'notExist');
208
+ });
209
+
210
+ it('When volume is not set as 0 and user clicks on volume control button, then the audio should be muted and the volume control button should change to a muted state', () => {
211
+ playbackControlsBaseComponent.steps.clickOnVolumeButton();
212
+ playbackControlsBaseComponent.steps.hoverOnVolumeControlButton();
213
+ playbackControlsBaseComponent.steps.verifyVolumeOfPlaybackPlayer('0');
214
+ utilities.hoverAwayFromElement();
215
+ utilities.verifyElementVisibilityState(playbackControlsBaseComponent.volumeControlSlider(), 'notExist');
216
+ utilities.verifyElementVisibilityState(playbackControlsBaseComponent.muteVolumeIcon(), 'visible');
217
+ playbackControlsBaseComponent.steps.focusOutFromVolumeControlButton();
218
+ });
219
+
220
+ it('When the user clicks on the muted volume control button then the volume setting slider should return to full volume and the volume control button should change to an unmuted state', () => {
221
+ playbackControlsBaseComponent.steps.clickOnVolumeButton();
222
+ playbackControlsBaseComponent.steps.hoverOnVolumeControlButton();
223
+ playbackControlsBaseComponent.steps.verifyVolumeOfPlaybackPlayer('100');
224
+ utilities.verifyElementVisibilityState(playbackControlsBaseComponent.unmutedVolumeIcon(), 'visible');
225
+ });
226
+
227
+ it('CSS of volume control section', { tags: 'css' }, () => {
228
+ utilities.verifyCSS(playbackControlsBaseComponent.volumeControlSlider(), {
229
+ 'background': `${css.color.transparent} linear-gradient(to right, ${css.color.activeButtons} 0%, ${css.color.activeButtons} 100%, ${css.color.defaultBackground} 0%, ${css.color.defaultBackground} 100%) repeat scroll 0% 0% / auto padding-box border-box`
230
+ });
231
+ utilities.verifyCSS(playbackControlsBaseComponent.volumeControlButton().find('[data-name="minimal-volume-icon"]'), {
232
+ 'fill': css.color.activeButtons
233
+ });
234
+ });
235
+
236
+ it('When the user drags the volume control all the way down, audio should be muted and the button should update to a muted state', () => {
237
+ playbackControlsBaseComponent.steps.setVolumeSliderForPlayback(0);
238
+ playbackControlsBaseComponent.steps.verifyVolumeOfPlaybackPlayer('0');
239
+ utilities.verifyElementVisibilityState(playbackControlsBaseComponent.muteVolumeIcon(), 'visible');
240
+ });
241
+
242
+ it('CSS of volume control section in muted state', { tags: 'css' }, () => {
243
+ utilities.verifyCSS(playbackControlsBaseComponent.volumeControlSlider(), {
244
+ 'background': `${css.color.transparent} linear-gradient(to right, ${css.color.activeButtons} 0%, ${css.color.activeButtons} 0%, ${css.color.defaultBackground} -100%, ${css.color.defaultBackground} 100%) repeat scroll 0% 0% / auto padding-box border-box`
245
+ });
246
+ utilities.verifyCSS(playbackControlsBaseComponent.muteVolumeIcon().find('[id="eye-slash"]'), {
247
+ 'stroke': css.color.activeButtons
248
+ });
249
+ });
250
+
251
+ it('Accessibility of playback player - in muted state', { tags: 'a11y' }, () => {
252
+ cy.checkAccessibility(commonComponents.previewTabQuestionWrapper());
253
+ });
254
+
255
+ it('User should be able to unmute the audio by dragging the volume control higher again', () => {
256
+ playbackControlsBaseComponent.steps.setVolumeSliderForPlayback(99);
257
+ playbackControlsBaseComponent.steps.verifyVolumeOfPlaybackPlayer('100');
258
+ utilities.verifyElementVisibilityState(playbackControlsBaseComponent.unmutedVolumeIcon(), 'visible');
259
+ });
260
+ },
261
+
262
+ verifyPlaybackSpeedContents: () => {
263
+ it('When the user hovers overs the playback button, a list of 4 playback speed options - 1x, 1.25x, 1.5x, 2x should be displayed and by default 1x should be in selected state', () => {
264
+ utilities.hoverOverElement(playbackControlsBaseComponent.playbackSpeedButton());
265
+ utilities.verifyElementVisibilityState(playbackControlsBaseComponent.playbackSpeedOptionsList(), 'visible');
266
+ utilities.verifyElementCount(playbackControlsBaseComponent.playbackSpeedOption(), 4);
267
+ playbackControlsBaseComponent.steps.verifyPlaybackSpeedListOptions();
268
+ playbackControlsBaseComponent.steps.verifyPlaybackSpeedOptionSelectedState('1x');
269
+ });
270
+
271
+ it('CSS of playback speed options', { tags: 'css' }, () => {
272
+ utilities.verifyCSS(playbackControlsBaseComponent.playbackSpeedButton().find('[id="playback-speed"] path'), {
273
+ 'fill': css.color.activeButtons
274
+ });
275
+ utilities.verifyCSS(utilities.getNthElement(playbackControlsBaseComponent.playbackSpeedOption(), 0), {
276
+ 'color': css.color.liText,
277
+ 'background-color': css.color.liTextSelectedBg,
278
+ 'font-size': css.fontSize.small
279
+ });
280
+ utilities.verifyCSS(utilities.getNthElement(playbackControlsBaseComponent.playbackSpeedOption(), 1), {
281
+ 'color': css.color.liText,
282
+ 'background-color': css.color.defaultBackground,
283
+ 'font-size': css.fontSize.small
284
+ });
285
+ });
286
+
287
+ it('Accessibility of playback speed options', { tags: 'a11y' }, () => {
288
+ cy.checkAccessibility(commonComponents.previewTabQuestionWrapper());
289
+ utilities.hoverAwayFromElement();
290
+ });
291
+ }
158
292
  }
159
293
 
160
294
  export const playbackControlsBaseComponent = {
161
295
  ...selectors,
162
- steps
296
+ steps,
297
+ tests
163
298
  }
@@ -15,7 +15,18 @@ const steps = {
15
15
  utilities.verifyTextContent(correctAnswerViewPage.availablePoints(), `${availablePoints} Points`);
16
16
  },
17
17
  }
18
+
19
+ const tests = {
20
+ verifyManualScoredQuestionHelpTextCorrectAnswerPage: () => {
21
+ it('\'This is a manual scored question\' help text should be displayed in the correct answer view', () => {
22
+ utilities.verifyTextContent(correctAnswerViewPage.manualScoredQuestionHelpText(), 'This is a manual scored question.');
23
+ utilities.verifyElementVisibilityState(correctAnswerViewPage.manualScoredQuestionHelpText(), 'visible');
24
+ });
25
+ }
26
+ }
27
+
18
28
  export const correctAnswerViewPage = {
19
29
  ...selectors,
20
- steps
30
+ steps,
31
+ tests
21
32
  }
@@ -1,5 +1,5 @@
1
1
  import utilities from "../support/helpers/utilities"
2
- import { questionInstructionsComponent, createQuestionBasePage, commonComponents, additionalSettingsPanel, scoringSectionBaseEditTab, customizeSpecialCharacterComponent } from "./components"
2
+ import { questionInstructionsComponent, createQuestionBasePage, commonComponents, additionalSettingsPanel, scoringSectionBaseEditTab, customizeSpecialCharacterComponent, customizeMathCharacterComponent } from "./components"
3
3
  import { dialogBoxBase } from "./dialogBoxBase";
4
4
 
5
5
  const css = Cypress.env('css');
@@ -13,6 +13,7 @@ const selectors = {
13
13
  ...scoringSectionBaseEditTab,
14
14
  ...createQuestionBasePage,
15
15
  ...customizeSpecialCharacterComponent,
16
+ ...customizeMathCharacterComponent,
16
17
  //Customize toolbar options and controls
17
18
  customizeToolbarOptionsAndControlsAccordion: () => cy.get('.drawing-response-accordion .ngie-accordion-summary'),
18
19
  customizeToolbarOptionsAndControlsLabel: () => cy.get('.customized-options-label'),
@@ -26,6 +27,7 @@ const selectors = {
26
27
  toolBarOptionsLabel: () => cy.get('[class*="ToolbarLabel"]').eq(0),
27
28
  controlsLabel: () => cy.get('[class*="ToolbarLabel"]').eq(1),
28
29
  customizeToolbarOptionsAndControlsSectionTickIcon: () => cy.get('.tick-icon-wrapper'),
30
+ mathCharactersPopupCategoryTitle: () => cy.get('[class*="characters__container"] [class*="options__characters__title"]'),
29
31
 
30
32
  //Additional options
31
33
  additionalOptionsLabel: () => cy.get('[class*="CustomizedAdditionalOptionsLabel"]'),
@@ -47,34 +49,6 @@ const selectors = {
47
49
  defaultFillColorsLabel: () => cy.get('[class*="ColorSelectionComponentstyles__LabelWrapper"]').eq(1),
48
50
  defaultFillColorsWrapper: () => cy.get('[class*="ColorSelectionComponentstyles__DefaultColorOptions"]').eq(1),
49
51
 
50
- //Customize special characters
51
- customizeSpecialCharactersCheckbox: () => cy.get('[data-ngie-testid="customize-special-characters-checkbox"] .ngie-checkbox input'),
52
- customizeSpecialCharactersLabel: () => cy.get('[data-ngie-testid="customize-special-characters-checkbox"] [class*="label"]'),
53
- mathCharactersCategoryTilesWrapper: () => cy.get('[class*="CustomizedSpecialCharacterstyles__DragAndDropWrapper"]'),
54
- mathCharacterTiles: (mathCharacterCategory = null) => {
55
- if (mathCharacterCategory) {
56
- return cy.get(`[id*="DraggableItem"] button[aria-label="${mathCharacterCategory}"]`)
57
- } else {
58
- return cy.get('[id*="DraggableItem"] button')
59
- }
60
- },
61
- mathCharacterTileIcon: () => cy.get('.equation-editor-icon'),
62
- mathCharacterTileCategoryName: () => cy.get('.equation-editor-label-wrapper'),
63
- mathCharacterTileSectionCategoriesDragIcon: () => cy.get('.drag-icon-equation-editor-button'),
64
-
65
- //Customize math characters
66
- customizeMathCharactersCheckbox: () => cy.get('[data-ngie-testid="customize-math-characters-checkbox"] .ngie-checkbox input'),
67
- customizeMathCharactersLabel: () => cy.get('[data-ngie-testid="customize-math-characters-checkbox"] [class*="label"]'),
68
- selectMathCharacterCategoryLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__SpecialCharLabel"]'),
69
- customizeMathCharactersPreviewButton: () => cy.get('[class*="CustomizedSpecialCharacterstyles__PreviewLabel"]'),
70
-
71
- //Preview popup
72
- mathCharactersPreviewPopupSymbol: () => cy.get('[class*="CustomizedSpecialCharacterstyles__CharacterWrapper"]'),
73
-
74
- //Math characters preview popup
75
- mathCharactersPreviewPopupCharactersCategoryWrapper: () => cy.get('[class*="CustomizedSpecialCharacterstyles__AccordionWrapper"]'),
76
- mathCharactersPreviewPopupCategoryLabel: () => cy.get('[class*="CustomizedMathCharacterstyles__PopupTitle"]'),
77
-
78
52
  //Preview tab
79
53
  previewTabDrawingToolbarWrapper: () => cy.get('.edit-question-preview-wrapper .drawing-tool__toolbar'),
80
54
  previewTabDrawingToolbarOption: (drawingOption = null) => {
@@ -215,9 +189,6 @@ const selectors = {
215
189
  spellCheckCheckBoxLabel: () => cy.get('[data-ngie-testid="spell-check-checkbox"]'),
216
190
  spellCheckCheckBox: () => cy.get('[data-ngie-testid="spell-check-checkbox"] input'),
217
191
 
218
- //Math characters popup
219
- mathCharactersPopupCategoryTitle: () => cy.get('[class*="characters__container"] [class*="options__characters__title"]'),
220
-
221
192
  //TODO: Shift all preview tab special characters popup related selectors/steps to a common component file once https://redmine.zeuslearning.com/issues/559296 is resolved
222
193
  //Special characters popup
223
194
  specialCharactersPopupCategoryTitle: () => cy.get('[class*="characters__container"] [class*="options__accordion__header"]'),
@@ -251,6 +222,7 @@ const steps = {
251
222
  ...createQuestionBasePage.steps,
252
223
  ...commonComponents.steps,
253
224
  ...customizeSpecialCharacterComponent.steps,
225
+ ...customizeMathCharacterComponent.steps,
254
226
  /**
255
227
  * @param {string[]} arrayOfToolbarOptions array of toolbar options to be selected
256
228
  * @description this function selects toolbar options from edit tab
@@ -668,26 +640,6 @@ const steps = {
668
640
  });
669
641
  },
670
642
 
671
- /**
672
- * @description Verify categories and symbols displayed in math characters popup
673
- * @param {object[]} categoryAndSymbolsArray Array of list of categories and their symbols present in math characters popup
674
- */
675
- verifyMathCharactersPopupCategoriesAndSymbols: (categoryAndSymbolsArray) => {
676
- categoryAndSymbolsArray.forEach((category, index) => {
677
- utilities.verifyInnerText(drawingResponsePage.mathCharactersPopupCategoryTitle().eq(index), `${category.categoryName}`);
678
- drawingResponsePage.charactersPopupCharactersCategoryWrapper()
679
- .eq(index)
680
- .within(() => {
681
- categoryAndSymbolsArray[index].symbols.forEach((symbol, index) => {
682
- drawingResponsePage.charactersPopupCharacterSymbol()
683
- .eq(index)
684
- .find('svg')
685
- .should('have.attr', 'aria-label', `${symbol}`);
686
- });
687
- });
688
- });
689
- },
690
-
691
643
  /**
692
644
  * @description Verify symbols displayed in for a category in special characters popup
693
645
  * @param {number} categoryIndex Index of the category
@@ -758,92 +710,6 @@ const steps = {
758
710
  utilities.verifyElementVisibilityState(drawingResponsePage.charactersPopupCharactersCategoryWrapper().eq(index), 'notExist');
759
711
  },
760
712
 
761
- checkCustomizeSpecialCharactersCheckbox: () => {
762
- drawingResponsePage.customizeSpecialCharactersCheckbox()
763
- .click()
764
- .should('be.checked');
765
- },
766
-
767
- checkCustomizeMathCharactersCheckbox: () => {
768
- drawingResponsePage.customizeMathCharactersCheckbox()
769
- .click()
770
- .should('be.checked');
771
- },
772
-
773
- /**
774
- * @description Verify customized math character category tiles in edit tab
775
- * @param {string[]} charactersCategoriesArray Array of math character categories
776
- */
777
- verifyCustomizeMathCharactersCategoryTiles: (charactersCategoriesArray) => {
778
- drawingResponsePage.mathCharactersCategoryTilesWrapper()
779
- .within(() => {
780
- charactersCategoriesArray.forEach((characterCategory, index) => {
781
- drawingResponsePage.mathCharacterTiles()
782
- .eq(index)
783
- .should('have.attr', 'aria-label', `${characterCategory}`);
784
- });
785
- });
786
- utilities.verifyElementCount(drawingResponsePage.mathCharacterTiles(), charactersCategoriesArray.length);
787
- },
788
-
789
- /**
790
- * @description Verify selected math characters category tiles
791
- * @param {string[]} selectedMathCharactersCategoriesArray Array of selected math characters categories
792
- */
793
- verifySelectedCustomizeMathCharactersCategoryTiles: (selectedMathCharactersCategoriesArray) => {
794
- drawingResponsePage.mathCharactersCategoryTilesWrapper()
795
- .within(() => {
796
- selectedMathCharactersCategoriesArray.forEach((characterCategory) => {
797
- drawingResponsePage.mathCharacterTiles(characterCategory)
798
- .should('have.class', 'Mui-selected')
799
- .within(() => {
800
- utilities.verifyElementVisibilityState(drawingResponsePage.customizeToolbarOptionsAndControlsSectionTickIcon(), 'visible');
801
- });
802
- });
803
- });
804
- },
805
-
806
- clickOnCustomizeMathCharactersPreviewButton: () => {
807
- drawingResponsePage.customizeMathCharactersPreviewButton()
808
- .click();
809
- },
810
-
811
- /**
812
- * @description Verify math characters categories and symbols in preview tab
813
- * @param {object[]} categoryAndSymbolsArray Array of math characters categories and symbols
814
- */
815
- verifyMathCharactersPreviewPopupInEditTab: (categoryAndSymbolsArray) => {
816
- categoryAndSymbolsArray.forEach((category, index) => {
817
- utilities.verifyInnerText(drawingResponsePage.mathCharactersPreviewPopupCategoryLabel().eq(index), `${category.categoryName}`);
818
- drawingResponsePage.mathCharactersPreviewPopupCharactersCategoryWrapper()
819
- .eq(index)
820
- .within(() => {
821
- category.symbols.forEach((symbol, index) => {
822
- utilities.verifyElementVisibilityState(drawingResponsePage.mathCharactersPreviewPopupSymbol().eq(index), 'visible');
823
- drawingResponsePage.mathCharactersPreviewPopupSymbol()
824
- .eq(index)
825
- .find('path')
826
- .should('have.attr', 'data-name', `${symbol}`);
827
- });
828
- utilities.verifyElementCount(drawingResponsePage.mathCharactersPreviewPopupSymbol(), category.symbols.length);
829
- });
830
- });
831
- utilities.verifyElementCount(drawingResponsePage.mathCharactersPreviewPopupCharactersCategoryWrapper(), categoryAndSymbolsArray.length);
832
- },
833
-
834
- clickOnMathCharactersCategoryTile: (categoryName) => {
835
- drawingResponsePage.mathCharacterTiles(categoryName)
836
- .click();
837
- },
838
-
839
- verifyMathCharacterCategoryTileIsNotSelected: (categoryName) => {
840
- drawingResponsePage.mathCharacterTiles(categoryName)
841
- .should('have.attr', 'data-aria-pressed', 'false')
842
- .within(() => {
843
- utilities.verifyElementVisibilityState(drawingResponsePage.customizeToolbarOptionsAndControlsSectionTickIcon(), 'hidden');
844
- });
845
- },
846
-
847
713
  verifyPatternRadioButtonIsNotSelected: () => {
848
714
  drawingResponsePage.patternRadioButton()
849
715
  .should('not.be.checked');
@@ -855,18 +721,6 @@ const steps = {
855
721
  .should('be.checked');
856
722
  },
857
723
 
858
- /**
859
- * Verify custom special characters displayed in characters popup in preview tab
860
- * @param {string[]} customSpecialCharacters Array of custom special characters
861
- */
862
- verifyCustomSpecialCharactersDisplayedInPreviewTab: (customSpecialCharacters) => {
863
- customSpecialCharacters.forEach((customSpecialCharacter, index) => {
864
- utilities.verifyInnerText(drawingResponsePage.charactersPopupCharacterSymbol().eq(index), `${customSpecialCharacter}`);
865
- utilities.verifyElementVisibilityState(drawingResponsePage.charactersPopupCharacterSymbol().eq(index), 'visible');
866
- });
867
- utilities.verifyElementCount(drawingResponsePage.charactersPopupCharacterSymbol(), `${customSpecialCharacters.length}`);
868
- },
869
-
870
724
  clickInOpacityPalette: () => {
871
725
  drawingResponsePage.editTabColorPickerPopupOpacityPalette()
872
726
  .click();
@@ -1320,7 +1174,27 @@ const steps = {
1320
1174
  verifyToolbarAndControlsOptionsSelectedState: (toolbarAndControlOption) => {
1321
1175
  drawingResponsePage.toolbarOptionsAndControlsFormattingOptionsTiles(toolbarAndControlOption)
1322
1176
  .should('have.class', 'Mui-selected');
1323
- }
1177
+ },
1178
+
1179
+ /**
1180
+ * @description Verify categories and symbols displayed in math characters popup
1181
+ * @param {object[]} categoryAndSymbolsArray Array of list of categories and their symbols present in math characters popup
1182
+ */
1183
+ verifyMathCharactersPopupCategoriesAndSymbols: (categoryAndSymbolsArray) => {
1184
+ categoryAndSymbolsArray.forEach((category, index) => {
1185
+ utilities.verifyInnerText(drawingResponsePage.mathCharactersPopupCategoryTitle().eq(index), `${category.categoryName}`);
1186
+ drawingResponsePage.charactersPopupCharactersCategoryWrapper()
1187
+ .eq(index)
1188
+ .within(() => {
1189
+ categoryAndSymbolsArray[index].symbols.forEach((symbol, index) => {
1190
+ drawingResponsePage.charactersPopupCharacterSymbol()
1191
+ .eq(index)
1192
+ .find('svg')
1193
+ .should('have.attr', 'aria-label', `${symbol}`);
1194
+ });
1195
+ });
1196
+ });
1197
+ },
1324
1198
  }
1325
1199
 
1326
1200
  const tests = {
@@ -1330,6 +1204,7 @@ const tests = {
1330
1204
  ...questionInstructionsComponent.tests,
1331
1205
  ...scoringSectionBaseEditTab.tests,
1332
1206
  ...createQuestionBasePage.tests,
1207
+ ...customizeSpecialCharacterComponent.tests,
1333
1208
 
1334
1209
  checkAccessibilityForSecondaryToolbarOptionPopup: () => {
1335
1210
  it('Accessibility of popup', { tags: 'a11y' }, () => {
@@ -1,5 +1,6 @@
1
- import { questionInstructionsComponent, scoringSectionBase, createQuestionBasePage, additionalSettingsPanel, essayResponseCommonComponents } from "./components";
1
+ import { questionInstructionsComponent, scoringSectionBase, createQuestionBasePage, additionalSettingsPanel, essayResponseCommonComponents, customizeMathCharacterComponent } from "./components";
2
2
  import { essayResponsePage } from ".";
3
+ import utilities from "../support/helpers/utilities";
3
4
 
4
5
  const selectors = {
5
6
  ...scoringSectionBase,
@@ -8,13 +9,10 @@ const selectors = {
8
9
  ...questionInstructionsComponent,
9
10
  ...essayResponsePage,
10
11
  ...essayResponseCommonComponents,
11
- textToNotBeRenderedAsLaTexLabel: () => cy.get('.text-not-latex-wrapper .text-label'),
12
- textToNotBeRenderedAsLaTextInputFieldWrapper: (inputfieldNumber) => cy.get('.text-not-to-be-rendered-input').eq(inputfieldNumber),
13
- textToNotBeRenderedAsLaTextInputField: () => cy.get('[aria-label="Text to not be rendered as LaTex"]'),
14
- textToNotBeRenderedAsLaTextInputFieldCount: () => cy.get('.start-adornment'),
15
- addTextButton: () => cy.get('.text-not-latex-wrapper .ngie-icon-with-label-btn'),
16
- inputFieldLatexCharacter: () => cy.get('var[mathquill-command-id]'),
17
- deleteButton: () => cy.get('.icon-button-wrapper button')
12
+ ...customizeMathCharacterComponent,
13
+ mathCharactersPopupCategoryTitle: () => cy.get('.math-char-popup-title'),
14
+ mathCharactersPopupCharactersCategoryWrapper: () => cy.get('.special-math-accordion'),
15
+ mathCharactersPopupCharacterSymbol: () => cy.get('.characters-button')
18
16
  }
19
17
 
20
18
  const steps = {
@@ -24,14 +22,28 @@ const steps = {
24
22
  ...additionalSettingsPanel.steps,
25
23
  ...essayResponsePage.steps,
26
24
  ...essayResponseCommonComponents.steps,
27
- addTextToNotBeRenderedAsLatexEditTab: (inputFieldIndex, textContent) => {
28
- essayResponseMathPage.textToNotBeRenderedAsLaTextInputFieldWrapper(inputFieldIndex)
29
- .within(() => {
30
- essayResponseMathPage.textToNotBeRenderedAsLaTextInputField()
31
- .type(textContent)
32
- .should('have.value', textContent);
33
- });
34
- }
25
+ ...customizeMathCharacterComponent.steps,
26
+
27
+ /**
28
+ * @description Verify categories and symbols displayed in math characters popup
29
+ * @param {object[]} categoryAndSymbolsArray Array of list of categories and their symbols present in math characters popup
30
+ */
31
+ //Failing due to https://redmine.zeuslearning.com/issues/561285
32
+ verifyMathCharactersPopupCategoriesAndSymbols: (categoryAndSymbolsArray) => {
33
+ categoryAndSymbolsArray.forEach((category, index) => {
34
+ utilities.verifyInnerText(essayResponseMathPage.mathCharactersPopupCategoryTitle().eq(index), `${category.categoryName}`);
35
+ essayResponseMathPage.mathCharactersPopupCharactersCategoryWrapper()
36
+ .eq(index)
37
+ .within(() => {
38
+ categoryAndSymbolsArray[index].symbols.forEach((symbol, index) => {
39
+ essayResponseMathPage.mathCharactersPopupCharacterSymbol()
40
+ .eq(index)
41
+ .find('svg')
42
+ .should('have.attr', 'aria-label', `${symbol}`);
43
+ });
44
+ });
45
+ });
46
+ },
35
47
  }
36
48
 
37
49
  const tests = {