itemengine-cypress-automation 1.0.83 → 1.0.84
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/DesmosGraphing/previewTabContent.smoke.js +3 -3
- package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +30 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/allOrNothingGroupedScoring.js +158 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/partialDifferentWeightsBasic.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +43 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +510 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +678 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +82 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/minimumScoringPenaltyPointsAndRoundingDropdown.js +198 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettingsForGroupedLayout.js +263 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +80 -0
- package/cypress/e2e/ILC/Protractor/protractorEditTabBasicsSection.js +2 -0
- package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +2 -0
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +177 -171
- package/cypress/pages/components/backgroundImageUploadComponent.js +19 -3
- package/cypress/pages/components/draggableOptionContainer.js +13 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +175 -25
- package/cypress/pages/components/figOverImageCanvasComponent.js +257 -0
- package/cypress/pages/components/imageActionsComponent.js +30 -0
- package/cypress/pages/components/index.js +5 -5
- package/cypress/pages/components/measuringToolComponent.js +0 -54
- package/cypress/pages/components/opacityComponent.js +64 -0
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +16 -1
- package/cypress/pages/essayResponsePage.js +5 -7
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +152 -11
- package/cypress/pages/protractorPage.js +3 -1
- package/cypress/pages/rulerPage.js +5 -24
- package/cypress/pages/selectQuestionResourceToolPage.js +1 -1
- package/package.json +1 -1
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/manuallyAndNonScoredScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionBasic.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionMinimumAndPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneBasic.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneMinimumAndPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/allOrNothingBasicForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/checkAnswerFunctionalityForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/clickAndDrop.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/draggableOptions.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/editTabBasicSection.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/editTabScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/headerSection.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/manuallyAndNonScoredScoringEditTab.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/minimumScoringPenaltyPointsAndRoundingDropdown.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/previewContentsForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/specifyCorrectAnswerSection.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/studentViewSettings.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/studentViewSettingsForGroupedLayout.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/switchingCasesBetweenOptionsLayout.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/manuallyAndNonScored.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsBasic.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsBasic.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/allOrNothingForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/checkAnswerFunctionalityForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/editTabScoringSection.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/previewContentsForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/specifyCorrectAnswerSection.js +0 -0
package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js
ADDED
@@ -0,0 +1,510 @@
|
|
1
|
+
import { fillInTheGapsOverImageDragAndDropPage } from "../../../pages";
|
2
|
+
import utilities from "../../../support/helpers/utilities";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const alignmentOptions = ['Top left', 'Center', 'Top right'];
|
7
|
+
|
8
|
+
describe('Create item page - Fill in the gaps: Question instructions, Options section', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Question instructions input field - Edit tab', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image - drag and drop');
|
17
|
+
cy.barsPreLoaderWait();
|
18
|
+
});
|
19
|
+
|
20
|
+
fillInTheGapsOverImageDragAndDropPage.tests.verifyQuestionInstructionsInputFieldEditTab();
|
21
|
+
});
|
22
|
+
|
23
|
+
describe('Question instructions input field - Edit tab functionality', () => {
|
24
|
+
abortEarlySetup();
|
25
|
+
before(() => {
|
26
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
27
|
+
cy.barsPreLoaderWait();
|
28
|
+
});
|
29
|
+
|
30
|
+
fillInTheGapsOverImageDragAndDropPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
|
31
|
+
});
|
32
|
+
|
33
|
+
describe('Background image section - Edit tab', () => {
|
34
|
+
abortEarlySetup();
|
35
|
+
before(() => {
|
36
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
37
|
+
cy.barsPreLoaderWait();
|
38
|
+
});
|
39
|
+
|
40
|
+
it('\'Background image\' label should be visible', () => {
|
41
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.backgroundImageLabel(), 'Background image');
|
42
|
+
})
|
43
|
+
|
44
|
+
it('\'Upload\' label and \'Choose file\' button should be displayed', () => {
|
45
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.uploadLabel(), 'Upload');
|
46
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.uploadLabel(), 'visible');
|
47
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.chooseFileButton(), 'Choose file');
|
48
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.chooseFileButton(), 'visible');
|
49
|
+
});
|
50
|
+
|
51
|
+
it('\'File name\' label should be displayed and by default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
|
52
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.fileNameLabel(), 'File name');
|
53
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.fileNameLabel(), 'visible');
|
54
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.noFileChosenLabel(), 'No file chosen');
|
55
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.noFileChosenLabel(), 'visible');
|
56
|
+
});
|
57
|
+
|
58
|
+
it('CSS of upload section', { tags: 'css' }, () => {
|
59
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.uploadLabel(), {
|
60
|
+
'color': css.color.labels,
|
61
|
+
'font-size': css.fontSize.normal,
|
62
|
+
'font-weight': css.fontWeight.semibold
|
63
|
+
});
|
64
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.chooseFileButton(), {
|
65
|
+
'color': css.color.secondaryBtn,
|
66
|
+
'font-size': css.fontSize.default,
|
67
|
+
'font-weight': css.fontWeight.regular,
|
68
|
+
'border-bottom-color': css.color.titleContainerBorder
|
69
|
+
});
|
70
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.fileNameLabel(), {
|
71
|
+
'color': css.color.labels,
|
72
|
+
'font-size': css.fontSize.normal,
|
73
|
+
'font-weight': css.fontWeight.semibold
|
74
|
+
});
|
75
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.noFileChosenLabel(), {
|
76
|
+
'color': css.color.panelLabel,
|
77
|
+
'font-size': css.fontSize.default,
|
78
|
+
'font-weight': css.fontWeight.regular
|
79
|
+
});
|
80
|
+
});
|
81
|
+
|
82
|
+
it('Accessibility of Upload section before uploading image', { tags: 'a11y' }, () => {
|
83
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.uploadLabel().parents('.edit-question-edit-tab-wrapper'));
|
84
|
+
});
|
85
|
+
|
86
|
+
it('When the user adds the image file and file upload is inprogress, file name and progress bar should be displayed below \'File name\' label. Progress bar should disappear once file is uploaded and uploaded image should be displayed', () => {
|
87
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
88
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.uploadImageProgressBar(), 'visible');
|
89
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
90
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.canvasImage(), 'visible');
|
91
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.uploadImageProgressBar(), 'notExist');
|
92
|
+
});
|
93
|
+
|
94
|
+
it('Delete button should appear beside uploaded file\'s name', () => {
|
95
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.deleteImageIcon(), 'visible');
|
96
|
+
});
|
97
|
+
|
98
|
+
it('When user clicks on \'Choose file\' button again and upload another image file, previously uploaded image file should get replaced with new image file', () => {
|
99
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('sample1.jpg');
|
100
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyFileNameLabel('sample1.jpg');
|
101
|
+
});
|
102
|
+
|
103
|
+
it('When the user hovers on \'Delete\' button, \'Delete image\' text should be displayed in tooltip', () => {
|
104
|
+
fillInTheGapsOverImageDragAndDropPage.deleteImageIcon()
|
105
|
+
.verifyTooltip('Delete image');
|
106
|
+
});
|
107
|
+
|
108
|
+
it('CSS of tooltip', { tags: 'css' }, () => {
|
109
|
+
fillInTheGapsOverImageDragAndDropPage.deleteImageIcon()
|
110
|
+
.trigger('mouseover');
|
111
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.tooltipText(), {
|
112
|
+
'color': css.color.whiteText,
|
113
|
+
'font-size': css.fontSize.normal,
|
114
|
+
'font-weight': css.fontWeight.regular,
|
115
|
+
'background-color': css.color.tooltipBg
|
116
|
+
});
|
117
|
+
});
|
118
|
+
|
119
|
+
it('When user clicks on the \'Delete\' button, then \'Delete\' popup should be displayed', () => {
|
120
|
+
fillInTheGapsOverImageDragAndDropPage.steps.deleteImage();
|
121
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.dialogBox(), 'visible');
|
122
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.dialogBoxTitle(), 'Delete');
|
123
|
+
});
|
124
|
+
|
125
|
+
it('The pop up should be displayed with the message \'Are you sure you want to delete the image?\'', () => {
|
126
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.dialogBoxContent(), 'Are you sure you want to delete the image?');
|
127
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.deleteImagePopupButtonDelete(), 'Delete image');
|
128
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.deleteImagePopupButtonCancel(), 'Cancel');
|
129
|
+
});
|
130
|
+
|
131
|
+
it('CSS of popup', { tags: 'css' }, () => {
|
132
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.dialogBox(), {
|
133
|
+
'background-color': css.color.defaultBackground,
|
134
|
+
});
|
135
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.dialogBoxContent().find('[class*="UploadImagestyles__DeletePopupWrapper"]'), {
|
136
|
+
'color': css.color.sectionHeading,
|
137
|
+
'font-size': css.fontSize.default,
|
138
|
+
'font-weight': css.fontWeight.regular
|
139
|
+
});
|
140
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.deleteImagePopupButtonDelete(), {
|
141
|
+
'color': css.color.primaryBtn,
|
142
|
+
'font-size': css.fontSize.default,
|
143
|
+
'font-weight': css.fontWeight.semibold
|
144
|
+
});
|
145
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.deleteImagePopupButtonCancel(), {
|
146
|
+
'color': css.color.secondaryBtn,
|
147
|
+
'font-size': css.fontSize.default,
|
148
|
+
'font-weight': css.fontWeight.semibold,
|
149
|
+
'background-color': css.color.defaultBackground
|
150
|
+
});
|
151
|
+
});
|
152
|
+
|
153
|
+
it('Accessibility of the popup', () => {
|
154
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.dialogBox());
|
155
|
+
});
|
156
|
+
|
157
|
+
it('When user clicks on \'Cancel\' button, then popup should close and user should remain on the edit interface of the question', () => {
|
158
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnCancelButtonInDeleteImagePopup();
|
159
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.dialogBox(), 'notExist');
|
160
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.uploadedFileNameLabel(), 'sample1.jpg');
|
161
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.canvasImage(), 'visible');
|
162
|
+
});
|
163
|
+
|
164
|
+
it('When user clicks on \'Delete image\' button, then popup should close and image inside the canvas should be deleted', () => {
|
165
|
+
fillInTheGapsOverImageDragAndDropPage.steps.deleteImage();
|
166
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDeleteButtonInDeleteImagePopup();
|
167
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.dialogBox(), 'notExist');
|
168
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.noFileChosenLabel(), 'No file chosen');
|
169
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasImageNotExist();
|
170
|
+
});
|
171
|
+
|
172
|
+
it('When user has deleted image, then error message \'Error:Image is required\' should be displayed below \'Upload\' button', () => {
|
173
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'visible');
|
174
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'Error: Image is required.');
|
175
|
+
});
|
176
|
+
});
|
177
|
+
|
178
|
+
describe('Image properties section - Edit tab', () => {
|
179
|
+
abortEarlySetup();
|
180
|
+
before(() => {
|
181
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
182
|
+
cy.barsPreLoaderWait();
|
183
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
184
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
185
|
+
});
|
186
|
+
|
187
|
+
it('\'Image properties\' label should be displayed.', () => {
|
188
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.imagePropertiesLabel(), 'Image properties');
|
189
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.imagePropertiesLabel(), 'visible');
|
190
|
+
});
|
191
|
+
|
192
|
+
it('\'Fill image to canvas\' label and checkbox should be displayed and checkbox should be unchecked by default', () => {
|
193
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.fillImageToCanvasLabel(), 'visible');
|
194
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.fillImageToCanvasLabel(), 'Fill image to canvas');
|
195
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.fillImageToCanvasCheckbox(), 'exist');
|
196
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyFillImageToCanvasCheckboxUnchecked();
|
197
|
+
});
|
198
|
+
|
199
|
+
it('User should be able to check \'Fill image to canvas\' checkbox', () => {
|
200
|
+
fillInTheGapsOverImageDragAndDropPage.steps.checkFillImageToCanvasCheckbox();
|
201
|
+
});
|
202
|
+
|
203
|
+
it('\'Image alignment\' label should be displayed. ', () => {
|
204
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.imageAlignmentLabel(), 'Image alignment');
|
205
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.imageAlignmentLabel(), 'visible');
|
206
|
+
});
|
207
|
+
|
208
|
+
it(`\'Image alignment\' section should have three options ${alignmentOptions} and ${alignmentOptions[0]} should be active selection by default`, () => {
|
209
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.topLeftAlignmentButton(), 'Top left');
|
210
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.topLeftAlignmentButton(), 'visible');
|
211
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.centerAlignmentButton(), 'Center');
|
212
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.centerAlignmentButton(), 'visible');
|
213
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.topRightAlignmentButton(), 'Top right');
|
214
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.topRightAlignmentButton(), 'visible');
|
215
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasImageTopLeftAligned();
|
216
|
+
});
|
217
|
+
|
218
|
+
it('\'Opacity\' label, slider and input field should be displayed. \'Opacity\' slider and input field should be set to 100 percent by default', () => {
|
219
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDefaultOpacityLabelSliderAndInputField();
|
220
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacitySliderValue(100);
|
221
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacityInputFieldValue(100);
|
222
|
+
});
|
223
|
+
|
224
|
+
it('The maximum value of \'Opacity\' slider should be 100', () => {
|
225
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyMaxOpacitySliderValue();
|
226
|
+
});
|
227
|
+
|
228
|
+
it('When the user changes the opacity slider value, value in the opacity input field should also change', () => {
|
229
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnOpacitySlider();
|
230
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacitySliderValue(50);
|
231
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacityInputFieldValue(50);
|
232
|
+
});
|
233
|
+
|
234
|
+
it('When the user changes value in the opacity input field, the slider value should also change accordingly', () => {
|
235
|
+
fillInTheGapsOverImageDragAndDropPage.steps.enterInputToOpacityInputField(85);
|
236
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacityInputFieldValue(85);
|
237
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacitySliderValue(85);
|
238
|
+
});
|
239
|
+
|
240
|
+
it('CSS of \'Opacity\' Section in Edit tab', { tags: 'css' }, () => {
|
241
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.opacityLabel(), {
|
242
|
+
'color': css.color.labels,
|
243
|
+
'font-size': css.fontSize.normal,
|
244
|
+
'font-weight': css.fontWeight.semibold
|
245
|
+
});
|
246
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.opacityInputField(), {
|
247
|
+
'color': css.color.labels,
|
248
|
+
'font-size': css.fontSize.default,
|
249
|
+
'font-weight': css.fontWeight.regular
|
250
|
+
});
|
251
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.opacitySlider(), {
|
252
|
+
'color': css.color.activeButtons,
|
253
|
+
'font-weight': css.fontWeight.regular
|
254
|
+
});
|
255
|
+
});
|
256
|
+
|
257
|
+
it('Accessibility of opacity section', { tags: 'a11y' }, () => {
|
258
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.opacityLabel().parents('.MuiGrid-root'));
|
259
|
+
});
|
260
|
+
|
261
|
+
it('\'Image alternative text\' label and input field should be displayed. By default input field should be empty', () => {
|
262
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.imageAlternativeTextLabel(), 'Image alternative text');
|
263
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.imageAlternativeTextLabel(), 'visible');
|
264
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.imageAlternativeTextInputField(), '');
|
265
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.imageAlternativeTextInputField(), 'exist');
|
266
|
+
});
|
267
|
+
|
268
|
+
it('User should be able to enter text in \'Image alternative text\' input field', () => {
|
269
|
+
fillInTheGapsOverImageDragAndDropPage.steps.enterAndVerifyImageAlternativeTextInInputField('Image description');
|
270
|
+
});
|
271
|
+
|
272
|
+
it('\'Lock aspect ratio\' and \'Reset dimensions\' buttons should be displayed and by default \'Lock aspect ratio\' button should be locked', () => {
|
273
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.lockAspectRatioButton(), 'visible');
|
274
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.resetDimensionsButton(), 'visible');
|
275
|
+
});
|
276
|
+
});
|
277
|
+
|
278
|
+
describe('Image properties section - Edit tab functionality', () => {
|
279
|
+
abortEarlySetup();
|
280
|
+
before(() => {
|
281
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
282
|
+
cy.barsPreLoaderWait();
|
283
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
284
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
285
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
|
286
|
+
});
|
287
|
+
|
288
|
+
it('When \'Top left\' image alignment is selected by default, then image should be aligned to top left inside the canvas', () => {
|
289
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasImageTopLeftAligned();
|
290
|
+
});
|
291
|
+
|
292
|
+
it('When user selects \'Center\' image alignment, then image should be aligned to center inside the canvas', () => {
|
293
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectCenterImageAlignment();
|
294
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasImageCenterAligned();
|
295
|
+
});
|
296
|
+
|
297
|
+
it('When user selects \'Top right\' image alignment, then image should be aligned to top right inside the canvas', () => {
|
298
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectTopRightImageAlignment();
|
299
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasImageTopRightAligned();
|
300
|
+
});
|
301
|
+
|
302
|
+
it('When user selects \'Top left\' image alignment again, then image should be aligned to top left inside the canvas', () => {
|
303
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectTopLeftImageAlignment();
|
304
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasImageTopLeftAligned();
|
305
|
+
});
|
306
|
+
|
307
|
+
it('When opacity value is set to 100 percent by default, then opacity for image should be100 percent inside canvas', () => {
|
308
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacityValueForCanvasImage(100);
|
309
|
+
});
|
310
|
+
|
311
|
+
it('When user changes opacity slider value , then opacity for image should be updated accordingly', () => {
|
312
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnOpacitySlider();
|
313
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacityValueForCanvasImage(50);
|
314
|
+
});
|
315
|
+
|
316
|
+
it('When user changes opacity value in input field, then opacity for image should be updated accordingly', () => {
|
317
|
+
fillInTheGapsOverImageDragAndDropPage.steps.enterInputToOpacityInputField(40);
|
318
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacityInputFieldValue(40);
|
319
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacityValueForCanvasImage(40);
|
320
|
+
});
|
321
|
+
|
322
|
+
it('When user checks \'Fill image to canvas\' checkbox, then image should be adjusted to fit inside the canvas', () => {
|
323
|
+
fillInTheGapsOverImageDragAndDropPage.steps.checkFillImageToCanvasCheckbox();
|
324
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageFitsToCanvas();
|
325
|
+
});
|
326
|
+
|
327
|
+
// Failed due to https://redmine.zeuslearning.com/issues/556897
|
328
|
+
it('When user unchecks \'Fill image to canvas\' checkbox, then image dimensions should set to default state', () => {
|
329
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uncheckFillImageToCanvasCheckbox();
|
330
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageDoesNotFitToCanvas();
|
331
|
+
});
|
332
|
+
});
|
333
|
+
|
334
|
+
describe('Canvas width, Canvas height, Image alternative text - Edit tab functionality', () => {
|
335
|
+
abortEarlySetup();
|
336
|
+
before(() => {
|
337
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
338
|
+
cy.barsPreLoaderWait();
|
339
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
340
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
341
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
|
342
|
+
});
|
343
|
+
|
344
|
+
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', () => {
|
345
|
+
fillInTheGapsOverImageDragAndDropPage.steps.unlockAspectRatio();
|
346
|
+
fillInTheGapsOverImageDragAndDropPage.steps.updateCanvasWidth(500);
|
347
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasWidth(500);
|
348
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasHeight(432);
|
349
|
+
});
|
350
|
+
|
351
|
+
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', () => {
|
352
|
+
fillInTheGapsOverImageDragAndDropPage.steps.updateCanvasHeight(500);
|
353
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasHeight(500);
|
354
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasWidth(500);
|
355
|
+
});
|
356
|
+
|
357
|
+
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', () => {
|
358
|
+
fillInTheGapsOverImageDragAndDropPage.steps.lockAspectRatio();
|
359
|
+
fillInTheGapsOverImageDragAndDropPage.steps.updateCanvasWidth(600);
|
360
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasHeight(600);
|
361
|
+
});
|
362
|
+
|
363
|
+
it('When user selects the \'Reset dimensions\' button the height and width should reset to the original values', () => {
|
364
|
+
fillInTheGapsOverImageDragAndDropPage.steps.resetDimensions();
|
365
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasWidth(768);
|
366
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasHeight(432);
|
367
|
+
});
|
368
|
+
|
369
|
+
it('When user enters text in the \'Alternative text\' input field, then alternative text should be displayed for canvas image', () => {
|
370
|
+
fillInTheGapsOverImageDragAndDropPage.steps.enterAndVerifyImageAlternativeTextInInputField('This is Alternative text for image');
|
371
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageAlternativeTextPresentInEditTab('This is Alternative text for image');
|
372
|
+
});
|
373
|
+
|
374
|
+
it('When user clears text in the \'Alternative text\' input field, then alternative text should not be displayed for canvas image', () => {
|
375
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clearImageAlternativeTextInputFieldText();
|
376
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyNoImageAlternativeTextPresentInEditTab();
|
377
|
+
});
|
378
|
+
});
|
379
|
+
|
380
|
+
describe('Image properties, Image alignment, Opacity section - Preview tab functionality', () => {
|
381
|
+
abortEarlySetup();
|
382
|
+
before(() => {
|
383
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
384
|
+
cy.barsPreLoaderWait();
|
385
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
386
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
387
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
|
388
|
+
});
|
389
|
+
|
390
|
+
it('When \'Top left\' image alignment is selected by default, then in preview tab canvas image should be aligned to top left', () => {
|
391
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
392
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploadedInPreviewTab();
|
393
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
|
394
|
+
});
|
395
|
+
|
396
|
+
it('When user selects \'Center\' image alignment in edit tab, then canvas image should be aligned to center in preview tab ', () => {
|
397
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
398
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectCenterImageAlignment();
|
399
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
400
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasImageCenterAlignedInPreviewTab();
|
401
|
+
});
|
402
|
+
|
403
|
+
it('When user selects \'Top right\' image alignment, then canvas image should be aligned to top right in preview tab', () => {
|
404
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
405
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectTopRightImageAlignment();
|
406
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
407
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasImageTopRightAlignedInPreviewTab();
|
408
|
+
});
|
409
|
+
|
410
|
+
it('When user selects \'Top left\' image alignment again, then image should be aligned to top left inside the canvas in preview tab', () => {
|
411
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
412
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectTopLeftImageAlignment();
|
413
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
414
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
|
415
|
+
});
|
416
|
+
|
417
|
+
it('When opacity is 100 percent by default, then canvas image should have 100 percent opacity in preview tab ', () => {
|
418
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacityValueForCanvasImageInPreviewTab(100);
|
419
|
+
});
|
420
|
+
|
421
|
+
it('When user changes opacity slider value in edit tab, then opacity for canvas image should change accordingly in preview tab ', () => {
|
422
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
423
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnOpacitySlider();
|
424
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
425
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacityValueForCanvasImageInPreviewTab(50);
|
426
|
+
});
|
427
|
+
|
428
|
+
it('When user changes opacity input field value in edit tab, then opacity for canvas image should change accordingly in preview tab ', () => {
|
429
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
430
|
+
fillInTheGapsOverImageDragAndDropPage.steps.enterInputToOpacityInputField(40);
|
431
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
432
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyOpacityValueForCanvasImageInPreviewTab(40);
|
433
|
+
});
|
434
|
+
|
435
|
+
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', () => {
|
436
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
437
|
+
fillInTheGapsOverImageDragAndDropPage.steps.checkFillImageToCanvasCheckbox(); fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
438
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageFitsToCanvasInPreviewTab();
|
439
|
+
});
|
440
|
+
|
441
|
+
// Failed due to https://redmine.zeuslearning.com/issues/556897
|
442
|
+
it('When user unchecks \'Fill image to canvas\' checkbox, then image dimensions should set to default state in preview tab', () => {
|
443
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
444
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uncheckFillImageToCanvasCheckbox();
|
445
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
446
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageDoesNotFitToCanvas();
|
447
|
+
});
|
448
|
+
});
|
449
|
+
|
450
|
+
describe('Canvas width, Canvas height, Image alternative text - Preview tab functionality', () => {
|
451
|
+
abortEarlySetup();
|
452
|
+
before(() => {
|
453
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
454
|
+
cy.barsPreLoaderWait();
|
455
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
456
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
457
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.uploadImageProgressBar(), 'visible');
|
458
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
|
459
|
+
});
|
460
|
+
|
461
|
+
it('When the user has uploaded canvas image, then switching to the preview tab should display canvas image with same dimensions', () => {
|
462
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
463
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploadedInPreviewTab();
|
464
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.canvasImage(), 'visible');
|
465
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasWidthInPreviewTab(768);
|
466
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasHeightInPreviewTab(432);
|
467
|
+
});
|
468
|
+
|
469
|
+
it('When user updates width and height in edit tab, then updated changes should be reflected in preview tab', () => {
|
470
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
471
|
+
fillInTheGapsOverImageDragAndDropPage.steps.unlockAspectRatio();
|
472
|
+
fillInTheGapsOverImageDragAndDropPage.steps.updateCanvasWidth(500);
|
473
|
+
fillInTheGapsOverImageDragAndDropPage.steps.updateCanvasHeight(500);
|
474
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
475
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasWidthInPreviewTab(500);
|
476
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasHeightInPreviewTab(500);
|
477
|
+
});
|
478
|
+
|
479
|
+
it('When user resets image dimensions in edit tab, then updated changes should be reflected in preview tab', () => {
|
480
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
481
|
+
fillInTheGapsOverImageDragAndDropPage.steps.resetDimensions();
|
482
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
483
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasWidthInPreviewTab(768);
|
484
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyCanvasHeightInPreviewTab(432);
|
485
|
+
});
|
486
|
+
|
487
|
+
it('When user enters text in the \'Alternative text\' input field, then alternative text should be displayed in the \'Preview tab\'', () => {
|
488
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
489
|
+
fillInTheGapsOverImageDragAndDropPage.steps.enterAndVerifyImageAlternativeTextInInputField('This is Alternative text for image');
|
490
|
+
cy.log('Switching to Preview Tab');
|
491
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
492
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageAlternativeTextInPreviewTab('This is Alternative text for image');
|
493
|
+
});
|
494
|
+
|
495
|
+
it('When user clears text in the \'Alternative text\' input field, then alternative text should not be displayed in the \'Preview tab\'', () => {
|
496
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
497
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clearImageAlternativeTextInputFieldText();
|
498
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
499
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyNoImageAlternativeTextPresentInPreviewTab();
|
500
|
+
});
|
501
|
+
|
502
|
+
it('When user deletes the uploaded image file in edit tab, then canvas image should not appear in preview tab', () => {
|
503
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
504
|
+
fillInTheGapsOverImageDragAndDropPage.steps.deleteImage();
|
505
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDeleteButtonInDeleteImagePopup();
|
506
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
507
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.canvasImage(), 'notExist');
|
508
|
+
});
|
509
|
+
});
|
510
|
+
});
|