itemengine-cypress-automation 1.0.120 → 1.0.122-updateILCRepo28Feb-2c3e0e3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +13 -1
  2. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +2 -0
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -2
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +1 -4
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +273 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js +116 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +136 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +224 -0
  12. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +120 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +158 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -1
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -4
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +246 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +332 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +409 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +80 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +213 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +2 -2
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +1 -1
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +2 -2
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +68 -68
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +3 -289
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -23
  32. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +191 -0
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +190 -0
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +284 -0
  35. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
  36. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +113 -0
  37. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +217 -0
  38. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +234 -0
  39. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +217 -0
  40. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +217 -0
  41. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsBasic.js +136 -0
  42. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +197 -0
  43. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +169 -0
  44. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +197 -0
  45. package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +219 -0
  46. package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAnswerFunctionalityForAllViews.smoke.js +115 -0
  47. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +142 -0
  48. package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +152 -0
  49. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +39 -0
  50. package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +2 -12
  51. package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +497 -0
  52. package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +503 -0
  53. package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +233 -0
  54. package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +291 -0
  55. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +332 -0
  56. package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +2 -12
  57. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +9 -8
  58. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +4 -4
  59. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -2
  60. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +5 -2
  61. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +334 -0
  62. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +419 -0
  63. package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +166 -0
  64. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +166 -0
  65. package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +51 -0
  66. package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +99 -0
  67. package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +71 -0
  68. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +155 -0
  69. package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +66 -0
  70. package/cypress/fixtures/theme/ilc.json +3 -1
  71. package/cypress/pages/audioResponsePage.js +2 -1
  72. package/cypress/pages/components/additionalSettingsPanel.js +27 -0
  73. package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
  74. package/cypress/pages/components/autoScoredScoringSection.js +1 -1
  75. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
  76. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  77. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
  78. package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
  79. package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
  80. package/cypress/pages/components/createQuestionBasePage.js +8 -2
  81. package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
  82. package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
  83. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
  84. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
  85. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
  86. package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
  87. package/cypress/pages/components/index.js +3 -3
  88. package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
  89. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
  90. package/cypress/pages/components/questionInputFieldComponent.js +49 -23
  91. package/cypress/pages/components/scoringSectionBase.js +1 -1
  92. package/cypress/pages/createItemPage.js +67 -2
  93. package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
  94. package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
  95. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
  96. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
  97. package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
  98. package/cypress/pages/fillInTheGapsTextPage.js +52 -199
  99. package/cypress/pages/index.js +5 -5
  100. package/cypress/pages/multipleSelectionPage.js +1 -0
  101. package/cypress/pages/shortTextResponsePage.js +575 -33
  102. package/cypress/pages/singleSelectionGridPage.js +1 -2
  103. package/cypress/pages/singleSelectionPage.js +5 -6
  104. package/cypress/pages/textEntryMathPage.js +46 -22
  105. package/cypress/pages/textEntryMathWithImagePage.js +212 -0
  106. package/cypress/pages/uploadResponsePage.js +74 -21
  107. package/package.json +2 -2
  108. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
  109. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
  110. package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
  111. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
  112. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
  113. package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
  114. package/cypress/pages/fillInTheGapsScoring.js +0 -5872
  115. package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -26,7 +26,7 @@ const selectors = {
26
26
  responseAreaWrapper: () => cy.get('[class*="Canvasstyle__ResponseDiv"]'),
27
27
  responseAreaPointer: () => cy.get('[class*="Canvasstyle__PointerWrapper"]'),
28
28
  responseArea: () => cy.get('[class*="Canvasstyle__DropZone"]'),
29
- textBoxInPreviewTab: () => cy.get('.preview-content-wrapper [class*="Canvasstyle__TextBoxContainer"] textarea'),
29
+ textBoxInPreviewTab: () => cy.get('[class*="PreviewTabstyles__ContentWrapper"] textarea[class*="TextBox"]'),
30
30
  removeResponseAreaButton: () => cy.get('.remove-button'),
31
31
  responseAreaNumerationText: () => cy.get('[class*="Canvasstyle__DropzoneContent"]'),
32
32
  responseAreaStyle: (ariaLabel = null) => {
@@ -69,17 +69,17 @@ const steps = {
69
69
  * @description Adds response area to the canvas.
70
70
  */
71
71
  insertResponseArea: (yCoordinateInPercentage) => {
72
- figOverImageCanvasComponent.insertResponseAreaButton()
72
+ imageCanvasComponent.insertResponseAreaButton()
73
73
  .click();
74
- figOverImageCanvasComponent.canvasImage()
74
+ imageCanvasComponent.canvasImage()
75
75
  .then(($element) => {
76
76
  const imageHeight = $element[0].clientHeight;
77
77
  const xCoordinate = 25;
78
78
  const yCoordinate = yCoordinateInPercentage * imageHeight / 100;
79
- figOverImageCanvasComponent.canvasImage()
79
+ imageCanvasComponent.canvasImage()
80
80
  .click(xCoordinate, yCoordinate, { force: true });
81
81
  });
82
- figOverImageCanvasComponent.selectResponseAreaButton()
82
+ imageCanvasComponent.selectResponseAreaButton()
83
83
  .click();
84
84
  },
85
85
 
@@ -89,111 +89,111 @@ const steps = {
89
89
  * @description Adds text area to the canvas.
90
90
  */
91
91
  insertTextArea: (yCoordinateInPercentage, text) => {
92
- figOverImageCanvasComponent.insertTextAreaButton()
92
+ imageCanvasComponent.insertTextAreaButton()
93
93
  .click();
94
- figOverImageCanvasComponent.canvasImage()
94
+ imageCanvasComponent.canvasImage()
95
95
  .then(($element) => {
96
96
  const imageHeight = $element[0].clientHeight;
97
97
  const xCoordinate = 80;
98
98
  const yCoordinate = yCoordinateInPercentage * imageHeight / 100;
99
- figOverImageCanvasComponent.canvasImage()
99
+ imageCanvasComponent.canvasImage()
100
100
  .click(xCoordinate, yCoordinate, { force: true });
101
101
  });
102
- figOverImageCanvasComponent.textResponse()
102
+ imageCanvasComponent.textResponse()
103
103
  .type(text);
104
104
  },
105
105
 
106
106
  verifyImageIsUploaded: () => {
107
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasImage(), 'visible');
107
+ utilities.verifyElementVisibilityState(imageCanvasComponent.canvasImage(), 'visible');
108
108
  utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadImageProgressBar(), 'notExist');
109
109
  //Note: wait is added here for the image to fully load, else the first two response areas gets overlapped
110
110
  cy.wait(2000);
111
111
  },
112
112
 
113
113
  verifyImageIsUploadedInPreviewTab: () => {
114
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasImageInPreviewTab(), 'visible')
114
+ utilities.verifyElementVisibilityState(imageCanvasComponent.canvasImageInPreviewTab(), 'visible')
115
115
  },
116
116
 
117
117
  verifyCanvasImageNotExist: () => {
118
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasImage(), 'notExist');
118
+ utilities.verifyElementVisibilityState(imageCanvasComponent.canvasImage(), 'notExist');
119
119
  },
120
120
 
121
121
  verifyFillImageToCanvasCheckboxUnchecked: () => {
122
- figOverImageCanvasComponent.fillImageToCanvasCheckbox()
122
+ imageCanvasComponent.fillImageToCanvasCheckbox()
123
123
  .should('not.be.checked');
124
124
  },
125
125
 
126
126
  verifyFillImageToCanvasCheckboxChecked: () => {
127
- figOverImageCanvasComponent.fillImageToCanvasCheckbox()
127
+ imageCanvasComponent.fillImageToCanvasCheckbox()
128
128
  .should('be.checked');
129
129
  },
130
130
 
131
131
  checkFillImageToCanvasCheckbox: () => {
132
- figOverImageCanvasComponent.fillImageToCanvasCheckbox()
132
+ imageCanvasComponent.fillImageToCanvasCheckbox()
133
133
  .click();
134
134
  steps.verifyFillImageToCanvasCheckboxChecked();
135
135
  },
136
136
 
137
137
  uncheckFillImageToCanvasCheckbox: () => {
138
- figOverImageCanvasComponent.fillImageToCanvasCheckbox()
138
+ imageCanvasComponent.fillImageToCanvasCheckbox()
139
139
  .click();
140
140
  steps.verifyFillImageToCanvasCheckboxUnchecked();
141
141
  },
142
142
 
143
143
  verifyCanvasImageTopLeftAligned: () => {
144
- figOverImageCanvasComponent.canvasImage()
144
+ imageCanvasComponent.canvasImage()
145
145
  .should('have.css', 'top', '0px')
146
146
  .and('have.css', 'left', '0px');
147
147
  },
148
148
 
149
149
  verifyCanvasImageTopLeftAlignedInPreviewTab: () => {
150
- figOverImageCanvasComponent.canvasImageInPreviewTab()
150
+ imageCanvasComponent.canvasImageInPreviewTab()
151
151
  .should('have.css', 'top', '0px')
152
152
  .and('have.css', 'left', '0px');
153
153
  },
154
154
 
