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
@@ -1,4 +1,8 @@
1
1
  import utilities from "../../support/helpers/utilities";
2
+ import { dialogBoxBase } from "../dialogBoxBase";
3
+ import { commonComponents } from "./commonComponents";
4
+ import { figOverImageCanvasComponent } from "./figOverImageCanvasComponent";
5
+ const css = Cypress.env('css');
2
6
 
3
7
  const selectors = {
4
8
  backgroundImageLabel: () => cy.get('[class*="Background"][class*="LabelWrapper"]'),
@@ -10,7 +14,9 @@ const selectors = {
10
14
  noFileChosenLabel: () => cy.get('[aria-label="No file chosen"]'),
11
15
  uploadImageProgressBar: () => cy.get('[class*="ProgressBar"]'),
12
16
  uploadedFileNameLabel: () => cy.get('[class*="UploadImagestyles__SelectedFileWithIcon"]'),
13
- deleteImageIcon: () => cy.get('[aria-label="Delete image"]')
17
+ deleteImageIcon: () => cy.get('[aria-label="Delete image"]'),
18
+ deleteImagePopupButtonCancel: () => cy.get('.delete-action-btn-wrapper button').eq(0),
19
+ deleteImagePopupButtonDelete: () => cy.get('.delete-action-btn-wrapper button').eq(1)
14
20
  }
15
21
 
16
22
  const steps = {
@@ -35,10 +41,164 @@ const steps = {
35
41
  verifyFileNameLabel: (fileName) => {
36
42
  utilities.verifyInnerText(backgroundImageUploadComponent.uploadedFileNameLabel(), fileName);
37
43
  utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadedFileNameLabel(), 'visible');
44
+ },
45
+
46
+ clickOnDeleteButtonInDeleteImagePopup: () => {
47
+ backgroundImageUploadComponent.deleteImagePopupButtonDelete()
48
+ .click();
49
+ dialogBoxBase.dialogBox()
50
+ .should('not.exist');
51
+ },
52
+
53
+ clickOnCancelButtonInDeleteImagePopup: () => {
54
+ backgroundImageUploadComponent.deleteImagePopupButtonCancel()
55
+ .click();
56
+ dialogBoxBase.dialogBox()
57
+ .should('not.exist');
58
+ },
59
+ }
60
+
61
+ const tests = {
62
+ verifyBackgroundImageSectionContentWithCSSAndA11y: () => {
63
+ it('\'Background image\' label should be visible', () => {
64
+ utilities.verifyInnerText(backgroundImageUploadComponent.backgroundImageLabel(), 'Background image');
65
+ })
66
+
67
+ it('\'Upload\' label and \'Choose file\' button should be displayed', () => {
68
+ utilities.verifyInnerText(backgroundImageUploadComponent.uploadLabel(), 'Upload');
69
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadLabel(), 'visible');
70
+ utilities.verifyInnerText(backgroundImageUploadComponent.chooseFileButton(), 'Choose file');
71
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.chooseFileButton(), 'visible');
72
+ });
73
+
74
+ it('\'File name\' label should be displayed and by default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
75
+ utilities.verifyInnerText(backgroundImageUploadComponent.fileNameLabel(), 'File name');
76
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.fileNameLabel(), 'visible');
77
+ utilities.verifyInnerText(backgroundImageUploadComponent.noFileChosenLabel(), 'No file chosen');
78
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.noFileChosenLabel(), 'visible');
79
+ });
80
+
81
+ it('CSS of upload section', { tags: 'css' }, () => {
82
+ utilities.verifyCSS(backgroundImageUploadComponent.uploadLabel(), {
83
+ 'color': css.color.labels,
84
+ 'font-size': css.fontSize.normal,
85
+ 'font-weight': css.fontWeight.semibold
86
+ });
87
+ utilities.verifyCSS(backgroundImageUploadComponent.chooseFileButton(), {
88
+ 'color': css.color.secondaryBtn,
89
+ 'font-size': css.fontSize.default,
90
+ 'font-weight': css.fontWeight.regular,
91
+ 'border-bottom-color': css.color.titleContainerBorder
92
+ });
93
+ utilities.verifyCSS(backgroundImageUploadComponent.fileNameLabel(), {
94
+ 'color': css.color.labels,
95
+ 'font-size': css.fontSize.normal,
96
+ 'font-weight': css.fontWeight.semibold
97
+ });
98
+ utilities.verifyCSS(backgroundImageUploadComponent.noFileChosenLabel(), {
99
+ 'color': css.color.panelLabel,
100
+ 'font-size': css.fontSize.default,
101
+ 'font-weight': css.fontWeight.regular
102
+ });
103
+ });
104
+
105
+ it('Accessibility of Upload section before uploading image', { tags: 'a11y' }, () => {
106
+ cy.checkAccessibility(backgroundImageUploadComponent.uploadLabel().parents('.edit-question-edit-tab-wrapper'));
107
+ });
108
+
109
+ it('When the user adds the image file and file upload is inprogress, file name and progress bar should be displayed below \'File name\' label. Progress bar should disappear once file is uploaded and uploaded image should be displayed', () => {
110
+ backgroundImageUploadComponent.steps.uploadFile('highlightImage.jpg');
111
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadImageProgressBar(), 'visible');
112
+ backgroundImageUploadComponent.steps.verifyFileNameLabel('highlightImage.jpg');
113
+ utilities.verifyElementVisibilityState( figOverImageCanvasComponent.canvasImage(), 'visible');
114
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadImageProgressBar(), 'notExist');
115
+ figOverImageCanvasComponent.steps.verifyImageIsUploaded();
116
+ });
117
+
118
+ it('Delete button should appear beside uploaded file\'s name', () => {
119
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.deleteImageIcon(), 'visible');
120
+ });
121
+
122
+ it('When user clicks on \'Choose file\' button again and upload another image file, previously uploaded image file should get replaced with new image file', () => {
123
+ backgroundImageUploadComponent.steps.uploadFile('sample1.jpg');
124
+ backgroundImageUploadComponent.steps.verifyFileNameLabel('sample1.jpg');
125
+ });
126
+ },
127
+
128
+ verifyDeleteImagePopupContentAndFunctionality: () => {
129
+ it('When the user hovers on \'Delete\' button, \'Delete image\' text should be displayed in tooltip', () => {
130
+ backgroundImageUploadComponent.deleteImageIcon()
131
+ .verifyTooltip('Delete image');
132
+ });
133
+
134
+ it('CSS of tooltip', { tags: 'css' }, () => {
135
+ backgroundImageUploadComponent.deleteImageIcon()
136
+ .trigger('mouseover');
137
+ utilities.verifyCSS(commonComponents.tooltipText(), {
138
+ 'color': css.color.whiteText,
139
+ 'font-size': css.fontSize.normal,
140
+ 'font-weight': css.fontWeight.regular,
141
+ 'background-color': css.color.tooltipBg
142
+ });
143
+ });
144
+
145
+ it('When user clicks on the \'Delete\' button, then \'Delete\' popup should be displayed', () => {
146
+ backgroundImageUploadComponent.steps.deleteImage();
147
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
148
+ utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'Delete');
149
+ });
150
+
151
+ it('The pop up should be displayed with the message \'Are you sure you want to delete the image?\'', () => {
152
+ utilities.verifyInnerText(dialogBoxBase.dialogBoxContent(), 'Are you sure you want to delete the image?');
153
+ utilities.verifyInnerText(backgroundImageUploadComponent.deleteImagePopupButtonDelete(), 'Delete image');
154
+ utilities.verifyInnerText(backgroundImageUploadComponent.deleteImagePopupButtonCancel(), 'Cancel');
155
+ });
156
+
157
+ it('CSS of popup', { tags: 'css' }, () => {
158
+ utilities.verifyCSS(dialogBoxBase.dialogBox(), {
159
+ 'background-color': css.color.defaultBackground,
160
+ });
161
+ utilities.verifyCSS(dialogBoxBase.dialogBoxContent().find('[class*="UploadImagestyles__DeletePopupWrapper"]'), {
162
+ 'color': css.color.sectionHeading,
163
+ 'font-size': css.fontSize.default,
164
+ 'font-weight': css.fontWeight.regular
165
+ });
166
+ utilities.verifyCSS(backgroundImageUploadComponent.deleteImagePopupButtonDelete(), {
167
+ 'color': css.color.primaryBtn,
168
+ 'font-size': css.fontSize.default,
169
+ 'font-weight': css.fontWeight.semibold
170
+ });
171
+ utilities.verifyCSS(backgroundImageUploadComponent.deleteImagePopupButtonCancel(), {
172
+ 'color': css.color.secondaryBtn,
173
+ 'font-size': css.fontSize.default,
174
+ 'font-weight': css.fontWeight.semibold,
175
+ 'background-color': css.color.defaultBackground
176
+ });
177
+ });
178
+
179
+ it('Accessibility of the popup', () => {
180
+ cy.checkAccessibility(dialogBoxBase.dialogBox());
181
+ });
182
+
183
+ it('When user clicks on \'Cancel\' button, then popup should close and user should remain on the edit interface of the question', () => {
184
+ backgroundImageUploadComponent.steps.clickOnCancelButtonInDeleteImagePopup();
185
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
186
+ utilities.verifyInnerText(backgroundImageUploadComponent.uploadedFileNameLabel(), 'sample1.jpg');
187
+ utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasImage(), 'visible');
188
+ });
189
+
190
+ it('When user clicks on \'Delete image\' button, then popup should close and image inside the canvas should be deleted', () => {
191
+ backgroundImageUploadComponent.steps.deleteImage();
192
+ backgroundImageUploadComponent.steps.clickOnDeleteButtonInDeleteImagePopup();
193
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
194
+ utilities.verifyInnerText(backgroundImageUploadComponent.noFileChosenLabel(), 'No file chosen');
195
+ figOverImageCanvasComponent.steps.verifyCanvasImageNotExist();
196
+ });
38
197
  }
