itemengine-cypress-automation 1.0.25 → 1.0.27
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/HighlightImage/highlightImageAdditionalSettings.js +219 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageAdditionalSettingsBasic.js +252 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageAllOrNothingScoring.js +235 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageAllOrNothingWithAlternateAnswer.js +810 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageCustomizeHighlightProperties.js +669 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageCustomizeHighlightPropertiesFunctionality.js +356 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.js +125 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabHighlightSectionContents.js +318 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabScoring.js +403 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageHeaderSection.js +86 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageManuallyAndNonScoredScoring.js +176 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImagePartialDifferentWeightsScoring.js +210 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImagePartialDifferentWeightsWithAlternateAnswer.js +898 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImagePartialEqualWeightsScoring.js +208 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImagePartialEqualWeightsWithAlternateAnswer.js +894 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImagePreviewTab.js +88 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageSetCorrectAnswerCheckboxes.js +244 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageSetCorrectAnswerSection.js +186 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageSupportedFileTypes.js +86 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageToolsFunctionalityEditTab.js +160 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageToolsFunctionalityPreviewTab.js +163 -0
- package/package.json +1 -1
@@ -0,0 +1,160 @@
|
|
1
|
+
import { highlightImagePage } from "../../../pages";
|
2
|
+
import { uploadImageSectionComponent } from "../../../pages/components/uploadImageSectionComponent";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
|
6
|
+
const flowerHighlightRegion = [[24, 6], [24, 24], [56, 24], [56, 6]];
|
7
|
+
const leafHighlightRegion = [[54, 48], [54, 72], [82, 72], [82, 48]];
|
8
|
+
const overlapHighlightRegion = [[24, 24], [56, 24], [61, 9], [34, 8]]
|
9
|
+
|
10
|
+
describe('Create Item page - Highlight image: Tools functionality edit tab', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('\'Pen\' tool functionality - Edit tab, Set correct answer section', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
cy.log('Navigating to Highlight image question type');
|
19
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
20
|
+
cy.log('Uploading an image');
|
21
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
22
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
23
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
24
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
25
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
26
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
27
|
+
});
|
28
|
+
|
29
|
+
it('When the user selects the \'Pen\' tool, the user should be able to highlight a region on the highlight image canvas, highlight count field value should update and a highlight with a numeration should be visible in \'Set correct answer\' section and \'Pen\' tool should be in selected state', () => {
|
30
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
31
|
+
highlightImagePage.steps.verifyHighlightCountInHighlightImageSection(1);
|
32
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion)
|
33
|
+
highlightImagePage.steps.verifyHighlightNumerationSetCorrectAnswer(0);
|
34
|
+
highlightImagePage.steps.verifySelectedStateOfPenTool();
|
35
|
+
});
|
36
|
+
|
37
|
+
it('When the user highlights multiple regions on the highlight image canvas, highlight count field value should update and a new highlight with numeration should be visible in \'Set correct answer\' section', () => {
|
38
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
39
|
+
highlightImagePage.steps.verifyHighlightCountInHighlightImageSection(2);
|
40
|
+
highlightImagePage.steps.verifyHighlightRegionCountInSetCorrectAnswerSection(2);
|
41
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion)
|
42
|
+
highlightImagePage.steps.verifyHighlightNumerationSetCorrectAnswer(1)
|
43
|
+
});
|
44
|
+
|
45
|
+
it('The user should not be able to draw overlapping highlights on the highlight image canvas', () => {
|
46
|
+
highlightImagePage.steps.highlightRegionInImage(overlapHighlightRegion);
|
47
|
+
highlightImagePage.steps.verifyHighlightCountInHighlightImageSection(2);
|
48
|
+
highlightImagePage.steps.verifyHighlightRegionCountInSetCorrectAnswerSection(2);
|
49
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
|
50
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
|
51
|
+
});
|
52
|
+
});
|
53
|
+
|
54
|
+
//TODO: Need to update script after https://redmine.zeuslearning.com/issues/544199 is answered
|
55
|
+
describe('\'Undo\' and \'Redo\' tool functionality - Edit tab, Set correct answer section', () => {
|
56
|
+
abortEarlySetup();
|
57
|
+
before(() => {
|
58
|
+
cy.log('Navigating to Highlight image question type');
|
59
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
60
|
+
cy.log('Uploading an image');
|
61
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
62
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
63
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
64
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
65
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
66
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
67
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
68
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
69
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
|
70
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
|
71
|
+
});
|
72
|
+
|
73
|
+
it('When the user clicks on the \'Undo\' tool, it should undo the latest action and tool should be in unselected state', () => {
|
74
|
+
highlightImagePage.steps.clickOnUndoTool();
|
75
|
+
highlightImagePage.steps.verifyHighlightCountInHighlightImageSection(1);
|
76
|
+
highlightImagePage.steps.verifyHighlightRegionCountInSetCorrectAnswerSection(1);
|
77
|
+
highlightImagePage.steps.verifyUnselectedStateOfUndoTool();
|
78
|
+
});
|
79
|
+
|
80
|
+
it('When the user clicks on the redo tool after performing an undo action, then the highlight region should be displayed again in the \'Set correct answer\' section and tool should be in unselected state', () => {
|
81
|
+
highlightImagePage.steps.clickOnRedoTool();
|
82
|
+
highlightImagePage.steps.verifyHighlightCountInHighlightImageSection(2);
|
83
|
+
highlightImagePage.steps.verifyHighlightRegionCountInSetCorrectAnswerSection(2);
|
84
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
|
85
|
+
highlightImagePage.steps.verifyUnselectedStateOfRedoTool();
|
86
|
+
});
|
87
|
+
|
88
|
+
it('User should be able to undo multiple highlight regions by using the \'Undo\' tool', () => {
|
89
|
+
for (var i = 0; i < 11; i++) {
|
90
|
+
highlightImagePage.steps.clickOnUndoTool();
|
91
|
+
};
|
92
|
+
highlightImagePage.steps.verifyHighlightCountInHighlightImageSection(0);
|
93
|
+
utilities.verifyElementVisibilityState(highlightImagePage.setCorrectAnswerSectionHighlight(), 'notExist')
|
94
|
+
});
|
95
|
+
|
96
|
+
it('When the user clicks on the \'Redo\' tool multiple times after performing an undo action, then all the highlight region should be displayed again in the \'Set correct answer\' section', () => {
|
97
|
+
for (var i = 0; i < 11; i++) {
|
98
|
+
highlightImagePage.steps.clickOnRedoTool();
|
99
|
+
};
|
100
|
+
highlightImagePage.steps.verifyHighlightCountInHighlightImageSection(2);
|
101
|
+
highlightImagePage.steps.verifyHighlightRegionCountInSetCorrectAnswerSection(2);
|
102
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
|
103
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
|
104
|
+
});
|
105
|
+
});
|
106
|
+
|
107
|
+
describe('\'Item eraser\' tool functionality - Edit tab, Set correct answer section', () => {
|
108
|
+
abortEarlySetup();
|
109
|
+
before(() => {
|
110
|
+
cy.log('Navigating to Highlight image question type');
|
111
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
112
|
+
cy.log('Uploading an image');
|
113
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
114
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
115
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
116
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
117
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
118
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
119
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
120
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
121
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
|
122
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
|
123
|
+
});
|
124
|
+
|
125
|
+
it('When the user selects the \'Item eraser\' tool and clicks on a highlight region, the user should be able to delete the highlight and highlight count field value and numeration of highlight should change accordingly and deleted highlight should not be visible in \'Set correct answer\' section and the tool should be in selected state', () => {
|
126
|
+
highlightImagePage.steps.eraseAHighlightRegion([flowerHighlightRegion[0]]);
|
127
|
+
highlightImagePage.steps.verifyHighlightCountInHighlightImageSection(1);
|
128
|
+
highlightImagePage.steps.verifyHighlightRegionCountInSetCorrectAnswerSection(1);
|
129
|
+
highlightImagePage.steps.verifyHighlightNumerationSetCorrectAnswer(0)
|
130
|
+
highlightImagePage.steps.verifySelectedStateOfItemEraserTool()
|
131
|
+
});
|
132
|
+
});
|
133
|
+
|
134
|
+
describe('\'Clear all\' tool functionality - Edit tab, Set correct answer section', () => {
|
135
|
+
abortEarlySetup();
|
136
|
+
before(() => {
|
137
|
+
cy.log('Navigating to Highlight image question type');
|
138
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
139
|
+
cy.log('Uploading an image');
|
140
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
141
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
142
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
143
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
144
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
145
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
146
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
147
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
148
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
|
149
|
+
highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
|
150
|
+
});
|
151
|
+
|
152
|
+
it('When the user clicks on the \'Clear all\' tool, it should delete all the highlights present on the highlight image canvas and the highlight count field value should be equal to 0 and no highlights should be visible in \'Set correct answer\' section and \'Clear all\' tool should be in unselected state', () => {
|
153
|
+
highlightImagePage.steps.verifyHighlightRegionCountInSetCorrectAnswerSection(2);
|
154
|
+
highlightImagePage.steps.clickOnClearAllTool();
|
155
|
+
highlightImagePage.steps.verifyHighlightCountInHighlightImageSection(0);
|
156
|
+
utilities.verifyElementVisibilityState(highlightImagePage.setCorrectAnswerSectionHighlight(), 'notExist')
|
157
|
+
highlightImagePage.steps.verifyUnselectedStateOfClearAllTool();
|
158
|
+
});
|
159
|
+
});
|
160
|
+
});
|
@@ -0,0 +1,163 @@
|
|
1
|
+
import { highlightImagePage } from "../../../pages";
|
2
|
+
import { uploadImageSectionComponent } from "../../../pages/components/uploadImageSectionComponent";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
|
6
|
+
const flowerHighlightRegion = [[24, 6], [24, 24], [56, 24], [56, 6]];
|
7
|
+
const leafHighlightRegion = [[54, 48], [54, 72], [82, 72], [82, 48]];
|
8
|
+
const overlapHighlightRegion = [[24, 24], [56, 24], [61, 9], [34, 8]]
|
9
|
+
|
10
|
+
describe('Create Item page - Highlight image: Tools functionality preview tab', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('\'Pen\' tool functionality - Preview tab', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
cy.log('Navigating to Highlight image question type');
|
19
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
20
|
+
cy.log('Uploading an image');
|
21
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
22
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
23
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
24
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
25
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
26
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
27
|
+
});
|
28
|
+
|
29
|
+
it('When the user highlights a region on the highlight image canvas, it should be visible in \'Preview\' tab', () => {
|
30
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
31
|
+
cy.log('Switching to Preview Tab')
|
32
|
+
highlightImagePage.steps.switchToPreviewTab();
|
33
|
+
highlightImagePage.steps.verifyHighlightRegionsInPreviewTab(0, flowerHighlightRegion);
|
34
|
+
});
|
35
|
+
|
36
|
+
it('When the user highlights multiple regions on the highlight image canvas, a new highlight should be visible in \'Preview\' tab', () => {
|
37
|
+
cy.log('Switching to Edit Tab')
|
38
|
+
highlightImagePage.steps.switchToEditTab();
|
39
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
40
|
+
cy.log('Switching to Preview Tab')
|
41
|
+
highlightImagePage.steps.switchToPreviewTab();
|
42
|
+
highlightImagePage.steps.verifyHighlightRegionsInPreviewTab(1, leafHighlightRegion);
|
43
|
+
highlightImagePage.steps.verifyHighlightRegionCountInPreviewTab(2);
|
44
|
+
});
|
45
|
+
|
46
|
+
it('The user should not be able to draw overlapping highlights on the highlight image canvas', () => {
|
47
|
+
cy.log('Switching to Edit Tab')
|
48
|
+
highlightImagePage.steps.switchToEditTab();
|
49
|
+
highlightImagePage.steps.highlightRegionInImage(overlapHighlightRegion);
|
50
|
+
cy.log('Switching to Preview Tab')
|
51
|
+
highlightImagePage.steps.switchToPreviewTab();
|
52
|
+
highlightImagePage.steps.verifyHighlightRegionsInPreviewTab(0, flowerHighlightRegion);
|
53
|
+
highlightImagePage.steps.verifyHighlightRegionsInPreviewTab(1, leafHighlightRegion);
|
54
|
+
highlightImagePage.steps.verifyHighlightRegionCountInPreviewTab(2);
|
55
|
+
});
|
56
|
+
});
|
57
|
+
|
58
|
+
describe('\'Undo\' and \'Redo\' tool functionality - Preview tab', () => {
|
59
|
+
abortEarlySetup();
|
60
|
+
before(() => {
|
61
|
+
cy.log('Navigating to Highlight image question type');
|
62
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
63
|
+
cy.log('Uploading an image');
|
64
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
65
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
66
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
67
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
68
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
69
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
70
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
71
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
72
|
+
});
|
73
|
+
|
74
|
+
it('When the user performs the undo action, it should undo the latest action and it should be visible in \'Preview\' tab', () => {
|
75
|
+
highlightImagePage.steps.clickOnUndoTool();
|
76
|
+
cy.log('Switching to Preview Tab')
|
77
|
+
highlightImagePage.steps.switchToPreviewTab();
|
78
|
+
highlightImagePage.steps.verifyHighlightRegionCountInPreviewTab(1);
|
79
|
+
});
|
80
|
+
|
81
|
+
it('When the user clicks on the redo tool after performing an undo action, then the highlight region should be displayed again in the \'Preview\' tab', () => {
|
82
|
+
cy.log('Switching to Edit Tab')
|
83
|
+
highlightImagePage.steps.switchToEditTab();
|
84
|
+
highlightImagePage.steps.clickOnRedoTool();
|
85
|
+
cy.log('Switching to Preview Tab')
|
86
|
+
highlightImagePage.steps.switchToPreviewTab();
|
87
|
+
highlightImagePage.steps.verifyHighlightRegionsInPreviewTab(1, leafHighlightRegion);
|
88
|
+
highlightImagePage.steps.verifyHighlightRegionCountInPreviewTab(2);
|
89
|
+
});
|
90
|
+
|
91
|
+
it('User should be able to undo multiple highlight regions by using the \'Undo\' tool', () => {
|
92
|
+
cy.log('Switching to Edit Tab')
|
93
|
+
highlightImagePage.steps.switchToEditTab();
|
94
|
+
for (var i = 0; i < 11; i++) {
|
95
|
+
highlightImagePage.steps.clickOnUndoTool();
|
96
|
+
};
|
97
|
+
cy.log('Switching to Preview Tab')
|
98
|
+
highlightImagePage.steps.switchToPreviewTab();
|
99
|
+
utilities.verifyElementVisibilityState(highlightImagePage.previewTabHighlight(), 'notExist')
|
100
|
+
});
|
101
|
+
|
102
|
+
it('When the user clicks on the \'Redo\' tool multiple times after performing an undo action, then all the highlight region should be displayed again in the \'Preview\' tab', () => {
|
103
|
+
cy.log('Switching to Edit Tab')
|
104
|
+
highlightImagePage.steps.switchToEditTab();
|
105
|
+
for (var i = 0; i < 11; i++) {
|
106
|
+
highlightImagePage.steps.clickOnRedoTool();
|
107
|
+
};
|
108
|
+
cy.log('Switching to Preview Tab')
|
109
|
+
highlightImagePage.steps.switchToPreviewTab();
|
110
|
+
highlightImagePage.steps.verifyHighlightRegionsInPreviewTab(0, flowerHighlightRegion);
|
111
|
+
highlightImagePage.steps.verifyHighlightRegionsInPreviewTab(1, leafHighlightRegion);
|
112
|
+
highlightImagePage.steps.verifyHighlightRegionCountInPreviewTab(2);
|
113
|
+
});
|
114
|
+
});
|
115
|
+
|
116
|
+
describe('\'Item eraser\' tool functionality - Preview tab', () => {
|
117
|
+
abortEarlySetup();
|
118
|
+
before(() => {
|
119
|
+
cy.log('Navigating to Highlight image question type');
|
120
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
121
|
+
cy.log('Uploading an image');
|
122
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
123
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
124
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
125
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
126
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
127
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
128
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
129
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
130
|
+
});
|
131
|
+
|
132
|
+
it('When the user deletes the highlight using \'Item eraser\' tool, the deleted highlight should not be visible in \'Preview\' tab', () => {
|
133
|
+
highlightImagePage.steps.eraseAHighlightRegion([flowerHighlightRegion[0]]);
|
134
|
+
cy.log('Switching to Preview Tab')
|
135
|
+
highlightImagePage.steps.switchToPreviewTab();
|
136
|
+
highlightImagePage.steps.verifyHighlightRegionCountInPreviewTab(1);
|
137
|
+
});
|
138
|
+
});
|
139
|
+
|
140
|
+
describe('\'Clear all\' tool functionality - Preview tab', () => {
|
141
|
+
abortEarlySetup();
|
142
|
+
before(() => {
|
143
|
+
cy.log('Navigating to Highlight image question type');
|
144
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
145
|
+
cy.log('Uploading an image');
|
146
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
147
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
148
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
149
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
150
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
151
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
152
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
153
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
154
|
+
});
|
155
|
+
|
156
|
+
it('When the user deletes all the highlights using \'Clear all\' tool, no highlights should be visible in \'Preview\' tab', () => {
|
157
|
+
highlightImagePage.steps.clickOnClearAllTool();
|
158
|
+
cy.log('Switching to Preview Tab')
|
159
|
+
highlightImagePage.steps.switchToPreviewTab();
|
160
|
+
utilities.verifyElementVisibilityState(highlightImagePage.previewTabHighlight(), 'notExist')
|
161
|
+
});
|
162
|
+
});
|
163
|
+
});
|