155
155
  verifyCanvasImageTopRightAligned: () => {
156
- figOverImageCanvasComponent.canvasImage()
156
+ imageCanvasComponent.canvasImage()
157
157
  .should('have.css', 'top', '0px')
158
158
  .and('not.have.css', 'left', '0px');
159
159
  },
160
160
 
161
161
  verifyCanvasImageTopRightAlignedInPreviewTab: () => {
162
- figOverImageCanvasComponent.canvasImageInPreviewTab()
162
+ imageCanvasComponent.canvasImageInPreviewTab()
163
163
  .should('have.css', 'top', '0px')
164
164
  .and('not.have.css', 'left', '0px');
165
165
  },
166
166
 
167
167
  verifyCanvasImageCenterAligned: () => {
168
- figOverImageCanvasComponent.canvasImage()
168
+ imageCanvasComponent.canvasImage()
169
169
  .should('not.have.css', 'top', '0px')
170
170
  .and('not.have.css', 'left', '0px');
171
171
  },
172
172
 
173
173
  verifyCanvasImageCenterAlignedInPreviewTab: () => {
174
- figOverImageCanvasComponent.canvasImageInPreviewTab()
174
+ imageCanvasComponent.canvasImageInPreviewTab()
175
175
  .should('not.have.css', 'top', '0px')
176
176
  .and('not.have.css', 'left', '0px');
177
177
  },
178
178
 
179
179
  selectTopLeftImageAlignment: () => {
180
- figOverImageCanvasComponent.topLeftAlignmentButton()
180
+ imageCanvasComponent.topLeftAlignmentButton()
181
181
  .click();
182
- figOverImageCanvasComponent.topLeftAlignmentButton()
182
+ imageCanvasComponent.topLeftAlignmentButton()
183
183
  .should('have.attr', 'aria-pressed', 'true');
184
184
  },
185
185
 
186
186
  selectTopRightImageAlignment: () => {
187
- figOverImageCanvasComponent.topRightAlignmentButton()
187
+ imageCanvasComponent.topRightAlignmentButton()
188
188
  .click();
189
- figOverImageCanvasComponent.topRightAlignmentButton()
189
+ imageCanvasComponent.topRightAlignmentButton()
190
190
  .should('have.attr', 'aria-pressed', 'true');
191
191
  },
192
192
 
193
193
  selectCenterImageAlignment: () => {
194
- figOverImageCanvasComponent.centerAlignmentButton()
194
+ imageCanvasComponent.centerAlignmentButton()
195
195
  .click();
196
- figOverImageCanvasComponent.centerAlignmentButton()
196
+ imageCanvasComponent.centerAlignmentButton()
197
197
  .should('have.attr', 'aria-pressed', 'true');
198
198
  },
199
199
 