39
198
  }
40
199
 
41
200
  export const backgroundImageUploadComponent = {
42
201
  ...selectors,
43
- steps
202
+ steps,
203
+ tests
44
204
  }
@@ -1,7 +1,9 @@
1
1
  import utilities from "../../support/helpers/utilities";
2
+ import { dialogBoxBase } from "../dialogBoxBase";
2
3
  const css = Cypress.env('css');
3
4
 
4
5
  const selectors = {
6
+ ...dialogBoxBase,
5
7
  colorBlock: () => cy.get('.color-picker-block'),
6
8
  colorSaturationPalette: () => cy.get('.react-colorful__saturation'),
7
9
  colorSaturationPicker: () => cy.get('.react-colorful__saturation-pointer .react-colorful__pointer-fill'),
@@ -11,19 +13,19 @@ const selectors = {
11
13
  selectedColorBlock: () => cy.get('.color-wrapper'),
12
14
  hexLabel: () => cy.get('.hex-settings-wrapper .inline-text-property-label'),
13
15
  hexInputField: () => cy.get('.hex-settings-wrapper input'),
16
+ cancelButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(0),
17
+ okButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(1),
18
+ dialogBoxTitle: () => cy.get('#alert-dialog-title'),
19
+ opacityGradientHue: () => cy.get('.react-colorful__last-control [class="react-colorful__interactive"]'),
20
+ opacityGradientPicker: () => cy.get('.react-colorful__last-control .react-colorful__pointer-fill'),
14
21
  opacityLabel: () => cy.get('[class*="ColorPickerstyles__SliderWrapper"]'),
22
+ //Need to update when feedback scale is available
15
23
  opacitySlider: () => cy.get('[class*="ColorPickerstyles__SliderWrapper"] .color-slider'),
16
24
  opacityInputField: () => cy.get('.opacity-wrapper [aria-label="Opacity"]'),
17
25
  recommendedColorsLabel: () => cy.get('.color-picker-footer-wrapper'),
18
26
  recommendedColorBlock: () => cy.get('[class*="ColorPickerstyles__ColorBlockWrapper"] .color-picker-block'),
19
27
  recommendedColorBlockSelectedIcon: () => cy.get('.selected-button-icon'),
20
- recommendedColorBlockLabel: () => cy.get('[class*="ColorPickerstyles__ColorLabel"]'),
21
- cancelButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(0),
22
- okButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(1),
23
- dialogBox: () => cy.get('#alert-dialog-description'),
24
- dialogBoxTitle: () => cy.get('#alert-dialog-title'),
25
- opacityGradientHue: () => cy.get('.react-colorful__last-control [class="react-colorful__interactive"]'),
26
- opacityGradientPicker: () => cy.get('.react-colorful__last-control .react-colorful__pointer-fill')
28
+ recommendedColorBlockLabel: () => cy.get('[class*="ColorPickerstyles__ColorLabel"]')
27
29
  }
28
30
 
29
31
  const steps = {
@@ -154,7 +156,7 @@ const steps = {
154
156
  },
155
157
 
156
158
  verifyColorPopupIsDisplayed: () => {
157
- utilities.verifyElementVisibilityState(colorPopupComponent.dialogBox(), 'visible');
159
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBoxContent(), 'visible');
158
160
  },
159
161
 
160
162
  verifyColorPopupSelectColorTitle: () => {
@@ -258,21 +260,35 @@ const steps = {
258
260
 
259
261
  clickOnOpacityGradientHuePalette: () => {
260
262
  colorPopupComponent.opacityGradientHue()
261
- .click();
263
+ .click();
262
264
  },
263
265
  }
264
266
 
265
267
  const tests = {
266
- verifyCSSAnda11yOfColourPopupContents: () => {
268
+ verifyColorPopupSelectColorTitle: () => {
269
+ it('A title \'Select color\' should be displayed on the color popup', () => {
270
+ colorPopupComponent.steps.verifyColorPopupSelectColorTitle();
271
+ });
272
+
273
+ it('A \'Selected color\' label and color block displaying the selected color should be displayed', () => {
274
+ colorPopupComponent.steps.verifySelectedColorLabelAndSelectedColorBlock();
275
+ });
276
+
277
+ it('\'Cancel\' and \'Ok\' buttons should be displayed', () => {
278
+ utilities.verifyInnerText(colorPopupComponent.cancelButton(), 'Cancel');
279
+ utilities.verifyElementVisibilityState(colorPopupComponent.cancelButton(), 'visible');
280
+ utilities.verifyInnerText(colorPopupComponent.okButton(), 'OK');
281
+ utilities.verifyElementVisibilityState(colorPopupComponent.okButton(), 'visible');
282
+ });
283
+
267
284
  it('CSS of color popup contents', { tags: 'css' }, () => {
268
- const labels = [colorPopupComponent.selectedColorLabel, colorPopupComponent.hexLabel, colorPopupComponent.opacityLabel, colorPopupComponent.recommendedColorsLabel]
269
- const inputFields = [colorPopupComponent.hexInputField, colorPopupComponent.opacityInputField];
285
+ const labels = [colorPopupComponent.selectedColorLabel, colorPopupComponent.hexLabel]
286
+ const inputFields = [colorPopupComponent.hexInputField];
270
287
  labels.forEach(label => {
271
288
  utilities.verifyCSS(label(), {
272
289
  'color': css.color.labels,
273
290
  'font-size': css.fontSize.normal,
274
291
  'font-weight': css.fontWeight.semibold
275
-
276
292
  });
277
293
  });
278
294
  inputFields.forEach(inputField => {
@@ -280,33 +296,106 @@ const tests = {
280
296
  'color': css.color.text,
281
297
  'font-size': css.fontSize.default,
282
298
  'font-weight': css.fontWeight.regular
283
-
284
299
  });
285
300
  });
286
- utilities.verifyCSS(colorPopupComponent.recommendedColorBlockLabel(), {
287
- 'color': css.color.labelText,
288
- 'font-size': css.fontSize.normal,
289
- 'font-weight': css.fontWeight.regular
290
- });
291
301
  utilities.verifyCSS(colorPopupComponent.okButton(), {
292
- 'color': css.color.text,
302
+ 'color': css.color.primaryBtn,
293
303
  'font-size': css.fontSize.default,
294
304
  'font-weight': css.fontWeight.regular,
295
- 'background-color': css.color.successBtnBg
305
+ 'background-color': css.color.primaryBtnBg
296
306
  });
297
307
  utilities.verifyCSS(colorPopupComponent.cancelButton(), {
298
308
  'color': css.color.secondaryBtn,
299
309
  'font-size': css.fontSize.default,
300
- 'font-weight': css.fontWeight.regular,
301
- 'background-color': css.color.secondaryBtnBg
310
+ 'font-weight': css.fontWeight.semibold,
311
+ 'background-color': css.color.transparent
302
312
  });
303
313
  });
304
314
 
305
- //Failing due to https://redmine.zeuslearning.com/issues/539391
306
315
  it('Accessibility of color popup contents', { tags: 'a11y' }, () => {
307
- cy.checkAccessibility(colorPopupComponent.dialogBox());
316
+ cy.checkAccessibility(dialogBoxBase.dialogBoxContent());
317
+ });
318
+ },
319
+
320
+ /**
321
+ * @param {string} color value of saturation color palette and opacity gradient palette
322
+ */
323
+ verifySaturationAndOpacityGradientPalette: (color) => {
324
+ it('A \'Color saturation palette\' should be displayed on the color popup along with a color picker and the color picker should be set on the selected color', () => {
325
+ colorPopupComponent.steps.verifyColorSaturationPaletteAndPicker();
326
+ colorPopupComponent.steps.verifySaturationPaletteColor(color);
327
+ });
328
+
329
+ it('A \'Opacity gradient hue palette\' should be displayed on the color popup along with a Opacity gradient picker and the color picker should be set on the selected color', () => {
330
+ colorPopupComponent.steps.verifyOpacityGradientHuePaletteAndPicker();
331
+ colorPopupComponent.steps.verifyOpacityGradientPaletteColor(color);
332
+ });
333
+ },
334
+
335
+ /**
336
+ * @param {string} hueColor value of color hue palette in Rgb
337
+ * @param {string} hexColor value of hex input field in hex code
338
+ */
339
+ verifyColorHuePaletteAndHexInputField: (hueColor, hexColor) => {
340
+ it('A \'Color hue palette\' should be displayed on the color popup along with a color picker and the color picker should be set on the selected color', () => {
341
+ colorPopupComponent.steps.verifyColorHuePaletteAndPicker();
342
+ colorPopupComponent.steps.verifyHuePaletteColor(hueColor);
343
+ });
344
+
345
+ it('A \'Hex\' label and input field with pre-filled hex code value of the selected color should be displayed', () => {
346
+ colorPopupComponent.steps.verifyHexLabelAndInputField();
347
+ colorPopupComponent.steps.verifyHexValue(hexColor);
348
+ });
349
+ },
350
+
351
+ verifyColorPopupFunctionality: () => {
352
+ it('When the user changes the color using hex code, the color in color saturation palette and color hue palette should change', () => {
353
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
354
+ colorPopupComponent.steps.verifyHexValue('#ff0000');
355
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 0, 0)');
356
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
357
+ });
358
+
359
+ it('When the user changes the color opacity using opacity gradient hue, then opacity of color should change in selected color block and hex color code should remain unchanged', () => {
360
+ colorPopupComponent.steps.clickOnOpacityGradientHuePalette();
361
+ colorPopupComponent.steps.verifyOpacityGradientPaletteColor('rgba(255, 0, 0, 0.5)');
362
+ colorPopupComponent.steps.verifySelectedColorBlock('rgba(255, 0, 0, 0.5)');
363
+ colorPopupComponent.steps.verifyHexValue('#ff0000');
364
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 0, 0)');
365
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
366
+ });
367
+ },
368
+
369
+ /**
370
+ * @param {string} color value of saturation color palette and opacity gradient palette
371
+ */
372
+ verifySaturationAndOpacityGradientPalette: (color) => {
373
+ it('A \'Color saturation palette\' should be displayed on the color popup along with a color picker and the color picker should be set on the selected color', () => {
374
+ colorPopupComponent.steps.verifyColorSaturationPaletteAndPicker();
375
+ colorPopupComponent.steps.verifySaturationPaletteColor(color);
308
376
  });
309
- }
377
+
378
+ it('A \'Opacity gradient hue palette\' should be displayed on the color popup along with a Opacity gradient picker and the color picker should be set on the selected color', () => {
379
+ colorPopupComponent.steps.verifyOpacityGradientHuePaletteAndPicker();
380
+ colorPopupComponent.steps.verifyOpacityGradientPaletteColor(color);
381
+ });
382
+ },
383
+
384
+ /**
385
+ * @param {string} hueColor value of color hue palette in Rgb
386
+ * @param {string} hexColor value of hex input field in hex code
387
+ */
388
+ verifyColorHuePaletteAndHexInputField: (hueColor, hexColor) => {
389
+ it('A \'Color hue palette\' should be displayed on the color popup along with a color picker and the color picker should be set on the selected color', () => {
390
+ colorPopupComponent.steps.verifyColorHuePaletteAndPicker();
391
+ colorPopupComponent.steps.verifyHuePaletteColor(hueColor);
392
+ });
393
+
394
+ it('A \'Hex\' label and input field with pre-filled hex code value of the selected color should be displayed', () => {
395
+ colorPopupComponent.steps.verifyHexLabelAndInputField();
396
+ colorPopupComponent.steps.verifyHexValue(hexColor);
397
+ });
398
+ },
310
399
  }
