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.
- package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +13 -1
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +2 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +273 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js +116 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +136 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +120 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +158 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +246 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +332 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +409 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +80 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +213 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +68 -68
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +3 -289
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -23
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +191 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +190 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +284 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +113 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +234 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsBasic.js +136 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +197 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +169 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +197 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +219 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAnswerFunctionalityForAllViews.smoke.js +115 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +142 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +152 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +39 -0
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +2 -12
- package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +497 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +503 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +233 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +291 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +332 -0
- package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +2 -12
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +9 -8
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -2
- package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +5 -2
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +334 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +419 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +166 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +166 -0
- package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +51 -0
- package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +99 -0
- package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +71 -0
- package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +155 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +66 -0
- package/cypress/fixtures/theme/ilc.json +3 -1
- package/cypress/pages/audioResponsePage.js +2 -1
- package/cypress/pages/components/additionalSettingsPanel.js +27 -0
- package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
- package/cypress/pages/components/autoScoredScoringSection.js +1 -1
- package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
- package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
- package/cypress/pages/components/createQuestionBasePage.js +8 -2
- package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
- package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
- package/cypress/pages/components/index.js +3 -3
- package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
- package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
- package/cypress/pages/components/questionInputFieldComponent.js +49 -23
- package/cypress/pages/components/scoringSectionBase.js +1 -1
- package/cypress/pages/createItemPage.js +67 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
- package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
- package/cypress/pages/fillInTheGapsTextPage.js +52 -199
- package/cypress/pages/index.js +5 -5
- package/cypress/pages/multipleSelectionPage.js +1 -0
- package/cypress/pages/shortTextResponsePage.js +575 -33
- package/cypress/pages/singleSelectionGridPage.js +1 -2
- package/cypress/pages/singleSelectionPage.js +5 -6
- package/cypress/pages/textEntryMathPage.js +46 -22
- package/cypress/pages/textEntryMathWithImagePage.js +212 -0
- package/cypress/pages/uploadResponsePage.js +74 -21
- package/package.json +2 -2
- package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
- package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
- package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
- package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
- package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
- package/cypress/pages/fillInTheGapsScoring.js +0 -5872
- 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('
|
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
|
-
|
72
|
+
imageCanvasComponent.insertResponseAreaButton()
|
73
73
|
.click();
|
74
|
-
|
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
|
-
|
79
|
+
imageCanvasComponent.canvasImage()
|
80
80
|
.click(xCoordinate, yCoordinate, { force: true });
|
81
81
|
});
|
82
|
-
|
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
|
-
|
92
|
+
imageCanvasComponent.insertTextAreaButton()
|
93
93
|
.click();
|
94
|
-
|
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
|
-
|
99
|
+
imageCanvasComponent.canvasImage()
|
100
100
|
.click(xCoordinate, yCoordinate, { force: true });
|
101
101
|
});
|
102
|
-
|
102
|
+
imageCanvasComponent.textResponse()
|
103
103
|
.type(text);
|
104
104
|
},
|
105
105
|
|
106
106
|
verifyImageIsUploaded: () => {
|
107
|
-
utilities.verifyElementVisibilityState(
|
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(
|
114
|
+
utilities.verifyElementVisibilityState(imageCanvasComponent.canvasImageInPreviewTab(), 'visible')
|
115
115
|
},
|
116
116
|
|
117
117
|
verifyCanvasImageNotExist: () => {
|
118
|
-
utilities.verifyElementVisibilityState(
|
118
|
+
utilities.verifyElementVisibilityState(imageCanvasComponent.canvasImage(), 'notExist');
|
119
119
|
},
|
120
120
|
|
121
121
|
verifyFillImageToCanvasCheckboxUnchecked: () => {
|
122
|
-
|
122
|
+
imageCanvasComponent.fillImageToCanvasCheckbox()
|
123
123
|
.should('not.be.checked');
|
124
124
|
},
|
125
125
|
|
126
126
|
verifyFillImageToCanvasCheckboxChecked: () => {
|
127
|
-
|
127
|
+
imageCanvasComponent.fillImageToCanvasCheckbox()
|
128
128
|
.should('be.checked');
|
129
129
|
},
|
130
130
|
|
131
131
|
checkFillImageToCanvasCheckbox: () => {
|
132
|
-
|
132
|
+
imageCanvasComponent.fillImageToCanvasCheckbox()
|
133
133
|
.click();
|
134
134
|
steps.verifyFillImageToCanvasCheckboxChecked();
|
135
135
|
},
|
136
136
|
|
137
137
|
uncheckFillImageToCanvasCheckbox: () => {
|
138
|
-
|
138
|
+
imageCanvasComponent.fillImageToCanvasCheckbox()
|
139
139
|
.click();
|
140
140
|
steps.verifyFillImageToCanvasCheckboxUnchecked();
|
141
141
|
},
|
142
142
|
|
143
143
|
verifyCanvasImageTopLeftAligned: () => {
|
144
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
180
|
+
imageCanvasComponent.topLeftAlignmentButton()
|
181
181
|
.click();
|
182
|
-
|
182
|
+
imageCanvasComponent.topLeftAlignmentButton()
|
183
183
|
.should('have.attr', 'aria-pressed', 'true');
|
184
184
|
},
|
185
185
|
|
186
186
|
selectTopRightImageAlignment: () => {
|
187
|
-
|
187
|
+
imageCanvasComponent.topRightAlignmentButton()
|
188
188
|
.click();
|
189
|
-
|
189
|
+
imageCanvasComponent.topRightAlignmentButton()
|
190
190
|
.should('have.attr', 'aria-pressed', 'true');
|
191
191
|
},
|
192
192
|
|
193
193
|
selectCenterImageAlignment: () => {
|
194
|
-
|
194
|
+
imageCanvasComponent.centerAlignmentButton()
|
195
195
|
.click();
|
196
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
223
|
+
imageCanvasComponent.imageAlternativeTextInputField()
|
224
224
|
.type(text);
|
225
|
-
|
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
|
-
|
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
|
-
|
243
|
+
imageCanvasComponent.canvasImage()
|
244
244
|
.should('have.attr', 'alt', text);
|
245
245
|
},
|
246
246
|
|
247
247
|
clearImageAlternativeTextInputFieldText: () => {
|
248
|
-
|
248
|
+
imageCanvasComponent.imageAlternativeTextInputField()
|
249
249
|
.clear();
|
250
250
|
},
|
251
251
|
|
252
252
|
verifyNoImageAlternativeTextPresentInPreviewTab: () => {
|
253
|
-
|
253
|
+
imageCanvasComponent.canvasImageInPreviewTab()
|
254
254
|
.should('have.attr', 'alt', '');
|
255
255
|
},
|
256
256
|
|
257
257
|
verifyNoImageAlternativeTextPresentInEditTab: () => {
|
258
|
-
|
258
|
+
imageCanvasComponent.canvasImage()
|
259
259
|
.should('have.attr', 'alt', '');
|
260
260
|
},
|
261
261
|
|
262
262
|
verifyImageFitsToCanvas: () => {
|
263
|
-
|
263
|
+
imageCanvasComponent.canvasWidthInputField()
|
264
264
|
.invoke('attr', 'value')
|
265
265
|
.then((value) => {
|
266
|
-
|
266
|
+
imageCanvasComponent.canvasImage().should('have.css', 'width', `${value}px`);
|
267
267
|
});
|
268
268
|
},
|
269
269
|
|
270
270
|
verifyImageDoesNotFitToCanvas: () => {
|
271
|
-
|
272
|
-
.
|
273
|
-
|
274
|
-
|
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
|
-
|
281
|
+
imageCanvasComponent.canvasWidthInputField()
|
281
282
|
.invoke('attr', 'value')
|
282
283
|
.then((value) => {
|
283
284
|
createQuestionBasePage.steps.switchToPreviewTab();
|
284
|
-
|
285
|
+
imageCanvasComponent.canvasImageInPreviewTab().should('have.css', 'width', `${value}px`);
|
285
286
|
});
|
286
287
|
},
|
287
288
|
|
288
289
|
verifyImageDoesNotFitToCanvasInPreviewTab: () => {
|
289
290
|
createQuestionBasePage.steps.switchToEditTab();
|
290
|
-
|
291
|
-
.
|
292
|
-
|
291
|
+
imageCanvasComponent.canvasImage()
|
292
|
+
.then(($element) => {
|
293
|
+
const imgWidth = $element[0].naturalWidth;
|
293
294
|
createQuestionBasePage.steps.switchToPreviewTab();
|
294
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
372
|
+
imageCanvasComponent.insertTextAreaButton()
|
372
373
|
.click()
|
373
374
|
.should('have.class', 'active');
|
374
375
|
}
|
375
376
|
},
|
376
377
|
|
377
378
|
redoAction: () => {
|
378
|
-
|
379
|
+
imageCanvasComponent.redoButton()
|
379
380
|
.click();
|
380
381
|
},
|
381
382
|
|
382
383
|
undoAction: () => {
|
383
|
-
|
384
|
+
imageCanvasComponent.undoButton()
|
384
385
|
.click();
|
385
386
|
},
|
386
387
|
|
387
388
|
clearAll: () => {
|
388
|
-
|
389
|
+
imageCanvasComponent.clearAllButton()
|
389
390
|
.click();
|
390
391
|
},
|
391
392
|
|
392
393
|
verifyUndoButtonDisabled: () => {
|
393
|
-
utilities.verifyElementDisabled(
|
394
|
+
utilities.verifyElementDisabled(imageCanvasComponent.undoButton());
|
394
395
|
},
|
395
396
|
|
396
397
|
verifyRedoButtonDisabled: () => {
|
397
|
-
utilities.verifyElementDisabled(
|
398
|
+
utilities.verifyElementDisabled(imageCanvasComponent.redoButton());
|
398
399
|
},
|
399
400
|
|
400
401
|
verifyUndoButtonEnabled: () => {
|
401
|
-
utilities.verifyElementNotDisabled(
|
402
|
+
utilities.verifyElementNotDisabled(imageCanvasComponent.undoButton());
|
402
403
|
},
|
403
404
|
|
404
405
|
verifyRedoButtonEnabled: () => {
|
405
|
-
utilities.verifyElementNotDisabled(
|
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
|
-
|
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
|
-
|
424
|
+
const styleName = style.toLowerCase();
|
425
|
+
imageCanvasComponent.responseAreaStyle(styleName)
|
424
426
|
.click();
|
425
427
|
},
|
426
428
|
|
427
429
|
clickOnCanvasSelectedMenuText: () => {
|
428
|
-
|
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 '
|
437
|
+
case 'bottom':
|
436
438
|
return { top: '-31.5px', left: '-37.5px' };
|
437
|
-
case '
|
439
|
+
case 'bottom right':
|
438
440
|
return { top: '-25px', left: '-40px' };
|
439
|
-
case '
|
441
|
+
case 'right':
|
440
442
|
return { top: '-21px', left: '-36.5px' };
|
441
|
-
case '
|
443
|
+
case 'top right':
|
442
444
|
return { top: '-19px', left: '-31px' };
|
443
|
-
case '
|
445
|
+
case 'top':
|
444
446
|
return { top: '-22.5px', left: '-25.5px' };
|
445
|
-
case '
|
447
|
+
case 'top left':
|
446
448
|
return { top: '-27px', left: '-24px' };
|
447
|
-
case '
|
449
|
+
case 'left':
|
448
450
|
return { bottom: '-20px', left: '-27px' };
|
449
|
-
case '
|
451
|
+
case 'bottom left':
|
450
452
|
return { bottom: '-18px', left: '-32px' };
|
451
453
|
}
|
452
454
|
}
|
453
455
|
const expectedPosition = getPosition(style);
|
454
|
-
if (style == '
|
455
|
-
|
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 == '
|
461
|
-
|
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
|
-
|
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(
|
476
|
+
utilities.verifyElementVisibilityState(imageCanvasComponent.textBoxInPreviewTab(), 'notExist');
|
475
477
|
},
|
476
478
|
|
477
479
|
verifyTextBoxExistInPreviewTab: () => {
|
478
|
-
|
480
|
+
imageCanvasComponent.textBoxInPreviewTab()
|
479
481
|
.should('be.visible');
|
480
482
|
},
|
481
483
|
|
482
484
|
verifyTextColorOfTextBox: (color) => {
|
483
|
-
|
485
|
+
imageCanvasComponent.textResponse()
|
484
486
|
.should('have.css', 'color', color);
|
485
487
|
},
|
486
488
|
|
487
489
|
verifyTextColorOfTextBoxInPreviewTab: (color) => {
|
488
|
-
|
490
|
+
imageCanvasComponent.textBoxInPreviewTab()
|
489
491
|
.should('have.css', 'color', color);
|
490
492
|
},
|
491
493
|
|
492
494
|
verifyTextOfTextBox: (text) => {
|
493
|
-
|
495
|
+
imageCanvasComponent.textResponse()
|
494
496
|
.invoke('text')
|
495
497
|
.should('eq', text);
|
496
498
|
},
|
497
499
|
|
498
500
|
verifyTextOfTextBoxInPreviewTab: (text) => {
|
499
|
-
|
501
|
+
imageCanvasComponent.textBoxInPreviewTab()
|
500
502
|
.invoke('text')
|
501
503
|
.should('eq', text);
|
502
504
|
},
|
503
505
|
|
504
506
|
clickOnTextColorButton: () => {
|
505
|
-
|
507
|
+
imageCanvasComponent.responseAreaStyle()
|
506
508
|
.click();
|
507
|
-
utilities.verifyElementVisibilityState(
|
509
|
+
utilities.verifyElementVisibilityState(imageCanvasComponent.textColorPopupWrapper(), 'visible');
|
508
510
|
},
|
509
511
|
|
510
512
|
clickOnEditColorButton: () => {
|
511
|
-
|
513
|
+
imageCanvasComponent.editColorLabel()
|
512
514
|
.click();
|
513
515
|
},
|
514
516
|
|
515
517
|
verifyColorBlockSelectedState: () => {
|
516
|
-
|
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
|
-
|
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
|
-
|
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(
|
542
|
-
utilities.verifyElementVisibilityState(
|
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
|
-
|
566
|
+
imageCanvasComponent.responseAreaStyle()
|
565
567
|
.eq(index)
|
566
568
|
.trigger('mouseover', { force: true });
|
567
569
|
utilities.verifyInnerText(commonComponents.tooltipText(), dropzonePointer);
|
568
|
-
|
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(
|
581
|
-
utilities.verifyElementVisibilityState(
|
582
|
-
utilities.verifyElementVisibilityState(
|
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
|
-
|
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
|
-
|
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(
|
600
|
-
utilities.verifyElementVisibilityState(
|
601
|
-
utilities.verifyElementVisibilityState(
|
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(
|
606
|
-
|
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
|
-
|
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(
|
615
|
-
|
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
|
-
|
622
|
-
utilities.verifyElementCount(
|
623
|
-
utilities.verifyElementVisibilityState(
|
624
|
-
utilities.verifyElementVisibilityState(
|
625
|
-
utilities.verifyElementVisibilityState(
|
626
|
-
utilities.verifyInnerText(
|
627
|
-
utilities.verifyElementVisibilityState(
|
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
|
-
|
637
|
-
utilities.verifyElementVisibilityState(
|
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
|
-
|
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
|
-
|
651
|
+
imageCanvasComponent.steps.insertResponseArea(i * 2);
|
650
652
|
}
|
651
|
-
utilities.verifyElementCount(
|
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
|
-
|
656
|
-
utilities.verifyElementCount(
|
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(
|
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
|
-
|
669
|
-
|
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
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
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
|
-
|
683
|
-
utilities.verifyElementCount(
|
684
|
-
utilities.verifyElementNotDisabled(
|
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
|
-
|
689
|
-
utilities.verifyElementCount(
|
690
|
-
|
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
|
-
|
697
|
+
imageCanvasComponent.steps.undoAction();
|
696
698
|
}
|
697
|
-
utilities.verifyElementCount(
|
698
|
-
|
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
|
-
|
707
|
+
imageCanvasComponent.steps.redoAction();
|
706
708
|
}
|
707
|
-
utilities.verifyElementCount(
|
708
|
-
|
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
|
-
|
714
|
-
utilities.verifyElementVisibilityState(
|
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
|
-
|
724
|
+
imageCanvasComponent.steps.selectCanvasMenuButton('Insert text');
|
723
725
|
cy.log('Clicking on canvas Selected Menu Text to hover away from select dropzone button');
|
724
|
-
|
725
|
-
|
726
|
-
utilities.verifyElementVisibilityState(
|
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(
|
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
|
-
|
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
|
-
|
741
|
-
|
742
|
-
utilities.verifyElementNotDisabled(
|
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
|
-
|
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
|
-
|
751
|
-
utilities.verifyElementVisibilityState(
|
752
|
-
utilities.verifyInnerText(
|
753
|
-
utilities.verifyElementVisibilityState(
|
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(
|
758
|
-
utilities.verifyElementVisibilityState(
|
759
|
-
utilities.verifyElementVisibilityState(
|
760
|
-
|
761
|
-
|
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
|
-
|
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(
|
840
|
-
utilities.verifyElementVisibilityState(
|
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(
|
845
|
-
utilities.verifyInnerText(
|
846
|
-
utilities.verifyElementVisibilityState(
|
847
|
-
|
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
|
-
|
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(
|
861
|
-
utilities.verifyElementVisibilityState(
|
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(
|
866
|
-
utilities.verifyElementVisibilityState(
|
867
|
-
utilities.verifyInnerText(
|
868
|
-
utilities.verifyElementVisibilityState(
|
869
|
-
utilities.verifyInnerText(
|
870
|
-
utilities.verifyElementVisibilityState(
|
871
|
-
|
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(
|
876
|
-
utilities.verifyElementVisibilityState(
|
877
|
-
utilities.verifyInnerText(
|
878
|
-
utilities.verifyElementVisibilityState(
|
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
|
-
|
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
|
-
|
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
|
-
|
893
|
-
|
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
|
-
|
898
|
-
|
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
|
-
|
903
|
-
|
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
|
-
|
910
|
-
|
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
|
-
|
915
|
-
|
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
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
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
|
-
|
929
|
-
|
930
|
-
|
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
|
-
|
935
|
-
|
936
|
-
|
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
|
-
|
941
|
-
|
942
|
-
|
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
|
-
|
949
|
-
|
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
|
953
|
-
|
954
|
-
|
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
|
-
|
961
|
-
|
962
|
-
|
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
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
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
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
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
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
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
|
-
|
990
|
-
|
991
|
-
|
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
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
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
|
-
|
1006
|
-
|
1007
|
+
imageCanvasComponent.steps.switchToEditTab();
|
1008
|
+
imageCanvasComponent.steps.enterAndVerifyImageAlternativeTextInInputField('This is Alternative text for image');
|
1007
1009
|
cy.log('Switching to Preview Tab');
|
1008
|
-
|
1009
|
-
|
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
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
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
|
-
|
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
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
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
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
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
|
-
|
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
|
-
|
1047
|
-
|
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
|
-
|
1052
|
-
|
1053
|
-
|
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
|
-
|
1061
|
+
imageCanvasComponent.steps.switchToEditTab();
|
1060
1062
|
backgroundImageUploadComponent.steps.deleteImage();
|
1061
1063
|
backgroundImageUploadComponent.steps.clickOnDeleteButtonInDeleteImagePopup();
|
1062
|
-
|
1063
|
-
utilities.verifyElementVisibilityState(
|
1064
|
+
imageCanvasComponent.steps.switchToPreviewTab();
|
1065
|
+
utilities.verifyElementVisibilityState(imageCanvasComponent.canvasImageInPreviewTab(), 'notExist');
|
1064
1066
|
});
|
1065
1067
|
},
|
1066
1068
|
}
|
1067
1069
|
|
1068
|
-
export const
|
1070
|
+
export const imageCanvasComponent = {
|
1069
1071
|
...selectors,
|
1070
1072
|
steps,
|
1071
1073
|
tests
|