@@ -202,7 +202,7 @@ const steps = {
202
202
  * @description function verifies opacity value for image
203
203
  */
204
204
  verifyOpacityValueForCanvasImage: (value) => {
205
- figOverImageCanvasComponent.canvasImage()
205
+ imageCanvasComponent.canvasImage()
206
206
  .should('have.attr', 'opacity', value);
207
207
  },
208
208
 
@@ -211,7 +211,7 @@ const steps = {
211
211
  * @description function verifies opacity value for image
212
212
  */
213
213
  verifyOpacityValueForCanvasImageInPreviewTab: (value) => {
214
- figOverImageCanvasComponent.canvasImageInPreviewTab()
214
+ imageCanvasComponent.canvasImageInPreviewTab()
215
215
  .should('have.attr', 'opacity', value);
216
216
  },
217
217
 
@@ -220,9 +220,9 @@ const steps = {
220
220
  * @description this function adds text in input field and then verifies it
221
221
  */
222
222
  enterAndVerifyImageAlternativeTextInInputField: (text) => {
223
- figOverImageCanvasComponent.imageAlternativeTextInputField()
223
+ imageCanvasComponent.imageAlternativeTextInputField()
224
224
  .type(text);
225
- figOverImageCanvasComponent.imageAlternativeTextInputField()
225
+ imageCanvasComponent.imageAlternativeTextInputField()
226
226
  .should('have.value', text);
227
227
  },
228
228
 
@@ -231,7 +231,7 @@ const steps = {
231
231
  * @description this function verifies text for canvas image
232
232
  */
233
233
  verifyImageAlternativeTextInPreviewTab: (text) => {
234
- figOverImageCanvasComponent.canvasImageInPreviewTab()
234
+ imageCanvasComponent.canvasImageInPreviewTab()
235
235
  .should('have.attr', 'alt', text);
236
236
  },
237
237
 
@@ -240,58 +240,59 @@ const steps = {
240
240
  * @description this function verifies text for canvas image
241
241
  */
242
242
  verifyImageAlternativeTextPresentInEditTab: (text) => {
243
- figOverImageCanvasComponent.canvasImage()
243
+ imageCanvasComponent.canvasImage()
244
244
  .should('have.attr', 'alt', text);
245
245
  },
246
246
 
247
247
  clearImageAlternativeTextInputFieldText: () => {
248
- figOverImageCanvasComponent.imageAlternativeTextInputField()
248
+ imageCanvasComponent.imageAlternativeTextInputField()
249
249
  .clear();
250
250
  },
251
251
 
252
252
  verifyNoImageAlternativeTextPresentInPreviewTab: () => {
253
- figOverImageCanvasComponent.canvasImageInPreviewTab()
253
+ imageCanvasComponent.canvasImageInPreviewTab()
254
254
  .should('have.attr', 'alt', '');
255
255
  },
256
256
 
257
257
  verifyNoImageAlternativeTextPresentInEditTab: () => {
258
- figOverImageCanvasComponent.canvasImage()
258
+ imageCanvasComponent.canvasImage()
259
259
  .should('have.attr', 'alt', '');
260
260
  },
261
261
 
262
262
  verifyImageFitsToCanvas: () => {
263
- figOverImageCanvasComponent.canvasWidthInputField()
263
+ imageCanvasComponent.canvasWidthInputField()
264
264
  .invoke('attr', 'value')
265
265
  .then((value) => {
266
- figOverImageCanvasComponent.canvasImage().should('have.css', 'width', `${value}px`);
266
+ imageCanvasComponent.canvasImage().should('have.css', 'width', `${value}px`);
267
267
  });
268
268
  },
269
269
 
270
270
  verifyImageDoesNotFitToCanvas: () => {
271
- figOverImageCanvasComponent.canvasHeightInputField()
272
- .invoke('attr', 'value')
273
- .then((value) => {
274
- figOverImageCanvasComponent.canvasImage().should('have.css', 'height', `${value}px`);
271
+ imageCanvasComponent.canvasImage()
272
+ .then(($element) => {
273
+ const imgWidth = $element[0].naturalWidth;
274
+ imageCanvasComponent.canvasImage()
275
+ .should('have.css', 'width', `${imgWidth}px`);
275
276
  });
276
277
  },
277
278
 
278
279
  verifyImageFitsToCanvasInPreviewTab: () => {
279
280
  createQuestionBasePage.steps.switchToEditTab();
280
- figOverImageCanvasComponent.canvasWidthInputField()
281
+ imageCanvasComponent.canvasWidthInputField()
281
282
  .invoke('attr', 'value')
282
283
  .then((value) => {
283
284
  createQuestionBasePage.steps.switchToPreviewTab();
284
- figOverImageCanvasComponent.canvasImageInPreviewTab().should('have.css', 'width', `${value}px`);
285
+ imageCanvasComponent.canvasImageInPreviewTab().should('have.css', 'width', `${value}px`);
285
286
  });
286
287
  },
287
288
 
288
289
  verifyImageDoesNotFitToCanvasInPreviewTab: () => {
289
290
  createQuestionBasePage.steps.switchToEditTab();
290
- figOverImageCanvasComponent.canvasHeightInputField()
291
- .invoke('attr', 'value')
292
- .then((value) => {
291
+ imageCanvasComponent.canvasImage()
292
+ .then(($element) => {
293
+ const imgWidth = $element[0].naturalWidth;
293
294
  createQuestionBasePage.steps.switchToPreviewTab();
294
- figOverImageCanvasComponent.canvasImageInPreviewTab().should('have.css', 'height', `${value}px`);
295
+ imageCanvasComponent.canvasImageInPreviewTab().should('have.css', 'width', `${imgWidth}px`);
295
296
  });
296
297
  },
297
298
 
@@ -300,7 +301,7 @@ const steps = {
300
301
  * @description function updates canvas width in input field
301
302
  */
302
303
  updateCanvasWidth: (width) => {
303
- figOverImageCanvasComponent.canvasWidthInputField()
304
+ imageCanvasComponent.canvasWidthInputField()
304
305
  .clear()
305
306
  .type(width);
306
307
  },
@@ -310,7 +311,7 @@ const steps = {
310
311
  * @description function updates canvas height in input field
311
312
  */
312
313
  updateCanvasHeight: (height) => {
313
- figOverImageCanvasComponent.canvasHeightInputField()
314
+ imageCanvasComponent.canvasHeightInputField()
314
315
  .clear()
315
316
  .type(height);
316
317
  },
@@ -320,7 +321,7 @@ const steps = {
320
321
  * @description this function verifies width of canvas
321
322
  */
322
323
  verifyCanvasWidth: (width) => {
323
- figOverImageCanvasComponent.canvas()
324
+ imageCanvasComponent.canvas()
324
325
  .should('have.attr', 'width', width);
325
326
  },
326
327
 
@@ -329,7 +330,7 @@ const steps = {
329
330
  * @description this function verifies height of canvas
330
331
  */
331
332
  verifyCanvasHeight: (height) => {
332
- figOverImageCanvasComponent.canvas()
333
+ imageCanvasComponent.canvas()
333
334
  .should('have.css', 'height', `${height}px`);
334
335
  },
335
336
 
@@ -338,16 +339,16 @@ const steps = {
338
339
  *@description function verifies button active state
339
340
  */
340
341
  verifyCanvasMenuButtonSelected: (button) => {
341
- if (button == 'Insert dropzone' || button == 'Insert text container') {
342
- figOverImageCanvasComponent.insertResponseAreaButton()
342
+ if (button == 'Insert dropzone' || button == 'Insert text container' || button == 'Insert dropdown') {
343
+ imageCanvasComponent.insertResponseAreaButton()
343
344
  .should('have.class', 'active');
344
345
  }
345
- else if (button == 'Select dropzone' || button == 'Select text container') {
346
- figOverImageCanvasComponent.selectResponseAreaButton()
346
+ else if (button == 'Select dropzone' || button == 'Select text container' || button == 'Select dropdown') {
347
+ imageCanvasComponent.selectResponseAreaButton()
347
348
  .should('have.class', 'active');
348
349
  }
349
350
  else {
350
- figOverImageCanvasComponent.insertTextAreaButton()
351
+ imageCanvasComponent.insertTextAreaButton()
351
352
  .should('have.class', 'active');
352
353
  }
353
354
  },
@@ -357,52 +358,52 @@ const steps = {
357
358
  *@description function selects button
358
359
  */
359
360
  selectCanvasMenuButton: (button) => {
360
- if (button == 'Insert dropzone' || button == 'Insert text container') {
361
- figOverImageCanvasComponent.insertResponseAreaButton()
361
+ if (button == 'Insert dropzone' || button == 'Insert text container' || button == 'Insert dropdown') {
362
+ imageCanvasComponent.insertResponseAreaButton()
362
363
  .click()
363
364
  .should('have.class', 'active');
364
365
  }
365
- else if (button == 'Select dropzone' || button == 'Select text container') {
366
- figOverImageCanvasComponent.selectResponseAreaButton()
366
+ else if (button == 'Select dropzone' || button == 'Select text container' || button == 'Select dropdown') {
367
+ imageCanvasComponent.selectResponseAreaButton()
367
368
  .click()
368
369
  .should('have.class', 'active');
369
370
  }
370
371
  else {
371
- figOverImageCanvasComponent.insertTextAreaButton()
372
+ imageCanvasComponent.insertTextAreaButton()
372
373
  .click()
373
374
  .should('have.class', 'active');
374
375
  }
375
376
  },
376
377
 
377
378
  redoAction: () => {
378
- figOverImageCanvasComponent.redoButton()
379
+ imageCanvasComponent.redoButton()
379
380
  .click();
380
381
  },
381
382
 
382
383
  undoAction: () => {
383
- figOverImageCanvasComponent.undoButton()
384
+ imageCanvasComponent.undoButton()
384
385
  .click();
385
386
  },
386
387
 
387
388
  clearAll: () => {
388
- figOverImageCanvasComponent.clearAllButton()
389
+ imageCanvasComponent.clearAllButton()
389
390
  .click();
390
391
  },
391
392
 
392
393
  verifyUndoButtonDisabled: () => {
393
- utilities.verifyElementDisabled(figOverImageCanvasComponent.undoButton());
394
+ utilities.verifyElementDisabled(imageCanvasComponent.undoButton());
394
395
  },
395
396
 
396
397
  verifyRedoButtonDisabled: () => {
397
- utilities.verifyElementDisabled(figOverImageCanvasComponent.redoButton());
398
+ utilities.verifyElementDisabled(imageCanvasComponent.redoButton());
398
399
  },
399
400
 
400
401
  verifyUndoButtonEnabled: () => {
401
- utilities.verifyElementNotDisabled(figOverImageCanvasComponent.undoButton());
402
+ utilities.verifyElementNotDisabled(imageCanvasComponent.undoButton());
402
403
  },
403
404
 
404
405
  verifyRedoButtonEnabled: () => {
405
- utilities.verifyElementNotDisabled(figOverImageCanvasComponent.redoButton());
406
+ utilities.verifyElementNotDisabled(imageCanvasComponent.redoButton());
406
407
  },
407
408
 
408
409
  /**
@@ -410,7 +411,7 @@ const steps = {
410
411
  * @description function selects response container of a particular index
411
412
  */
412
413
  selectResponseArea: (responseAreaIndex) => {
413
- figOverImageCanvasComponent.responseArea()
414
+ imageCanvasComponent.responseArea()
414
415
  .eq(responseAreaIndex)
415
416
  .click();
416
417
  },
@@ -420,50 +421,51 @@ const steps = {
420
421
  * @description function selects response container pointer style
421
422
  */
422
423
  selectResponseAreaPointerStyle: (style) => {
423
- figOverImageCanvasComponent.responseAreaStyle(style)
424
+ const styleName = style.toLowerCase();
425
+ imageCanvasComponent.responseAreaStyle(styleName)
424
426
  .click();
425
427
  },
426
428
 
427
429
  clickOnCanvasSelectedMenuText: () => {
428
- figOverImageCanvasComponent.canvasSelectedMenuText()
430
+ imageCanvasComponent.canvasSelectedMenuText()
429
431
  .click();
430
432
  },
431
433
 
432
434
  verifyResponseAreaPointerStyle: (style, responseAreaIndex) => {
433
435
  const getPosition = (option) => {
434
436
  switch (option) {
435
- case 'Bottom':
437
+ case 'bottom':
436
438
  return { top: '-31.5px', left: '-37.5px' };
437
- case 'Bottom right':
439
+ case 'bottom right':
438
440
  return { top: '-25px', left: '-40px' };
439
- case 'Right':
441
+ case 'right':
440
442
  return { top: '-21px', left: '-36.5px' };
441
- case 'Top right':
443
+ case 'top right':
442
444
  return { top: '-19px', left: '-31px' };
443
- case 'Top':
445
+ case 'top':
444
446
  return { top: '-22.5px', left: '-25.5px' };
445
- case 'Top left':
447
+ case 'top left':
446
448
  return { top: '-27px', left: '-24px' };
447
- case 'Left':
449
+ case 'left':
448
450
  return { bottom: '-20px', left: '-27px' };
449
- case 'Bottom left':
451
+ case 'bottom left':
450
452
  return { bottom: '-18px', left: '-32px' };
451
453
  }
452
454
  }
453
455
  const expectedPosition = getPosition(style);
454
- if (style == 'Left' || style == 'Bottom left') {
455
- figOverImageCanvasComponent.responseAreaPointer()
456
+ if (style == 'left' || style == 'bottom left') {
457
+ imageCanvasComponent.responseAreaPointer()
456
458
  .eq(responseAreaIndex)
457
459
  .should('have.css', 'bottom', expectedPosition.bottom)
458
460
  .and('have.css', 'left', expectedPosition.left);
459
461
  }
460
- else if (style == 'None') {
461
- figOverImageCanvasComponent.responseArea()
462
+ else if (style == 'none') {
463
+ imageCanvasComponent.responseArea()
462
464
  .parent()
463
465
  .should('not.contain', '[class*="Canvasstyle__PointerWrapper"]');
464
466
  }
465
467
  else {
466
- figOverImageCanvasComponent.responseAreaPointer()
468
+ imageCanvasComponent.responseAreaPointer()
467
469
  .eq(responseAreaIndex)
468
470
  .should('have.css', 'top', expectedPosition.top)
469
471
  .and('have.css', 'left', expectedPosition.left);
@@ -471,55 +473,55 @@ const steps = {
471
473
  },
472
474
 
473
475
  verifyTextBoxNotExistInPreviewTab: () => {
474
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.textBoxInPreviewTab(), 'notExist');
476
+ utilities.verifyElementVisibilityState(imageCanvasComponent.textBoxInPreviewTab(), 'notExist');
475
477
  },
476
478
 
477
479
  verifyTextBoxExistInPreviewTab: () => {
478
- figOverImageCanvasComponent.textBoxInPreviewTab()
480
+ imageCanvasComponent.textBoxInPreviewTab()
479
481
  .should('be.visible');
480
482
  },
481
483
 
482
484
  verifyTextColorOfTextBox: (color) => {
483
- figOverImageCanvasComponent.textResponse()
485
+ imageCanvasComponent.textResponse()
484
486
  .should('have.css', 'color', color);
485
487
  },
486
488
 
487
489
  verifyTextColorOfTextBoxInPreviewTab: (color) => {
488
- figOverImageCanvasComponent.textBoxInPreviewTab()
490
+ imageCanvasComponent.textBoxInPreviewTab()
489
491
  .should('have.css', 'color', color);
490
492
  },
491
493
 
492
494
  verifyTextOfTextBox: (text) => {
493
- figOverImageCanvasComponent.textResponse()
495
+ imageCanvasComponent.textResponse()
494
496
  .invoke('text')
495
497
  .should('eq', text);
496
498
  },
497
499
 
498
500
  verifyTextOfTextBoxInPreviewTab: (text) => {
499
- figOverImageCanvasComponent.textBoxInPreviewTab()
501
+ imageCanvasComponent.textBoxInPreviewTab()
500
502
  .invoke('text')
501
503
  .should('eq', text);
502
504
  },
503
505
 
504
506
  clickOnTextColorButton: () => {
505
- figOverImageCanvasComponent.responseAreaStyle()
507
+ imageCanvasComponent.responseAreaStyle()
506
508
  .click();
507
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.textColorPopupWrapper(), 'visible');
509
+ utilities.verifyElementVisibilityState(imageCanvasComponent.textColorPopupWrapper(), 'visible');
508
510
  },
509
511
 
510
512
  clickOnEditColorButton: () => {
511
- figOverImageCanvasComponent.editColorLabel()
513
+ imageCanvasComponent.editColorLabel()
512
514
  .click();
513
515
  },
514
516
 
515
517
  verifyColorBlockSelectedState: () => {
516
- figOverImageCanvasComponent.selectedColorBlockInTextColorPopup()
518
+ imageCanvasComponent.selectedColorBlockInTextColorPopup()
517
519
  .find('[data-name="Selected card icon"]')
518
520
  .should('be.visible');
519
521
  },
520
522
 
521
523
  verifyColorBlock: (color) => {
522
- figOverImageCanvasComponent.selectedColorBlockInTextColorPopup()
524
+ imageCanvasComponent.selectedColorBlockInTextColorPopup()
523
525
  .should('have.css', 'background-color', color);
524
526
  },
525
527
 
@@ -528,7 +530,7 @@ const steps = {
528
530
  * @param {number} index of the response container to be removed
529
531
  */
530
532
  removeResponseArea: (index) => {
531
- figOverImageCanvasComponent.removeResponseAreaButton()
533
+ imageCanvasComponent.removeResponseAreaButton()
532
534
  .eq(index)
533
535
  .click({ force: true });
534
536
  },
@@ -538,8 +540,8 @@ const steps = {
538
540
  * @description function verifies inner text and visibility of canvas selected menu text
539
541
  */
540
542
  verifyCanvasSelectedMenuText: (selectedMenu) => {
541
- utilities.verifyInnerText(figOverImageCanvasComponent.canvasSelectedMenuText(), selectedMenu);
542
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasSelectedMenuText(), 'visible');
543
+ utilities.verifyInnerText(imageCanvasComponent.canvasSelectedMenuText(), selectedMenu);
544
+ utilities.verifyElementVisibilityState(imageCanvasComponent.canvasSelectedMenuText(), 'visible');
543
545
  },
544
546
 
545
547
  /**
@@ -561,11 +563,11 @@ const steps = {
561
563
  responseAreaPointerStyles.forEach((dropzonePointer, index) => {
562
564
  cy.log('Clicking on canvas Selected Menu Text to hover away from select dropzone button');
563
565
  steps.clickOnCanvasSelectedMenuText();
564
- figOverImageCanvasComponent.responseAreaStyle()
566
+ imageCanvasComponent.responseAreaStyle()
565
567
  .eq(index)
566
568
  .trigger('mouseover', { force: true });
567
569
  utilities.verifyInnerText(commonComponents.tooltipText(), dropzonePointer);
568
- figOverImageCanvasComponent.responseAreaStyle()
570
+ imageCanvasComponent.responseAreaStyle()
569
571
  .eq(index)
570
572
  .trigger('mouseout', { force: true });
571
573
  });
@@ -577,54 +579,54 @@ const tests = {
577
579
 
578
580
  verifyCanvasLabelAndCanvas: () => {
579
581
  it('\'Canvas\' label and canvas should be displayed', () => {
580
- utilities.verifyInnerText(figOverImageCanvasComponent.canvasLabel(), 'Canvas');
581
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasLabel(), 'visible');
582
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvas(), 'visible');
582
+ utilities.verifyInnerText(imageCanvasComponent.canvasLabel(), 'Canvas');
583
+ utilities.verifyElementVisibilityState(imageCanvasComponent.canvasLabel(), 'visible');
584
+ utilities.verifyElementVisibilityState(imageCanvasComponent.canvas(), 'visible');
583
585
  });
584
586
 
585
587
  it('When user uploads background image for canvas, then it should be displayed', () => {
586
588
  backgroundImageUploadComponent.steps.uploadFile('highlightImage.jpg');
587
- figOverImageCanvasComponent.steps.verifyImageIsUploaded();
589
+ imageCanvasComponent.steps.verifyImageIsUploaded();
588
590
  });
589
591
  },
590
592
 
591
593
  verifyInsertTextTooltip: () => {
592
594
  it('When user hovers over insert text button, then \'Insert text\' tooltip should be displayed', () => {
593
- figOverImageCanvasComponent.steps.verifyTooltipInnerText(figOverImageCanvasComponent.insertTextAreaButton, 'Insert text');
595
+ imageCanvasComponent.steps.verifyTooltipInnerText(imageCanvasComponent.insertTextAreaButton, 'Insert text');
594
596
  });
595
597
  },
596
598
 
597
599
  verifyUndoRedoClearAllButtons: () => {
598
600
  it('Undo, redo and clear all buttons should be displayed', () => {
599
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.undoButton(), 'visible');
600
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.redoButton(), 'visible');
601
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.clearAllButton(), 'visible');
601
+ utilities.verifyElementVisibilityState(imageCanvasComponent.undoButton(), 'visible');
602
+ utilities.verifyElementVisibilityState(imageCanvasComponent.redoButton(), 'visible');
603
+ utilities.verifyElementVisibilityState(imageCanvasComponent.clearAllButton(), 'visible');
602
604
  });
603
605
 
604
606
  it('When user hovers over undo button, then \'Undo\' tooltip should be displayed', () => {
605
- utilities.hoverAwayFromElement(figOverImageCanvasComponent.canvasSelectedMenuText());
606
- figOverImageCanvasComponent.steps.verifyTooltipInnerText(figOverImageCanvasComponent.undoButton, 'Undo');
607
+ utilities.hoverAwayFromElement(imageCanvasComponent.canvasSelectedMenuText());
608
+ imageCanvasComponent.steps.verifyTooltipInnerText(imageCanvasComponent.undoButton, 'Undo');
607
609
  });
608
610
 
609
611
  it('When user hovers over clear all button, then \'Clear all\' tooltip should be displayed', () => {
610
- figOverImageCanvasComponent.steps.verifyTooltipInnerText(figOverImageCanvasComponent.clearAllButton, 'Clear all');
612
+ imageCanvasComponent.steps.verifyTooltipInnerText(imageCanvasComponent.clearAllButton, 'Clear all');
611
613
  });
612
614
 
613
615
  it('When user hovers over redo button, then \'Redo\' tooltip should be displayed', () => {
614
- utilities.hoverAwayFromElement(figOverImageCanvasComponent.undoButton());
615
- figOverImageCanvasComponent.steps.verifyTooltipInnerText(figOverImageCanvasComponent.redoButton, 'Redo');
616
+ utilities.hoverAwayFromElement(imageCanvasComponent.undoButton());
617
+ imageCanvasComponent.steps.verifyTooltipInnerText(imageCanvasComponent.redoButton, 'Redo');
616
618
  });
617
619
  },
618
620
 
619
621
  verifyCanvasResponseAreaContents: () => {
620
622
  it('When user clicks inside canvas, then one response container should be added with pointer, close button and numeration.', () => {
621
- figOverImageCanvasComponent.steps.insertResponseArea(80);
622
- utilities.verifyElementCount(figOverImageCanvasComponent.responseAreaWrapper(), 1);
623
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseArea(), 'visible');
624
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseAreaPointer(), 'visible');
625
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.removeResponseAreaButton(), 'visible');
626
- utilities.verifyInnerText(figOverImageCanvasComponent.responseAreaNumerationText(), '1');
627
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseAreaNumerationText(), 'visible');
623
+ imageCanvasComponent.steps.insertResponseArea(80);
624
+ utilities.verifyElementCount(imageCanvasComponent.responseAreaWrapper(), 1);
625
+ utilities.verifyElementVisibilityState(imageCanvasComponent.responseArea(), 'visible');
626
+ utilities.verifyElementVisibilityState(imageCanvasComponent.responseAreaPointer(), 'visible');
627
+ utilities.verifyElementVisibilityState(imageCanvasComponent.removeResponseAreaButton(), 'visible');
628
+ utilities.verifyInnerText(imageCanvasComponent.responseAreaNumerationText(), '1');
629
+ utilities.verifyElementVisibilityState(imageCanvasComponent.responseAreaNumerationText(), 'visible');
628
630
  });
629
631
  },
630
632
 
@@ -633,29 +635,29 @@ const tests = {
633
635
  */
634
636
  verifyInsertAndDeleteResponseAreaFunctionality: (response) => {
635
637
  it(`When user clicks on close button for response container, then response container should be removed from canvas and error message 'Error: Please insert a ${response}.' should be displayed`, () => {
636
- figOverImageCanvasComponent.steps.removeResponseArea(0);
637
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseAreaWrapper(), 'notExist');
638
+ imageCanvasComponent.steps.removeResponseArea(0);
639
+ utilities.verifyElementVisibilityState(imageCanvasComponent.responseAreaWrapper(), 'notExist');
638
640
  utilities.verifyInnerText(commonComponents.errorMessage(), `Error: Please insert a ${response}.`);
639
641
  utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
640
642
  });
641
643
 
642
644
  it('When user adds response container, then error message should disappear', () => {
643
- figOverImageCanvasComponent.steps.insertResponseArea(80);
645
+ imageCanvasComponent.steps.insertResponseArea(80);
644
646
  commonComponents.steps.verifyErrorMessageIsNotDisplayed();
645
647
  });
646
648
 
647
649
  it('User should be able to add maximum 20 multiple response containers inside canvas', () => {
648
650
  for (let i = 0; i < 21; i++) {
649
- figOverImageCanvasComponent.steps.insertResponseArea(i * 2);
651
+ imageCanvasComponent.steps.insertResponseArea(i * 2);
650
652
  }
651
- utilities.verifyElementCount(figOverImageCanvasComponent.responseAreaWrapper(), 20);
653
+ utilities.verifyElementCount(imageCanvasComponent.responseAreaWrapper(), 20);
652
654
  });
653
655
 
654
656
  it('When user clicks on close button for a response container, then response container should disappear and numeration for existing response containers should be changed appropriately', () => {
655
- figOverImageCanvasComponent.steps.removeResponseArea(0);
656
- utilities.verifyElementCount(figOverImageCanvasComponent.responseAreaWrapper(), 19);
657
+ imageCanvasComponent.steps.removeResponseArea(0);
658
+ utilities.verifyElementCount(imageCanvasComponent.responseAreaWrapper(), 19);
657
659
  for (let i = 0; i < 19; i++) {
658
- utilities.verifyInnerText(utilities.getNthElement(figOverImageCanvasComponent.responseAreaNumerationText(), i), `${i + 1}`);
660
+ utilities.verifyInnerText(utilities.getNthElement(imageCanvasComponent.responseAreaNumerationText(), i), `${i + 1}`);
659
661
  }
660
662
  });
661
663
  },
@@ -665,53 +667,53 @@ const tests = {
665
667
  */
666
668
  verifyUndoRedoClearAllButtonFunctionality: (response) => {
667
669
  it('When the user has not made any changes in the canvas, the \'Undo\' and \'Redo\' button should be in disabled state', () => {
668
- figOverImageCanvasComponent.steps.verifyUndoButtonDisabled();
669
- figOverImageCanvasComponent.steps.verifyRedoButtonDisabled();
670
+ imageCanvasComponent.steps.verifyUndoButtonDisabled();
671
+ imageCanvasComponent.steps.verifyRedoButtonDisabled();
670
672
  });
671
673
 
672
674
  it('When user adds dropzone inside canvas, the \'Undo\' button should get enabled but the \'Redo\' button should continue to stay in disabled state', () => {
673
- figOverImageCanvasComponent.steps.insertResponseArea(80);
674
- figOverImageCanvasComponent.steps.insertResponseArea(20);
675
- figOverImageCanvasComponent.steps.insertResponseArea(30);
676
- figOverImageCanvasComponent.steps.insertResponseArea(40);
677
- figOverImageCanvasComponent.steps.verifyUndoButtonEnabled();
678
- figOverImageCanvasComponent.steps.verifyRedoButtonDisabled();
675
+ imageCanvasComponent.steps.insertResponseArea(80);
676
+ imageCanvasComponent.steps.insertResponseArea(20);
677
+ imageCanvasComponent.steps.insertResponseArea(30);
678
+ imageCanvasComponent.steps.insertResponseArea(40);
679
+ imageCanvasComponent.steps.verifyUndoButtonEnabled();
680
+ imageCanvasComponent.steps.verifyRedoButtonDisabled();
679
681
  });
680
682
 
681
683
  it('When the user clicks on the \'Undo\' button, then previous action should be reversed and redo button should be in enabled state', () => {
682
- figOverImageCanvasComponent.steps.undoAction();
683
- utilities.verifyElementCount(figOverImageCanvasComponent.responseArea(), 3);
684
- utilities.verifyElementNotDisabled(figOverImageCanvasComponent.redoButton());
684
+ imageCanvasComponent.steps.undoAction();
685
+ utilities.verifyElementCount(imageCanvasComponent.responseArea(), 3);
686
+ utilities.verifyElementNotDisabled(imageCanvasComponent.redoButton());
685
687
  });
686
688
 
687
689
  it('When the user clicks on the redo button, then previous action should be reinstated and redo button should be disabled', () => {
688
- figOverImageCanvasComponent.steps.redoAction()
689
- utilities.verifyElementCount(figOverImageCanvasComponent.responseArea(), 4);
690
- figOverImageCanvasComponent.steps.verifyRedoButtonDisabled();
690
+ imageCanvasComponent.steps.redoAction()
691
+ utilities.verifyElementCount(imageCanvasComponent.responseArea(), 4);
692
+ imageCanvasComponent.steps.verifyRedoButtonDisabled();
691
693
  });
692
694
 
693
695
  it(`When the user reaches the initial state by performing undo actions, the \'Undo\' button should get disabled and error message \'Error: Please insert a ${response}.\' should be displayed`, () => {
694
696
  for (var i = 0; i < 4; i++) {
695
- figOverImageCanvasComponent.steps.undoAction();
697
+ imageCanvasComponent.steps.undoAction();
696
698
  }
697
- utilities.verifyElementCount(figOverImageCanvasComponent.responseArea(), 0);
698
- figOverImageCanvasComponent.steps.verifyUndoButtonDisabled();
699
+ utilities.verifyElementCount(imageCanvasComponent.responseArea(), 0);
700
+ imageCanvasComponent.steps.verifyUndoButtonDisabled();
699
701
  utilities.verifyInnerText(commonComponents.errorMessage(), `Error: Please insert a ${response}.`);
700
702
  utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
701
703
  });
702
704
 
703
705
  it('When the user reaches the latest state by performing redo actions, the \'Redo\' button should get disabled and error message should disappear', () => {
704
706
  for (var i = 0; i < 4; i++) {
705
- figOverImageCanvasComponent.steps.redoAction();
707
+ imageCanvasComponent.steps.redoAction();
706
708
  }
707
- utilities.verifyElementCount(figOverImageCanvasComponent.responseArea(), 4);
708
- figOverImageCanvasComponent.steps.verifyRedoButtonDisabled();
709
+ utilities.verifyElementCount(imageCanvasComponent.responseArea(), 4);
710
+ imageCanvasComponent.steps.verifyRedoButtonDisabled();
709
711
  commonComponents.steps.verifyErrorMessageIsNotDisplayed();
710
712
  });
711
713
 
712
714
  it(`When user clicks on \'Clear all\' button, then all response container should be deleted and error message 'Error: Please insert a ${response}.' should be displayed`, () => {
713
- figOverImageCanvasComponent.steps.clearAll();
714
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseAreaWrapper(), 'notExist');
715
+ imageCanvasComponent.steps.clearAll();
716
+ utilities.verifyElementVisibilityState(imageCanvasComponent.responseAreaWrapper(), 'notExist');
715
717
  utilities.verifyInnerText(commonComponents.errorMessage(), `Error: Please insert a ${response}.`);
716
718
  utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
717
719
  });
@@ -719,53 +721,53 @@ const tests = {
719
721
 
720
722
  verifyInsertTextAndTextColorButton: () => {
721
723
  it('When user clicks on \'Insert text\' button, then \'Text\' menu label and \'Text color\' icon should be displayed.', () => {
722
- figOverImageCanvasComponent.steps.selectCanvasMenuButton('Insert text');
724
+ imageCanvasComponent.steps.selectCanvasMenuButton('Insert text');
723
725
  cy.log('Clicking on canvas Selected Menu Text to hover away from select dropzone button');
724
- figOverImageCanvasComponent.steps.clickOnCanvasSelectedMenuText();
725
- figOverImageCanvasComponent.steps.verifyCanvasSelectedMenuText('Text');
726
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseAreaStyle(), 'visible');
726
+ imageCanvasComponent.steps.clickOnCanvasSelectedMenuText();
727
+ imageCanvasComponent.steps.verifyCanvasSelectedMenuText('Text');
728
+ utilities.verifyElementVisibilityState(imageCanvasComponent.responseAreaStyle(), 'visible');
727
729
  });
728
730
 
729
731
  it('\'Text color\' button should be in disabled state.', () => {
730
- utilities.verifyElementDisabled(figOverImageCanvasComponent.responseAreaStyle());
732
+ utilities.verifyElementDisabled(imageCanvasComponent.responseAreaStyle());
731
733
  });
732
734
 
733
735
  it('When user hovers over \'Text color\' button, then \'Text color\' tooltip should be displayed.', () => {
734
- figOverImageCanvasComponent.steps.verifyTooltipInnerText(figOverImageCanvasComponent.responseAreaStyle, 'Text color');
736
+ imageCanvasComponent.steps.verifyTooltipInnerText(imageCanvasComponent.responseAreaStyle, 'Text color');
735
737
  });
736
738
  },
737
739
 
738
740
  verifyTextColorPopupFunctionality: () => {
739
741
  it('When user clicks inside the canvas, then text box should be displayed and \'Text color\' button should be enabled', () => {
740
- figOverImageCanvasComponent.steps.insertTextArea(80, 'Inserted text');
741
- figOverImageCanvasComponent.steps.verifyTextOfTextBox('Inserted text');
742
- utilities.verifyElementNotDisabled(figOverImageCanvasComponent.responseAreaStyle());
742
+ imageCanvasComponent.steps.insertTextArea(80, 'Inserted text');
743
+ imageCanvasComponent.steps.verifyTextOfTextBox('Inserted text');
744
+ utilities.verifyElementNotDisabled(imageCanvasComponent.responseAreaStyle());
743
745
  });
744
746
 
745
747
  it('Text color of text inside text box should be black by default', () => {
746
- figOverImageCanvasComponent.steps.verifyTextColorOfTextBox('rgb(0, 0, 46)');
748
+ imageCanvasComponent.steps.verifyTextColorOfTextBox('rgb(0, 0, 46)');
747
749
  });
748
750
 
749
751
  it('When user clicks on \'Text color\' button, \'Text color\' popup should be displayed.', () => {
750
- figOverImageCanvasComponent.steps.clickOnTextColorButton();
751
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.textColorPopupWrapper(), 'visible');
752
- utilities.verifyInnerText(figOverImageCanvasComponent.textColorLabelInTextColorPopup(), 'Text color');
753
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.textColorLabelInTextColorPopup(), 'visible');
752
+ imageCanvasComponent.steps.clickOnTextColorButton();
753
+ utilities.verifyElementVisibilityState(imageCanvasComponent.textColorPopupWrapper(), 'visible');
754
+ utilities.verifyInnerText(imageCanvasComponent.textColorLabelInTextColorPopup(), 'Text color');
755
+ utilities.verifyElementVisibilityState(imageCanvasComponent.textColorLabelInTextColorPopup(), 'visible');
754
756
  });
755
757
 
756
758
  it('\'Edit color\' label and Black color block should be displayed in selected state in the popup', () => {
757
- utilities.verifyInnerText(figOverImageCanvasComponent.editColorLabel(), 'Edit color');
758
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.editColorLabel(), 'visible');
759
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.selectedColorBlockInTextColorPopup(), 'visible');
760
- figOverImageCanvasComponent.steps.verifyColorBlock('rgb(0, 0, 46)');
761
- figOverImageCanvasComponent.steps.verifyColorBlockSelectedState();
759
+ utilities.verifyInnerText(imageCanvasComponent.editColorLabel(), 'Edit color');
760
+ utilities.verifyElementVisibilityState(imageCanvasComponent.editColorLabel(), 'visible');
761
+ utilities.verifyElementVisibilityState(imageCanvasComponent.selectedColorBlockInTextColorPopup(), 'visible');
762
+ imageCanvasComponent.steps.verifyColorBlock('rgb(0, 0, 46)');
763
+ imageCanvasComponent.steps.verifyColorBlockSelectedState();
762
764
  });
763
765
  },
764
766
 
765
767
  verifySelectColorPopupContentAndFunctionality: () => {
766
768
 
767
769
  it('When the user clicks on the \'Edit color\' present in an \'Text color\' popup, then a select color popup should be displayed', () => {
768
- figOverImageCanvasComponent.steps.clickOnEditColorButton();
770
+ imageCanvasComponent.steps.clickOnEditColorButton();
769
771
  colorPopupComponent.steps.verifyColorPopupIsDisplayed();
770
772
  });
771
773
 
@@ -836,19 +838,19 @@ const tests = {
836
838
 
837
839
  verifyImagePropertiesSectionContent: () => {
838
840
  it('\'Image properties\' label should be displayed.', () => {
839
- utilities.verifyInnerText(figOverImageCanvasComponent.imagePropertiesLabel(), 'Image properties');
840
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.imagePropertiesLabel(), 'visible');
841
+ utilities.verifyInnerText(imageCanvasComponent.imagePropertiesLabel(), 'Image properties');
842
+ utilities.verifyElementVisibilityState(imageCanvasComponent.imagePropertiesLabel(), 'visible');
841
843
  });
842
844
 
843
845
  it('\'Fill image to canvas\' label and checkbox should be displayed and checkbox should be unchecked by default', () => {
844
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.fillImageToCanvasLabel(), 'visible');
845
- utilities.verifyInnerText(figOverImageCanvasComponent.fillImageToCanvasLabel(), 'Fill image to canvas');
846
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.fillImageToCanvasCheckbox(), 'exist');
847
- figOverImageCanvasComponent.steps.verifyFillImageToCanvasCheckboxUnchecked();
846
+ utilities.verifyElementVisibilityState(imageCanvasComponent.fillImageToCanvasLabel(), 'visible');
847
+ utilities.verifyInnerText(imageCanvasComponent.fillImageToCanvasLabel(), 'Fill image to canvas');
848
+ utilities.verifyElementVisibilityState(imageCanvasComponent.fillImageToCanvasCheckbox(), 'exist');
849
+ imageCanvasComponent.steps.verifyFillImageToCanvasCheckboxUnchecked();
848
850
  });
849
851
 
850
852
  it('User should be able to check \'Fill image to canvas\' checkbox', () => {
851
- figOverImageCanvasComponent.steps.checkFillImageToCanvasCheckbox();
853
+ imageCanvasComponent.steps.checkFillImageToCanvasCheckbox();
852
854
  });
853
855
 
854
856
  it('\'Lock aspect ratio\' and \'Reset dimensions\' buttons should be displayed and by default \'Lock aspect ratio\' button should be locked', () => {
@@ -857,215 +859,215 @@ const tests = {
857
859
  });
858
860
 
859
861
  it('\'Image alignment\' label should be displayed. ', () => {
860
- utilities.verifyInnerText(figOverImageCanvasComponent.imageAlignmentLabel(), 'Image alignment');
861
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.imageAlignmentLabel(), 'visible');
862
+ utilities.verifyInnerText(imageCanvasComponent.imageAlignmentLabel(), 'Image alignment');
863
+ utilities.verifyElementVisibilityState(imageCanvasComponent.imageAlignmentLabel(), 'visible');
862
864
  });
863
865
 
864
866
  it(`\'Image alignment\' section should have three options ${alignmentOptions} and ${alignmentOptions[0]} should be active selection by default`, () => {
865
- utilities.verifyInnerText(figOverImageCanvasComponent.topLeftAlignmentButton(), 'Top left');
866
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.topLeftAlignmentButton(), 'visible');
867
- utilities.verifyInnerText(figOverImageCanvasComponent.centerAlignmentButton(), 'Center');
868
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.centerAlignmentButton(), 'visible');
869
- utilities.verifyInnerText(figOverImageCanvasComponent.topRightAlignmentButton(), 'Top right');
870
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.topRightAlignmentButton(), 'visible');
871
- figOverImageCanvasComponent.steps.verifyCanvasImageTopLeftAligned();
867
+ utilities.verifyInnerText(imageCanvasComponent.topLeftAlignmentButton(), 'Top left');
868
+ utilities.verifyElementVisibilityState(imageCanvasComponent.topLeftAlignmentButton(), 'visible');
869
+ utilities.verifyInnerText(imageCanvasComponent.centerAlignmentButton(), 'Center');
870
+ utilities.verifyElementVisibilityState(imageCanvasComponent.centerAlignmentButton(), 'visible');
871
+ utilities.verifyInnerText(imageCanvasComponent.topRightAlignmentButton(), 'Top right');
872
+ utilities.verifyElementVisibilityState(imageCanvasComponent.topRightAlignmentButton(), 'visible');
873
+ imageCanvasComponent.steps.verifyCanvasImageTopLeftAligned();
872
874
  });
873
875
 
874
876
  it('\'Image alternative text\' label and input field should be displayed. By default input field should be empty', () => {
875
- utilities.verifyInnerText(figOverImageCanvasComponent.imageAlternativeTextLabel(), 'Image alternative text');
876
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.imageAlternativeTextLabel(), 'visible');
877
- utilities.verifyInnerText(figOverImageCanvasComponent.imageAlternativeTextInputField(), '');
878
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.imageAlternativeTextInputField(), 'exist');
877
+ utilities.verifyInnerText(imageCanvasComponent.imageAlternativeTextLabel(), 'Image alternative text');
878
+ utilities.verifyElementVisibilityState(imageCanvasComponent.imageAlternativeTextLabel(), 'visible');
879
+ utilities.verifyInnerText(imageCanvasComponent.imageAlternativeTextInputField(), '');
880
+ utilities.verifyElementVisibilityState(imageCanvasComponent.imageAlternativeTextInputField(), 'exist');
879
881
  });
880
882
 
881
883
  it('User should be able to enter text in \'Image alternative text\' input field', () => {
882
- figOverImageCanvasComponent.steps.enterAndVerifyImageAlternativeTextInInputField('Image description');
884
+ imageCanvasComponent.steps.enterAndVerifyImageAlternativeTextInInputField('Image description');
883
885
  });
884
886
  },
885
887
 
886
888
  verifyImageAlignmentEditTabFunctionality: () => {
887
889
  it('When \'Top left\' image alignment is selected by default, then image should be aligned to top left inside the canvas', () => {
888
- figOverImageCanvasComponent.steps.verifyCanvasImageTopLeftAligned();
890
+ imageCanvasComponent.steps.verifyCanvasImageTopLeftAligned();
889
891
  });
890
892
 
891
893
  it('When user selects \'Center\' image alignment, then image should be aligned to center inside the canvas', () => {
892
- figOverImageCanvasComponent.steps.selectCenterImageAlignment();
893
- figOverImageCanvasComponent.steps.verifyCanvasImageCenterAligned();
894
+ imageCanvasComponent.steps.selectCenterImageAlignment();
895
+ imageCanvasComponent.steps.verifyCanvasImageCenterAligned();
894
896
  });
895
897
 
896
898
  it('When user selects \'Top right\' image alignment, then image should be aligned to top right inside the canvas', () => {
897
- figOverImageCanvasComponent.steps.selectTopRightImageAlignment();
898
- figOverImageCanvasComponent.steps.verifyCanvasImageTopRightAligned();
899
+ imageCanvasComponent.steps.selectTopRightImageAlignment();
900
+ imageCanvasComponent.steps.verifyCanvasImageTopRightAligned();
899
901
  });
900
902
 
901
903
  it('When user selects \'Top left\' image alignment again, then image should be aligned to top left inside the canvas', () => {
902
- figOverImageCanvasComponent.steps.selectTopLeftImageAlignment();
903
- figOverImageCanvasComponent.steps.verifyCanvasImageTopLeftAligned();
904
+ imageCanvasComponent.steps.selectTopLeftImageAlignment();
905
+ imageCanvasComponent.steps.verifyCanvasImageTopLeftAligned();
904
906
  });
905
907
  },
906
908
 
907
909
  verifyFillImageToCanvasEditTabFunctionality: () => {
908
910
  it('When user checks \'Fill image to canvas\' checkbox, then image should be adjusted to fit inside the canvas', () => {
909
- figOverImageCanvasComponent.steps.checkFillImageToCanvasCheckbox();
910
- figOverImageCanvasComponent.steps.verifyImageFitsToCanvas();
911
+ imageCanvasComponent.steps.checkFillImageToCanvasCheckbox();
912
+ imageCanvasComponent.steps.verifyImageFitsToCanvas();
911
913
  });
912
914
 
913
915
  it('When user unchecks \'Fill image to canvas\' checkbox, then image dimensions should set to default state', () => {
914
- figOverImageCanvasComponent.steps.uncheckFillImageToCanvasCheckbox();
915
- figOverImageCanvasComponent.steps.verifyImageDoesNotFitToCanvas();
916
+ imageCanvasComponent.steps.uncheckFillImageToCanvasCheckbox();
917
+ imageCanvasComponent.steps.verifyImageDoesNotFitToCanvas();
916
918
  });
917
919
  },
918
920
 
919
921
  verifyAspectRatioAndResetDimensionsButtonFunctionality: () => {
920
922
  it('When aspect ratio is unlocked and user changes the value in width input field, the height input field should remain unchanged and the dimensions should be updated in the image popup preview section', () => {
921
- figOverImageCanvasComponent.steps.unlockAspectRatio();
922
- figOverImageCanvasComponent.steps.updateCanvasWidth(500);
923
- figOverImageCanvasComponent.steps.verifyCanvasWidth(500);
924
- figOverImageCanvasComponent.steps.verifyCanvasHeight(432);
923
+ imageCanvasComponent.steps.unlockAspectRatio();
924
+ imageCanvasComponent.steps.updateCanvasWidth(500);
925
+ imageCanvasComponent.steps.verifyCanvasWidth(500);
926
+ imageCanvasComponent.steps.verifyCanvasHeight(432);
925
927
  });
926
928
 
927
929
  it('When aspect ratio is unlocked and user changes the value in height input field, then width input field should remain unchanged and the dimensions should be updated in the image popup preview section', () => {
928
- figOverImageCanvasComponent.steps.updateCanvasHeight(500);
929
- figOverImageCanvasComponent.steps.verifyCanvasHeight(500);
930
- figOverImageCanvasComponent.steps.verifyCanvasWidth(500);
930
+ imageCanvasComponent.steps.updateCanvasHeight(500);
931
+ imageCanvasComponent.steps.verifyCanvasHeight(500);
932
+ imageCanvasComponent.steps.verifyCanvasWidth(500);
931
933
  });
932
934
 
933
935
  it('When user locks the aspect ratio button and changes the value in the width input field, the height input field should be updated accordingly to maintain the updated aspect ratio', () => {
934
- figOverImageCanvasComponent.steps.lockAspectRatio();
935
- figOverImageCanvasComponent.steps.updateCanvasWidth(800);
936
- figOverImageCanvasComponent.steps.verifyCanvasHeight(450);
936
+ imageCanvasComponent.steps.lockAspectRatio();
937
+ imageCanvasComponent.steps.updateCanvasWidth(800);
938
+ imageCanvasComponent.steps.verifyCanvasHeight(450);
937
939
  });
938
940
 
939
941
  it('When user selects the \'Reset dimensions\' button the height and width should reset to the original values', () => {
940
- figOverImageCanvasComponent.steps.resetDimensions();
941
- figOverImageCanvasComponent.steps.verifyCanvasWidth(768);
942
- figOverImageCanvasComponent.steps.verifyCanvasHeight(432);
942
+ imageCanvasComponent.steps.resetDimensions();
943
+ imageCanvasComponent.steps.verifyCanvasWidth(768);
944
+ imageCanvasComponent.steps.verifyCanvasHeight(432);
943
945
  });
944
946
  },
945
947
 
946
948
  verifyImageAlternativeTextEditTabFunctionality: () => {
947
949
  it('When user enters text in the \'Alternative text\' input field, then alternative text should be displayed for canvas image', () => {
948
- figOverImageCanvasComponent.steps.enterAndVerifyImageAlternativeTextInInputField('This is Alternative text for image');
949
- figOverImageCanvasComponent.steps.verifyImageAlternativeTextPresentInEditTab('This is Alternative text for image');
950
+ imageCanvasComponent.steps.enterAndVerifyImageAlternativeTextInInputField('This is Alternative text for image');
951
+ imageCanvasComponent.steps.verifyImageAlternativeTextPresentInEditTab('This is Alternative text for image');
950
952
  });
951
953
 
952
- it('When user clears text in the \'Alternative text\' input field, then alternative text should not be displayed for canvas image', () => {
953
- figOverImageCanvasComponent.steps.clearImageAlternativeTextInputFieldText();
954
- figOverImageCanvasComponent.steps.verifyNoImageAlternativeTextPresentInEditTab();
954
+ it('When user clears text in the \'Alternative text\' input field, then default alternative text should be displayed for canvas image', () => {
955
+ imageCanvasComponent.steps.clearImageAlternativeTextInputFieldText();
956
+ imageCanvasComponent.steps.verifyDefaultImageAlternativeTextPresentInEditTab();
955
957
  });
956
958
  },
957
959
 
958
960
  verifyImageAlignmentPreviewTabFunctionality: () => {
959
961
  it('When \'Top left\' image alignment is selected by default, then in preview tab canvas image should be aligned to top left', () => {
960
- figOverImageCanvasComponent.steps.switchToPreviewTab();
961
- figOverImageCanvasComponent.steps.verifyImageIsUploadedInPreviewTab();
962
- figOverImageCanvasComponent.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
962
+ imageCanvasComponent.steps.switchToPreviewTab();
963
+ imageCanvasComponent.steps.verifyImageIsUploadedInPreviewTab();
964
+ imageCanvasComponent.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
963
965
  });
964
966
 
965
967
  it('When user selects \'Center\' image alignment in edit tab, then canvas image should be aligned to center in preview tab ', () => {
966
- figOverImageCanvasComponent.steps.switchToEditTab();
967
- figOverImageCanvasComponent.steps.selectCenterImageAlignment();
968
- figOverImageCanvasComponent.steps.switchToPreviewTab();
969
- figOverImageCanvasComponent.steps.verifyCanvasImageCenterAlignedInPreviewTab();
968
+ imageCanvasComponent.steps.switchToEditTab();
969
+ imageCanvasComponent.steps.selectCenterImageAlignment();
970
+ imageCanvasComponent.steps.switchToPreviewTab();
971
+ imageCanvasComponent.steps.verifyCanvasImageCenterAlignedInPreviewTab();
970
972
  });
971
973
 
972
974
  it('When user selects \'Top right\' image alignment, then canvas image should be aligned to top right in preview tab', () => {
973
- figOverImageCanvasComponent.steps.switchToEditTab();
974
- figOverImageCanvasComponent.steps.selectTopRightImageAlignment();
975
- figOverImageCanvasComponent.steps.switchToPreviewTab();
976
- figOverImageCanvasComponent.steps.verifyCanvasImageTopRightAlignedInPreviewTab();
975
+ imageCanvasComponent.steps.switchToEditTab();
976
+ imageCanvasComponent.steps.selectTopRightImageAlignment();
977
+ imageCanvasComponent.steps.switchToPreviewTab();
978
+ imageCanvasComponent.steps.verifyCanvasImageTopRightAlignedInPreviewTab();
977
979
  });
978
980
 
979
981
  it('When user selects \'Top left\' image alignment again, then image should be aligned to top left inside the canvas in preview tab', () => {
980
- figOverImageCanvasComponent.steps.switchToEditTab();
981
- figOverImageCanvasComponent.steps.selectTopLeftImageAlignment();
982
- figOverImageCanvasComponent.steps.switchToPreviewTab();
983
- figOverImageCanvasComponent.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
982
+ imageCanvasComponent.steps.switchToEditTab();
983
+ imageCanvasComponent.steps.selectTopLeftImageAlignment();
984
+ imageCanvasComponent.steps.switchToPreviewTab();
985
+ imageCanvasComponent.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
984
986
  });
985
987
  },
986
988
 
987
989
  verifyFillImageToCanvasPreviewTabFunctionality: () => {
988
990
  it('When user checks \'Fill image to canvas\' checkbox in edit tab, then image should be adjusted to fit inside the canvas in preview tab', () => {
989
- figOverImageCanvasComponent.steps.switchToEditTab();
990
- figOverImageCanvasComponent.steps.checkFillImageToCanvasCheckbox(); figOverImageCanvasComponent.steps.switchToPreviewTab();
991
- figOverImageCanvasComponent.steps.verifyImageFitsToCanvasInPreviewTab();
991
+ imageCanvasComponent.steps.switchToEditTab();
992
+ imageCanvasComponent.steps.checkFillImageToCanvasCheckbox(); imageCanvasComponent.steps.switchToPreviewTab();
993
+ imageCanvasComponent.steps.verifyImageFitsToCanvasInPreviewTab();
992
994
  });
993
995
 
994
996
  // Failed due to https://redmine.zeuslearning.com/issues/556897
995
997
  it('When user unchecks \'Fill image to canvas\' checkbox, then image dimensions should set to default state in preview tab', () => {
996
- figOverImageCanvasComponent.steps.switchToEditTab();
997
- figOverImageCanvasComponent.steps.uncheckFillImageToCanvasCheckbox();
998
- figOverImageCanvasComponent.steps.switchToPreviewTab();
999
- figOverImageCanvasComponent.steps.verifyImageDoesNotFitToCanvas();
998
+ imageCanvasComponent.steps.switchToEditTab();
999
+ imageCanvasComponent.steps.uncheckFillImageToCanvasCheckbox();
1000
+ imageCanvasComponent.steps.switchToPreviewTab();
1001
+ imageCanvasComponent.steps.verifyImageDoesNotFitToCanvas();
1000
1002
  });
1001
1003
  },
1002
1004
 
1003
1005
  verifyImageAlternativeTextPreviewTabFunctionality: () => {
1004
1006
  it('When user enters text in the \'Alternative text\' input field, then alternative text should be displayed in the \'Preview tab\'', () => {
1005
- figOverImageCanvasComponent.steps.switchToEditTab();
1006
- figOverImageCanvasComponent.steps.enterAndVerifyImageAlternativeTextInInputField('This is Alternative text for image');
1007
+ imageCanvasComponent.steps.switchToEditTab();
1008
+ imageCanvasComponent.steps.enterAndVerifyImageAlternativeTextInInputField('This is Alternative text for image');
1007
1009
  cy.log('Switching to Preview Tab');
1008
- figOverImageCanvasComponent.steps.switchToPreviewTab();
1009
- figOverImageCanvasComponent.steps.verifyImageAlternativeTextInPreviewTab('This is Alternative text for image');
1010
+ imageCanvasComponent.steps.switchToPreviewTab();
1011
+ imageCanvasComponent.steps.verifyImageAlternativeTextInPreviewTab('This is Alternative text for image');
1010
1012
  });
1011
1013
 
1012
- it('When user clears text in the \'Alternative text\' input field, then alternative text should not be displayed in the \'Preview tab\'', () => {
1013
- figOverImageCanvasComponent.steps.switchToEditTab();
1014
- figOverImageCanvasComponent.steps.clearImageAlternativeTextInputFieldText();
1015
- figOverImageCanvasComponent.steps.switchToPreviewTab();
1016
- figOverImageCanvasComponent.steps.verifyNoImageAlternativeTextPresentInPreviewTab();
1014
+ it('When user clears text in the \'Alternative text\' input field, then default alternative text should be displayed in the \'Preview tab\'', () => {
1015
+ imageCanvasComponent.steps.switchToEditTab();
1016
+ imageCanvasComponent.steps.clearImageAlternativeTextInputFieldText();
1017
+ imageCanvasComponent.steps.switchToPreviewTab();
1018
+ imageCanvasComponent.steps.verifyDefaultImageAlternativeTextPresentInPreviewTab();
1017
1019
  });
1018
1020
  },
1019
1021
 
1020
1022
  verifyImageOpacityPreviewTabFunctionality: () => {
1021
1023
  it('When opacity is 100 percent by default, then canvas image should have 100 percent opacity in preview tab ', () => {
1022
- figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImageInPreviewTab(100);
1024
+ imageCanvasComponent.steps.verifyOpacityValueForCanvasImageInPreviewTab(100);
1023
1025
  });
1024
1026
 
1025
1027
  it('When user changes opacity slider value in edit tab, then opacity for canvas image should change accordingly in preview tab ', () => {
1026
- figOverImageCanvasComponent.steps.switchToEditTab();
1027
- figOverImageCanvasComponent.steps.clickActionOnOpacitySlider();
1028
- figOverImageCanvasComponent.steps.switchToPreviewTab();
1029
- figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImageInPreviewTab(50);
1028
+ imageCanvasComponent.steps.switchToEditTab();
1029
+ imageCanvasComponent.steps.clickActionOnOpacitySlider();
1030
+ imageCanvasComponent.steps.switchToPreviewTab();
1031
+ imageCanvasComponent.steps.verifyOpacityValueForCanvasImageInPreviewTab(50);
1030
1032
  });
1031
1033
 
1032
1034
  it('When user changes opacity input field value in edit tab, then opacity for canvas image should change accordingly in preview tab ', () => {
1033
- figOverImageCanvasComponent.steps.switchToEditTab();
1034
- figOverImageCanvasComponent.steps.enterInputToOpacityInputField(40);
1035
- figOverImageCanvasComponent.steps.switchToPreviewTab();
1036
- figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImageInPreviewTab(40);
1035
+ imageCanvasComponent.steps.switchToEditTab();
1036
+ imageCanvasComponent.steps.enterInputToOpacityInputField(40);
1037
+ imageCanvasComponent.steps.switchToPreviewTab();
1038
+ imageCanvasComponent.steps.verifyOpacityValueForCanvasImageInPreviewTab(40);
1037
1039
  });
1038
1040
  },
1039
1041
 
1040
1042
  verifyImageOpacityEditTabFunctionality: () => {
1041
1043
  it('When opacity value is set to 100 percent by default, then opacity for image should be100 percent inside canvas', () => {
1042
- figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImage(100);
1044
+ imageCanvasComponent.steps.verifyOpacityValueForCanvasImage(100);
1043
1045
  });
1044
1046
 
1045
1047
  it('When user changes opacity slider value , then opacity for image should be updated accordingly', () => {
1046
- figOverImageCanvasComponent.steps.clickActionOnOpacitySlider();
1047
- figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImage(50);
1048
+ imageCanvasComponent.steps.clickActionOnOpacitySlider();
1049
+ imageCanvasComponent.steps.verifyOpacityValueForCanvasImage(50);
1048
1050
  });
1049
1051
 
1050
1052
  it('When user changes opacity value in input field, then opacity for image should be updated accordingly', () => {
1051
- figOverImageCanvasComponent.steps.enterInputToOpacityInputField(40);
1052
- figOverImageCanvasComponent.steps.verifyOpacityInputFieldValue(40);
1053
- figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImage(40);
1053
+ imageCanvasComponent.steps.enterInputToOpacityInputField(40);
1054
+ imageCanvasComponent.steps.verifyOpacityInputFieldValue(40);
1055
+ imageCanvasComponent.steps.verifyOpacityValueForCanvasImage(40);
1054
1056
  });
1055
1057
  },
1056
1058
 
1057
1059
  verifyImageNotExistPreviewTab: () => {
1058
1060
  it('When user deletes the uploaded image file in edit tab, then canvas image should not appear in preview tab', () => {
1059
- figOverImageCanvasComponent.steps.switchToEditTab();
1061
+ imageCanvasComponent.steps.switchToEditTab();
1060
1062
  backgroundImageUploadComponent.steps.deleteImage();
1061
1063
  backgroundImageUploadComponent.steps.clickOnDeleteButtonInDeleteImagePopup();
1062
- figOverImageCanvasComponent.steps.switchToPreviewTab();
1063
- utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasImageInPreviewTab(), 'notExist');
1064
+ imageCanvasComponent.steps.switchToPreviewTab();
1065
+ utilities.verifyElementVisibilityState(imageCanvasComponent.canvasImageInPreviewTab(), 'notExist');
1064
1066
  });
1065
1067
  },
1066
1068
  }
1067
1069
 
1068
- export const figOverImageCanvasComponent = {
1070
+ export const imageCanvasComponent = {
1069
1071
  ...selectors,
1070
1072
  steps,
1071
1073
  tests