311
400
 
312
401
  export const colorPopupComponent = {
@@ -0,0 +1,133 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+
3
+ const selectors = {
4
+ //Customize math characters
5
+ customizeMathCharactersCheckbox: () => cy.get('[data-ngie-testid="customize-math-characters-checkbox"] .ngie-checkbox input'),
6
+ customizeMathCharactersLabel: () => cy.get('[data-ngie-testid="customize-math-characters-checkbox"] [class*="label"]'),
7
+ selectMathCharacterCategoryLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__SpecialCharLabel"]'),
8
+ customizeMathCharactersPreviewButton: () => cy.get('[class*="CustomizedSpecialCharacterstyles__PreviewLabel"]'),
9
+ customizeMathCharactersTickIcon: () => cy.get('.tick-icon-wrapper'),
10
+
11
+ //Preview popup
12
+ mathCharactersPreviewPopupSymbol: () => cy.get('[class*="Characterstyles__CharacterWrapper"]'),
13
+ mathCharactersPopupCloseButton: () => cy.get('[class*="close-button"]'),
14
+
15
+ //Math characters preview popup
16
+ mathCharactersPreviewPopupCharactersCategoryWrapper: () => cy.get('[class*="__AccordionWrapper"]'),
17
+ mathCharactersPreviewPopupCategoryLabel: () => cy.get('[class*="MathCharacterstyles__PopupTitle"]'),
18
+
19
+ //Edit tab
20
+ mathCharactersCategoryTilesWrapper: () => cy.get('[class*="CustomizedSpecialCharacterstyles__DragAndDropWrapper"]'),
21
+ mathCharacterTiles: (mathCharacterCategory = null) => {
22
+ if (mathCharacterCategory) {
23
+ return cy.get(`[class*="DragAndDropGridstyles"] [id*="DraggableItem"] button[aria-label="${mathCharacterCategory}"]`)
24
+ } else {
25
+ return cy.get('[class*="DragAndDropGridstyles"] [id*="DraggableItem"] button')
26
+ }
27
+ },
28
+ mathCharacterTileIcon: () => cy.get('[class*="DragAndDropGridstyles"] .equation-editor-icon'),
29
+ mathCharacterTileCategoryName: () => cy.get('[class*="DragAndDropGridstyles"] .equation-editor-label-wrapper'),
30
+ mathCharacterTileSectionCategoriesDragIcon: () => cy.get('[class*="DragAndDropGridstyles"] .drag-icon-equation-editor-button'),
31
+ }
32
+
33
+ const steps = {
34
+ checkCustomizeMathCharactersCheckbox: () => {
35
+ customizeMathCharacterComponent.customizeMathCharactersCheckbox()
36
+ .click()
37
+ .should('be.checked');
38
+ },
39
+
40
+
41
+ clickOnCustomizeMathCharactersPreviewButton: () => {
42
+ customizeMathCharacterComponent.customizeMathCharactersPreviewButton()
43
+ .click();
44
+ },
45
+
46
+
47
+ /**
48
+ * @description Verify math characters categories and symbols in preview tab
49
+ * @param {object[]} categoryAndSymbolsArray Array of math characters categories and symbols
50
+ */
51
+ verifyMathCharactersPreviewPopupInEditTab: (categoryAndSymbolsArray) => {
52
+ categoryAndSymbolsArray.forEach((category, index) => {
53
+ utilities.verifyInnerText(customizeMathCharacterComponent.mathCharactersPreviewPopupCategoryLabel().eq(index), `${category.categoryName}`);
54
+ customizeMathCharacterComponent.mathCharactersPreviewPopupCharactersCategoryWrapper()
55
+ .eq(index)
56
+ .within(() => {
57
+ category.symbols.forEach((symbol, index) => {
58
+ utilities.verifyElementVisibilityState(customizeMathCharacterComponent.mathCharactersPreviewPopupSymbol().eq(index), 'visible');
59
+ customizeMathCharacterComponent.mathCharactersPreviewPopupSymbol()
60
+ .eq(index)
61
+ .find('path')
62
+ .should('have.attr', 'data-name', `${symbol}`);
63
+ });
64
+ utilities.verifyElementCount(customizeMathCharacterComponent.mathCharactersPreviewPopupSymbol(), category.symbols.length);
65
+ });
66
+ });
67
+ utilities.verifyElementCount(customizeMathCharacterComponent.mathCharactersPreviewPopupCharactersCategoryWrapper(), categoryAndSymbolsArray.length);
68
+ },
69
+
70
+ /**
71
+ * @description Verify customized math character category tiles in edit tab
72
+ * @param {string[]} charactersCategoriesArray Array of math character categories
73
+ */
74
+ verifyCustomizeMathCharactersCategoryTiles: (charactersCategoriesArray) => {
75
+ customizeMathCharacterComponent.mathCharactersCategoryTilesWrapper()
76
+ .within(() => {
77
+ charactersCategoriesArray.forEach((characterCategory, index) => {
78
+ customizeMathCharacterComponent.mathCharacterTiles()
79
+ .eq(index)
80
+ .should('have.attr', 'aria-label', `${characterCategory}`);
81
+ });
82
+ });
83
+ utilities.verifyElementCount(customizeMathCharacterComponent.mathCharacterTiles(), charactersCategoriesArray.length);
84
+ },
85
+
86
+ /**
87
+ * @description Verify selected math characters category tiles
88
+ * @param {string[]} selectedMathCharactersCategoriesArray Array of selected math characters categories
89
+ */
90
+ verifySelectedCustomizeMathCharactersCategoryTiles: (selectedMathCharactersCategoriesArray) => {
91
+ customizeMathCharacterComponent.mathCharactersCategoryTilesWrapper()
92
+ .within(() => {
93
+ selectedMathCharactersCategoriesArray.forEach((characterCategory) => {
94
+ customizeMathCharacterComponent.mathCharacterTiles(characterCategory)
95
+ .should('have.class', 'Mui-selected')
96
+ .within(() => {
97
+ utilities.verifyElementVisibilityState(customizeMathCharacterComponent.customizeMathCharactersTickIcon(), 'visible');
98
+ });
99
+ });
100
+ });
101
+ },
102
+
103
+ /**
104
+ * This function selects the math category characters
105
+ * @param {string} categoryName math category characters aria label
106
+ */
107
+ clickOnMathCharactersCategoryTile: (categoryName) => {
108
+ customizeMathCharacterComponent.mathCharacterTiles(categoryName)
109
+ .click();
110
+ },
111
+
112
+ /**
113
+ * This function verifies the the math category characters are not selectedF
114
+ * @param {string} categoryName math category characters aria label
115
+ */
116
+ verifyMathCharacterCategoryTileIsNotSelected: (categoryName) => {
117
+ customizeMathCharacterComponent.mathCharacterTiles(categoryName)
118
+ .should('have.attr', 'data-aria-pressed', 'false')
119
+ .within(() => {
120
+ utilities.verifyElementVisibilityState(customizeMathCharacterComponent.customizeMathCharactersTickIcon(), 'hidden');
121
+ });
122
+ },
123
+
124
+ clickOnMathCharacterCloseButton: () => {
125
+ customizeMathCharacterComponent.mathCharactersPopupCloseButton()
126
+ .click();
127
+ }
128
+ }
129
+
130
+ export const customizeMathCharacterComponent = {
131
+ ...selectors,
132
+ steps
133
+ }
@@ -1,6 +1,12 @@
1
1
  import utilities from "../../support/helpers/utilities";
2
+ import { specialCharacters } from "../../fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters";
3
+ import { dialogBoxBase } from "../dialogBoxBase";
4
+ const specialCharactersCategories = Object.values(specialCharacters.map((icon) => icon.categoryName));
2
5
 
3
6
  const selectors = {
7
+ customizeSpecialCharactersCheckbox: () => cy.get('[data-ngie-testid="customize-special-characters-checkbox"] .ngie-checkbox input'),
8
+ customizeSpecialCharactersLabel: () => cy.get('[data-ngie-testid="customize-special-characters-checkbox"] [class*="label"]'),
9
+ charactersPopupCharacterSymbol: () => cy.get(' [class*="char"] [class*="rapper"] button[class*="characters"]'),
4
10
  groupByLanguageRadioButton: () => cy.get('[class*="CustomizedSpecialCharacterstyles__RadioGroupWrapper"] .ngie-radio-btn input').eq(0),
5
11
  groupByLanguageLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__RadioGroupWrapper"] .ngie-radio-label').eq(0),
6
12
  showOnlyCustomSpecialCharactersRadioButton: () => cy.get('[class*="CustomizedSpecialCharacterstyles__RadioGroupWrapper"] .ngie-radio-btn input').eq(1),
@@ -12,9 +18,9 @@ const selectors = {
12
18
  specialCharactersCategoryTilesWrapper: () => cy.get('[class*="CustomizedSpecialCharacterstyles__DragAndDropWrapper"]'),
13
19
  specialCharacterTiles: (specialCharacterCategory = null) => {
14
20
  if (specialCharacterCategory) {
15
- return cy.get(`[id*="DraggableItem"] button[aria-label="${specialCharacterCategory}"]`)
21
+ return cy.get(`[aria-label*="special character"][id*="DraggableItem"] button[aria-label="${specialCharacterCategory}"]`)
16
22
  } else {
17
- return cy.get('[id*="DraggableItem"] button')
23
+ return cy.get('[aria-label*="special character"][id*="DraggableItem"] button')
18
24
  }
19
25
  },
20
26
  specialCharacterTileIcon: () => cy.get('.equation-editor-icon'),
@@ -22,7 +28,7 @@ const selectors = {
22
28
  specialCharacterTileSectionCategoriesDragIcon: () => cy.get('.drag-icon-equation-editor-button'),
23
29
  //Special characters preview popup
24
30
  specialCharactersPreviewPopupCharactersCategoryWrapper: () => cy.get('[class*="special"][class*="accordion"]'),
25
- specialCharactersPreviewPopupCategoryAccordionExpandIcon: () => cy.get('[class*="expandIconWrapper"]'),
31
+ specialCharactersPreviewPopupCategoryAccordionExpandIcon: () => cy.get('.special-character-accordion [class*="expandIconWrapper"]'),
26
32
  specialCharactersPreviewPopupCategoryLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__AccordionLabel"]'),
27
33
  specialCharactersPreviewPopupSymbol: () => cy.get('[class*="CustomizedSpecialCharacterstyles__CharacterWrapper"]'),
28
34
 
@@ -32,6 +38,24 @@ const selectors = {
32
38
  }
33
39
 
34
40
  const steps = {
41
+ /**
42
+ * Verify custom special characters displayed in characters popup in preview tab
43
+ * @param {string[]} customSpecialCharacters Array of custom special characters
44
+ */
45
+ verifyCustomSpecialCharactersDisplayedInPreviewTab: (customSpecialCharacters) => {
46
+ customSpecialCharacters.forEach((customSpecialCharacter, index) => {
47
+ utilities.verifyInnerText(customizeSpecialCharacterComponent.charactersPopupCharacterSymbol().eq(index), `${customSpecialCharacter}`);
48
+ utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.charactersPopupCharacterSymbol().eq(index), 'visible');
49
+ });
50
+ utilities.verifyElementCount(customizeSpecialCharacterComponent.charactersPopupCharacterSymbol(), `${customSpecialCharacters.length}`);
51
+ },
52
+
53
+ checkCustomizeSpecialCharactersCheckbox: () => {
54
+ customizeSpecialCharacterComponent.customizeSpecialCharactersCheckbox()
55
+ .click()
56
+ .should('be.checked');
57
+ },
58
+
35
59
  verifyGroupedByLanguageRadioButtonIsSelected: () => {
36
60
  customizeSpecialCharacterComponent.groupByLanguageRadioButton()
37
61
  .should('be.checked');
@@ -159,7 +183,53 @@ const steps = {
159
183
  },
160
184
  }
161
185
 
186
+ const tests = {
187
+ verifyCustomSpecialCharactersEditTabContent: () => {
188
+ it('When the user checks the \'Customize special characters\' checkbox, \'Group by language\' and \'Show only custom special characters\' labels and radio buttons should be displayed. By default \'Group by language\' radio button should be checked', () => {
189
+ customizeSpecialCharacterComponent.steps.checkCustomizeSpecialCharactersCheckbox();
190
+ utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.groupByLanguageRadioButton(), 'exist');
191
+ utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.groupByLanguageLabel(), 'visible');
192
+ utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.showOnlyCustomSpecialCharactersRadioButton(), 'exist');
193
+ utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.showOnlyCustomSpecialCharactersLabel(), 'visible');
194
+ customizeSpecialCharacterComponent.steps.verifyGroupedByLanguageRadioButtonIsSelected();
195
+ });
196
+
197
+ it('\'Select special character languages\' label should be displayed. A \'Preview\' hyperlink should be displayed next to the label', () => {
198
+ utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.selectSpecialCharacterLanguagesLabel(), 'visible');
199
+ utilities.verifyInnerText(customizeSpecialCharacterComponent.selectSpecialCharacterLanguagesLabel(), 'Select special character languages');
200
+ utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.customizeSpecialCharactersPreviewButton(), 'visible');
201
+ utilities.verifyInnerText(customizeSpecialCharacterComponent.customizeSpecialCharactersPreviewButton(), 'Preview');
202
+ });
203
+
204
+ it(`A total of ${specialCharactersCategories.length} options should be displayed - ${specialCharactersCategories.join('')}. By default all language options should be in selected state`, () => {
205
+ customizeSpecialCharacterComponent.steps.verifyCustomizeSpecialCharactersCategoryTiles(specialCharactersCategories);
206
+ customizeSpecialCharacterComponent.steps.verifySelectedCustomizeSpecialCharactersCategoryTiles(specialCharactersCategories);
207
+ });
208
+
209
+ it('When the user clicks on the \'Preview\' hyperlink, a special characters popup should be displayed with all the special characters segregated according to all the language options. The user should be able to close the popup by clicking on the \'Close[X]\' button', () => {
210
+ customizeSpecialCharacterComponent.steps.clickOnCustomizeSpecialCharactersPreviewButton();
211
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
212
+ //customizeSpecialCharacterComponent.steps.verifySpecialCharactersPreviewPopupInEditTab(specialCharacters);
213
+ //Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
214
+ cy.log('Post-step: Closing preview popup')
215
+ dialogBoxBase.steps.closeWarningPopup();
216
+ });
217
+
218
+ it('When the user deselects any language option and opens the special characters popup by clicking on the \'Preview\' hyperlink, then the popup contents should get updated accordingly', () => {
219
+ let newSelectedCategoryList = specialCharacters.slice(1);
220
+ customizeSpecialCharacterComponent.steps.clickOnSpecialCharactersCategoryTile(specialCharacters[0].categoryName);
221
+ customizeSpecialCharacterComponent.steps.verifySpecialCharacterCategoryTileIsNotSelected(specialCharacters[0].categoryName);
222
+ customizeSpecialCharacterComponent.steps.clickOnCustomizeSpecialCharactersPreviewButton();
223
+ //customizeSpecialCharacterComponent.steps.verifySpecialCharactersPreviewPopupInEditTab(specialCharacters);
224
+ //Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
225
+ cy.log('Post-step: Closing preview popup')
226
+ dialogBoxBase.steps.closeWarningPopup();
227
+ });
228
+ }
229
+ }
230
+
162
231
  export const customizeSpecialCharacterComponent = {
163
232
  ...selectors,
164
- steps
233
+ steps,
234
+ tests
165
235
  }