itemengine-cypress-automation 1.0.198-drawingResponseEnumUpdate-1aa98cf.0 → 1.0.198
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ImageHighlight/editTabScoring.js +355 -0
- package/cypress/e2e/ILC/ImageHighlight/headerSection.js +83 -0
- package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +205 -0
- package/cypress/e2e/ILC/ImageHighlight/specifyCorrectAnswerSection.js +92 -0
- package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +404 -0
- package/cypress/e2e/ILC/ImageHighlight/supportedFileTypes.js +42 -0
- package/cypress/e2e/ILC/ImageHighlight/toolSettings.js +73 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/editTabScoring.js +253 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialDifferentWeightsBasic.js +114 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +288 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialEqualWeightsBasic.js +164 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/previewContentsForAllViews.smoke.js +168 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/setPointsPopup.js +83 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/specifyCorrectAnswerSection.js +114 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/studentViewSettings.js +179 -0
- package/cypress/e2e/ILC/ListOrderingNew/horizontalOrientationAllOrNothingForAllViews.smoke.js +214 -0
- package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +5 -21
- package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +3 -37
- package/cypress/e2e/ILC/VideoResponseNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/fixtures/uploads/sampleVirus.zip +0 -0
- package/cypress/pages/components/draggableOptionContainer.js +1 -1
- package/cypress/pages/components/enableOuterBorderComponent.js +16 -2
- package/cypress/pages/components/index.js +3 -1
- package/cypress/pages/components/scoringSectionBase.js +1 -1
- package/cypress/pages/components/setPointsPopupBase.js +7 -10
- package/cypress/pages/components/showAvailableOptionsToStudents.js +76 -0
- package/cypress/pages/components/showStudentMaximumNumberOfPossibleSelections.js +56 -0
- package/cypress/pages/imageHighlightPage.js +434 -4
- package/cypress/pages/listOrderingPage.js +287 -43
- package/cypress/pages/textSelectionPage.js +6 -71
- package/package.json +2 -2
@@ -0,0 +1,92 @@
|
|
1
|
+
import { imageHighlightPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const flowerHighlightRegion = [[30, 10], [30, 20], [45, 20], [45, 10]];
|
7
|
+
const branchesHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
|
8
|
+
const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
|
9
|
+
|
10
|
+
describe('Create Item page - Matching : Specify correct answer, Alternative correct answer', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('Specify correct answer section - \'Correct\' accordion', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
19
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
20
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
21
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
22
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
23
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
24
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
25
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
26
|
+
});
|
27
|
+
|
28
|
+
imageHighlightPage.tests.verifyAutoScoredSpecifyCorrectAnswerHeaderSectionContents('image highlight');
|
29
|
+
|
30
|
+
it('In the \'Correct\' accordion the highlight region should be displayed with numeration and they should not be highlighted by default in the \'Specify correct answer\' options section', () => {
|
31
|
+
utilities.verifyElementCount(imageHighlightPage.specifyCorrectAnswerSectionHighlight(), 3);
|
32
|
+
imageHighlightPage.steps.verifyHighlightRegionNumerationSpecifyCorrectAnswer();
|
33
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
34
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(0);
|
35
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(1);
|
36
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(2);
|
37
|
+
});
|
38
|
+
|
39
|
+
imageHighlightPage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
|
40
|
+
});
|
41
|
+
|
42
|
+
describe('Specify correct answer section - \'Alternative\' accordion', () => {
|
43
|
+
abortEarlySetup();
|
44
|
+
before(() => {
|
45
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
46
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
47
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
48
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
49
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
50
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
51
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
52
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
53
|
+
});
|
54
|
+
|
55
|
+
imageHighlightPage.tests.verifyAutoScoredAddAlternativeAnswerButtonAndValidation();
|
56
|
+
|
57
|
+
it('When user has added points and set correct answers in the \'Correct\' accordion, then the user should be able to add alternative answer for the question using \'Add alternative answer\' button', () => {
|
58
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
59
|
+
imageHighlightPage.steps.allotPoints(20);
|
60
|
+
imageHighlightPage.steps.addAlternativeAnswerAccordion(1);
|
61
|
+
});
|
62
|
+
|
63
|
+
it('The image and highlight regions should be displayed in the \'Alternative\' accordion options section in unselected state', () => {
|
64
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
65
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(0);
|
66
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(1);
|
67
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(2);
|
68
|
+
});
|
69
|
+
|
70
|
+
imageHighlightPage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Alternative');
|
71
|
+
|
72
|
+
it('User should be able to add another alternative answer for the question using \'Add alternative answer\' button and the name for this new accordion should be \'Alternative 2\'', () => {
|
73
|
+
imageHighlightPage.steps.addAlternativeAnswerAccordion(2);
|
74
|
+
});
|
75
|
+
|
76
|
+
imageHighlightPage.tests.verifyWarningPopupAndAccordionNavigationWhenNoPointsAddedInAlternativeAccordion();
|
77
|
+
|
78
|
+
it('User should be able to remove alternative correct answer by clicking on the \'Delete\' icon button alongside alternative answer accordion and the name of the alternative answer accordions should get updated accordingly', () => {
|
79
|
+
cy.log('Set correct answer and points in alternative 2 accordion, then switch to alternative 1 accordion and click delete icon button');
|
80
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
81
|
+
imageHighlightPage.steps.allotPoints(5);
|
82
|
+
imageHighlightPage.steps.deleteAlternativeAnswerAccordion(1);
|
83
|
+
imageHighlightPage.steps.verifyAlternativeAnswerAccordionNotExists(2);
|
84
|
+
imageHighlightPage.steps.verifyAlternativeAnswerAccordionLabel(0);
|
85
|
+
});
|
86
|
+
|
87
|
+
it('When the user deletes an option assigned as correct in the correct accordion then the correct accordion should be in the expanded state', () => {
|
88
|
+
imageHighlightPage.steps.eraseAHighlightRegion(leafHighlightRegion);
|
89
|
+
imageHighlightPage.steps.verifyCorrectAnswerAccordionIsExpanded();
|
90
|
+
});
|
91
|
+
});
|
92
|
+
});
|
@@ -0,0 +1,404 @@
|
|
1
|
+
import { imageHighlightPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const flowerHighlightRegion = [[30, 10], [30, 20], [45, 20], [45, 10]];
|
7
|
+
const branchesHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
|
8
|
+
const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
|
9
|
+
|
10
|
+
describe('Image highlight - Student view settings', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('Enable outer border for question: Edit tab', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
});
|
21
|
+
|
22
|
+
imageHighlightPage.tests.verifyEnableOuterBorderContents();
|
23
|
+
});
|
24
|
+
|
25
|
+
describe('Enable outer border for question: Preview tab', () => {
|
26
|
+
abortEarlySetup();
|
27
|
+
before(() => {
|
28
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
29
|
+
cy.barsPreLoaderWait();
|
30
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
31
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
32
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
33
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
34
|
+
});
|
35
|
+
|
36
|
+
it('When the \'Enable outer border for question\' checkbox is in checked state, an outer border over the question preview should be visible', () => {
|
37
|
+
imageHighlightPage.steps.verifyOuterBorderForQuestion();
|
38
|
+
});
|
39
|
+
|
40
|
+
it('CSS of the outer border', { tags: 'css' }, () => {
|
41
|
+
utilities.verifyCSS(imageHighlightPage.imagePreviewTabWrapper(), {
|
42
|
+
'border': `1px solid ${css.color.draggableOptionsContainerBorder}`
|
43
|
+
});
|
44
|
+
});
|
45
|
+
|
46
|
+
it('When the user unchecks the \'Enable outer border for question\' checkbox, then the outer border over the question preview should not be displayed', () => {
|
47
|
+
imageHighlightPage.steps.switchToEditTab();
|
48
|
+
imageHighlightPage.steps.uncheckEnableOuterBorderCheckbox();
|
49
|
+
imageHighlightPage.steps.switchToPreviewTab()
|
50
|
+
imageHighlightPage.steps.verifyOuterBorderOfQuestionPreviewNotExists();
|
51
|
+
});
|
52
|
+
});
|
53
|
+
|
54
|
+
describe('Allow student to check answer: Edit tab', () => {
|
55
|
+
abortEarlySetup();
|
56
|
+
before(() => {
|
57
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
58
|
+
cy.barsPreLoaderWait();
|
59
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
60
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
61
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
62
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
63
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
64
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
65
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
66
|
+
imageHighlightPage.steps.allotPoints(5);
|
67
|
+
});
|
68
|
+
|
69
|
+
imageHighlightPage.tests.verifyAllowStudentsToCheckAnswerLabelAndCheckboxCSS();
|
70
|
+
|
71
|
+
imageHighlightPage.tests.verifyMaximumAttemptsDropdownDisplayedWhenAllowStudentsToCheckAnswerIsChecked();
|
72
|
+
|
73
|
+
imageHighlightPage.tests.verifyMaxCheckAnswerAttemptsDropdown();
|
74
|
+
|
75
|
+
imageHighlightPage.tests.verifyAllowStudentsToCheckAnswerContentsCSSAndA11y();
|
76
|
+
});
|
77
|
+
|
78
|
+
describe('Allow student to check answer: Preview tab', () => {
|
79
|
+
abortEarlySetup();
|
80
|
+
before(() => {
|
81
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
82
|
+
cy.barsPreLoaderWait();
|
83
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
84
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
85
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
86
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
87
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
88
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
89
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
90
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
91
|
+
imageHighlightPage.steps.allotPoints(20);
|
92
|
+
});
|
93
|
+
|
94
|
+
it('When the user has added options and specified correct answer and points then on checking the \'Allow student to check answer\' checkbox the Check answer button should be displayed in the preview tab', () => {
|
95
|
+
imageHighlightPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
96
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
97
|
+
utilities.verifyInnerText(imageHighlightPage.checkAnswerButton(), 'Check answer');
|
98
|
+
});
|
99
|
+
|
100
|
+
it('When the user highlights a region and checks the answer then an icon should be displayed beside the selected option and the check answer button should be in enabled state', () => {
|
101
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
102
|
+
imageHighlightPage.steps.checkAnswer();
|
103
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
104
|
+
imageHighlightPage.steps.verifyCheckAnswerButtonEnabled();
|
105
|
+
});
|
106
|
+
|
107
|
+
it('When the user selects an option from the Maximum check answer attempts dropdown then the user should be able to check answer only those many times in the preview tab', () => {
|
108
|
+
imageHighlightPage.steps.switchToEditTab();
|
109
|
+
imageHighlightPage.steps.expandMaxCheckAnswerAttemptsDropdown();
|
110
|
+
imageHighlightPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('1');
|
111
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
112
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
113
|
+
imageHighlightPage.steps.checkAnswer();
|
114
|
+
imageHighlightPage.steps.verifyCheckAnswerButtonDisabled();
|
115
|
+
});
|
116
|
+
|
117
|
+
imageHighlightPage.tests.verifyDisabledCheckAnswerButtonWithCSSAndA11y();
|
118
|
+
|
119
|
+
it('When the user updates the value of \'Maximum check answer attempts\' dropdown, it should get reflected on the Preview tab', () => {
|
120
|
+
imageHighlightPage.steps.switchToEditTab();
|
121
|
+
imageHighlightPage.steps.expandMaxCheckAnswerAttemptsDropdown();
|
122
|
+
imageHighlightPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('3');
|
123
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
124
|
+
imageHighlightPage.steps.verifyCheckAnswerButtonEnabled();
|
125
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
126
|
+
imageHighlightPage.steps.checkAnswer();
|
127
|
+
imageHighlightPage.steps.verifyCheckAnswerButtonEnabled();
|
128
|
+
});
|
129
|
+
|
130
|
+
it('When the user selects \'No limit\' option from the dropdown then user should be able to check answer multiple times', () => {
|
131
|
+
imageHighlightPage.steps.switchToEditTab();
|
132
|
+
imageHighlightPage.steps.expandMaxCheckAnswerAttemptsDropdown();
|
133
|
+
imageHighlightPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('0');
|
134
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
135
|
+
imageHighlightPage.steps.verifyCheckAnswerButtonEnabled();
|
136
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
137
|
+
imageHighlightPage.steps.checkAnswer();
|
138
|
+
imageHighlightPage.steps.verifyCheckAnswerButtonEnabled();
|
139
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
140
|
+
imageHighlightPage.steps.checkAnswer();
|
141
|
+
imageHighlightPage.steps.verifyCheckAnswerButtonEnabled();
|
142
|
+
});
|
143
|
+
});
|
144
|
+
|
145
|
+
describe('Show the available options to students: Edit tab', () => {
|
146
|
+
abortEarlySetup();
|
147
|
+
before(() => {
|
148
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
149
|
+
cy.barsPreLoaderWait();
|
150
|
+
});
|
151
|
+
|
152
|
+
imageHighlightPage.tests.verifyShowAvailableOptionsToStudentsEditTab();
|
153
|
+
});
|
154
|
+
|
155
|
+
describe('Show the available options to students: Preview tab', () => {
|
156
|
+
abortEarlySetup();
|
157
|
+
before(() => {
|
158
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
159
|
+
cy.barsPreLoaderWait();
|
160
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
161
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
162
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
163
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
164
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
165
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
166
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
167
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
168
|
+
imageHighlightPage.steps.allotPoints(20);
|
169
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
170
|
+
});
|
171
|
+
|
172
|
+
it('When \'Show the available options to students\' checkbox is unchecked, then in preview tab the options should be displayed in standard state without any highlighted background', () => {
|
173
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
174
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
175
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
176
|
+
});
|
177
|
+
|
178
|
+
it('When \'Show the available options to students\' checkbox is checked, then in preview tab the available options should be displayed with a highlighted background', () => {
|
179
|
+
imageHighlightPage.steps.switchToEditTab();
|
180
|
+
imageHighlightPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
|
181
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
182
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
183
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
184
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
185
|
+
});
|
186
|
+
|
187
|
+
it('When user selects an option in preview tab, then that option should be selected', () => {
|
188
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
189
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
190
|
+
imageHighlightPage.steps.verifySelectedHighlightRegionInPreviewTab(0);
|
191
|
+
imageHighlightPage.steps.verifySelectedHighlightRegionInPreviewTab(1);
|
192
|
+
});
|
193
|
+
|
194
|
+
it('When user deselects an option in preview tab, then that option should be displayed as available option with a highlighted background', () => {
|
195
|
+
imageHighlightPage.steps.removeHighlightOfARegionInPreviewTab(0);
|
196
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
197
|
+
});
|
198
|
+
|
199
|
+
it('Accessibility of options with highlighted background', { tags: 'a11y' }, () => {
|
200
|
+
cy.checkAccessibility(imageHighlightPage.previewTabQuestionWrapper());
|
201
|
+
});
|
202
|
+
|
203
|
+
it('When \'Show the available options to students\' checkbox is unchecked again, then in preview tab the available options should be not be displayed with a highlighted background', () => {
|
204
|
+
imageHighlightPage.steps.switchToEditTab();
|
205
|
+
imageHighlightPage.steps.uncheckShowAvailableOptionsToStudentsCheckbox();
|
206
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
207
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
208
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
209
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
210
|
+
});
|
211
|
+
});
|
212
|
+
|
213
|
+
describe('Maximum number of possible selections and Show student the maximum number of possible selections: Edit tab', () => {
|
214
|
+
const listOptions = ['No limit', '1', '2', '3'];
|
215
|
+
abortEarlySetup();
|
216
|
+
before(() => {
|
217
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
218
|
+
cy.barsPreLoaderWait();
|
219
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
220
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
221
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
222
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
223
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
224
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
225
|
+
});
|
226
|
+
|
227
|
+
it('\'Maximum number of possible selections\' label and dropdown should be displayed. By default the \'No limit\' should be the selected option in the \'Maximum number of possible selections\' dropdown', () => {
|
228
|
+
utilities.verifyInnerText(imageHighlightPage.maxNumberOfPossibleSelectionsLabel(), 'Maximum number of possible selections');
|
229
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.maxNumberOfPossibleSelectionsLabel(), 'visible');
|
230
|
+
utilities.verifyInnerText(imageHighlightPage.maxNumberOfPossibleSelectionsDropdown(), 'No limit');
|
231
|
+
});
|
232
|
+
|
233
|
+
it('When no options are selected in specify possible options section, then only No limit option should be displayed in the \'Maximum number of possible selections\' dropdown', () => {
|
234
|
+
imageHighlightPage.steps.expandMaxNumberOfPossibleSelectionsDropdown();
|
235
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.dropdownList(), 'visible');
|
236
|
+
imageHighlightPage.steps.verifyMaxNumberOfPossibleSelectionsDropdownListOptions([listOptions[0]]);
|
237
|
+
imageHighlightPage.steps.selectOptionFromMaxNumberOfPossibleSelectionsDropdown('no limit');
|
238
|
+
});
|
239
|
+
|
240
|
+
it('When the user adds new options, the list options in the \'Maximum number of possible selections\' dropdown should also update accordingly', () => {
|
241
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
242
|
+
imageHighlightPage.steps.expandMaxNumberOfPossibleSelectionsDropdown();
|
243
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.dropdownList(), 'visible');
|
244
|
+
imageHighlightPage.steps.verifyMaxNumberOfPossibleSelectionsDropdownListOptions(listOptions);
|
245
|
+
imageHighlightPage.steps.selectOptionFromMaxNumberOfPossibleSelectionsDropdown('no limit');
|
246
|
+
});
|
247
|
+
|
248
|
+
it('CSS of \'Maximum number of possible selections\' dropdown in active state', { tags: 'css' }, () => {
|
249
|
+
utilities.verifyCSS(imageHighlightPage.dropdownListOption().eq(1), {
|
250
|
+
'color': css.color.liText,
|
251
|
+
'font-size': css.fontSize.default,
|
252
|
+
'font-weight': css.fontWeight.regular,
|
253
|
+
'background-color': css.color.liTextSelectedBg
|
254
|
+
});
|
255
|
+
utilities.verifyCSS(imageHighlightPage.dropdownListOption().eq(0), {
|
256
|
+
'background-color': css.color.transparent
|
257
|
+
});
|
258
|
+
});
|
259
|
+
|
260
|
+
it('Accessibility of \'Maximum number of possible selections\' dropdown in active state', { tags: 'a11y' }, () => {
|
261
|
+
cy.checkAccessibility(imageHighlightPage.dropdownList())
|
262
|
+
});
|
263
|
+
|
264
|
+
it('When the user selects a finite number of options value from the \'Maximum number of possible selections\' dropdown, then the user should only be able to set correct answers in the specify correct answer section according to the selected option', () => {
|
265
|
+
imageHighlightPage.steps.expandMaxNumberOfPossibleSelectionsDropdown();
|
266
|
+
imageHighlightPage.steps.selectOptionFromMaxNumberOfPossibleSelectionsDropdown('2');
|
267
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
268
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
269
|
+
});
|
270
|
+
|
271
|
+
it('When user tries to select more number of options than the maximum number of options dropdown, then error message \'Error: maximum # options can be selected.\' should be displayed and user should not be able to select the option', () => {
|
272
|
+
imageHighlightPage.steps.clickOnARegionInSpecifyCorrectAnswerSection(2);
|
273
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(2);
|
274
|
+
utilities.verifyInnerText(imageHighlightPage.maximumOptionsCanBeSelectedErrorMessage(), 'Error: maximum 2 options can be selected.');
|
275
|
+
});
|
276
|
+
|
277
|
+
it('\'Show student the maximum number of possible selections\' label and checkbox should be displayed. By default the checkbox should be unchecked', () => {
|
278
|
+
utilities.verifyInnerText(imageHighlightPage.showStudentMaximumNumberOfPossibleSelectionsLabel(), 'Show student the maximum number of possible selections');
|
279
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.showStudentMaximumNumberOfPossibleSelectionsLabel(), 'visible');
|
280
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.showStudentMaximumNumberOfPossibleSelectionsCheckbox(), 'exist');
|
281
|
+
imageHighlightPage.steps.verifyShowStudentTheMaxNumberOfSelectionsCheckboxIsUnchecked();
|
282
|
+
});
|
283
|
+
|
284
|
+
it('CSS of \'Show student the maximum number of possible selections\' checkbox and label - unchecked state', { tags: 'css' }, () => {
|
285
|
+
utilities.verifyCSS(imageHighlightPage.showStudentMaximumNumberOfPossibleSelectionsLabel(), {
|
286
|
+
'color': css.color.labelText,
|
287
|
+
'font-size': css.fontSize.normal,
|
288
|
+
'font-weight': css.fontWeight.regular
|
289
|
+
});
|
290
|
+
utilities.verifyCSS(imageHighlightPage.showStudentMaximumNumberOfPossibleSelectionsCheckbox().parent().find('svg'), {
|
291
|
+
'fill': css.color.uncheckedCheckbox
|
292
|
+
});
|
293
|
+
});
|
294
|
+
|
295
|
+
it('When the user checks the \'Show student the maximum number of possible selections\' checkbox, help text should not be displayed in the specify correct answer section', () => {
|
296
|
+
imageHighlightPage.steps.checkShowStudentTheMaxNumberOfSelectionsCheckbox();
|
297
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.maximumNumberOfSelectionsHelpText(), 'notExist');
|
298
|
+
});
|
299
|
+
|
300
|
+
it('CSS of \'Show student the maximum number of possible selections\' label and checkbox - checked state', { tags: 'css' }, () => {
|
301
|
+
utilities.verifyCSS(imageHighlightPage.showStudentMaximumNumberOfPossibleSelectionsCheckbox().parent().find('svg g g').eq(0), {
|
302
|
+
'fill': css.color.activeButtons
|
303
|
+
});
|
304
|
+
});
|
305
|
+
|
306
|
+
it('Accessibility of \'Show student the maximum number of possible selections\' checkbox - checked state', { tags: 'a11y' }, () => {
|
307
|
+
cy.checkAccessibility(imageHighlightPage.showStudentMaximumNumberOfPossibleSelectionsCheckbox().parents('[data-ngie-testid="show-student-the-maximum-number-of-possible-selections-checkbox"]'));
|
308
|
+
});
|
309
|
+
|
310
|
+
it('When the user selects \'No limit\' from the \'Maximum number of possible selections\' dropdown, then the user should be able to set n number of highlights in the specify correct answer section', () => {
|
311
|
+
imageHighlightPage.steps.expandMaxNumberOfPossibleSelectionsDropdown();
|
312
|
+
imageHighlightPage.steps.selectOptionFromMaxNumberOfPossibleSelectionsDropdown('no limit');
|
313
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
314
|
+
});
|
315
|
+
});
|
316
|
+
|
317
|
+
describe('Maximum number of possible selections and Show student the maximum number of possible selections: Preview tab', () => {
|
318
|
+
abortEarlySetup();
|
319
|
+
before(() => {
|
320
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
321
|
+
cy.barsPreLoaderWait();
|
322
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
323
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
324
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
325
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
326
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
327
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
328
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
329
|
+
});
|
330
|
+
|
331
|
+
it('When the user selects a finite number of options value from the \'Maximum number of possible selections\' dropdown, then the user should only be able to select options in the preview tab according to the selected maximum limit', () => {
|
332
|
+
imageHighlightPage.steps.expandMaxNumberOfPossibleSelectionsDropdown();
|
333
|
+
imageHighlightPage.steps.selectOptionFromMaxNumberOfPossibleSelectionsDropdown('2');
|
334
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
335
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
336
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
337
|
+
});
|
338
|
+
|
339
|
+
it('When user tries to select more number of options than the maximum limit, then error message \'Maximum n options can be selected.\' should be displayed and extra options should not be selected', () => {
|
340
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(2);
|
341
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedPreviewTab(2);
|
342
|
+
utilities.verifyInnerText(imageHighlightPage.maximumOptionsCanBeSelectedErrorMessagePreviewTab(), 'Maximum 2 options can be selected.');
|
343
|
+
});
|
344
|
+
|
345
|
+
it('CSS of \'Maximum n options can be selected.\' error message', { tags: 'css' }, () => {
|
346
|
+
utilities.verifyCSS(imageHighlightPage.maximumOptionsCanBeSelectedErrorMessagePreviewTab(), {
|
347
|
+
'color': css.color.warningMessage,
|
348
|
+
'font-size': css.fontSize.normal,
|
349
|
+
'font-weight': css.fontWeight.regular
|
350
|
+
});
|
351
|
+
utilities.verifyCSS(imageHighlightPage.maximumOptionsCanBeSelectedErrorMessageWrapperPreviewTab().find('svg'), {
|
352
|
+
'color': css.color.warningMessage,
|
353
|
+
});
|
354
|
+
utilities.verifyCSS(imageHighlightPage.maximumOptionsCanBeSelectedErrorMessageWrapperPreviewTab(), {
|
355
|
+
'border': `1px solid ${css.color.warningContainerBorder}`
|
356
|
+
});
|
357
|
+
utilities.verifyCSS(imageHighlightPage.maximumOptionsCanBeSelectedErrorMessageWrapperPreviewTab(), {
|
358
|
+
'background-color': css.color.warningContainerBackground
|
359
|
+
});
|
360
|
+
});
|
361
|
+
|
362
|
+
it('Accessibility of \'Maximum n options can be selected.\' error message', { tags: 'a11y' }, () => {
|
363
|
+
cy.checkAccessibility(imageHighlightPage.maximumOptionsCanBeSelectedErrorMessageWrapperPreviewTab());
|
364
|
+
});
|
365
|
+
|
366
|
+
it('When \'Show student the maximum number of possible selections\' checkbox is in unchecked state, no help text should be displayed in the preview tab', () => {
|
367
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.maximumNumberOfSelectionsHelpText(), 'notExist');
|
368
|
+
});
|
369
|
+
|
370
|
+
it('When the user checks the \'Show student the maximum number of possible selections\' checkbox, a help text \'Maximum number of possible selections: n\' should be displayed in the preview tab', () => {
|
371
|
+
imageHighlightPage.steps.switchToEditTab();
|
372
|
+
imageHighlightPage.steps.checkShowStudentTheMaxNumberOfSelectionsCheckbox();
|
373
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
374
|
+
utilities.verifyInnerText(imageHighlightPage.maximumNumberOfSelectionsHelpText(), 'Maximum number of possible selections: 2');
|
375
|
+
});
|
376
|
+
|
377
|
+
it('CSS of help text \'Maximum number of possible selections: n\'', { tags: 'css' }, () => {
|
378
|
+
utilities.verifyCSS(imageHighlightPage.maximumNumberOfSelectionsHelpText(), {
|
379
|
+
'color': css.color.text,
|
380
|
+
'font-size': css.fontSize.default,
|
381
|
+
'font-weight': css.fontWeight.regular
|
382
|
+
});
|
383
|
+
utilities.verifyCSS(imageHighlightPage.maximumNumberOfSelectionsHelpText().find('span'), {
|
384
|
+
'color': css.color.text,
|
385
|
+
'font-size': css.fontSize.default,
|
386
|
+
'font-weight': css.fontWeight.bold
|
387
|
+
});
|
388
|
+
});
|
389
|
+
|
390
|
+
it('Accessibility of help text \'Maximum number of possible selections: n\'', { tags: 'a11y' }, () => {
|
391
|
+
cy.checkAccessibility(imageHighlightPage.maximumNumberOfSelectionsHelpText());
|
392
|
+
});
|
393
|
+
|
394
|
+
it('When the user selects \'No limit\' from the \'Maximum number of possible selections\' dropdown, then the user should be able to set n number of highlights in the preview tab', () => {
|
395
|
+
imageHighlightPage.steps.switchToEditTab();
|
396
|
+
imageHighlightPage.steps.expandMaxNumberOfPossibleSelectionsDropdown();
|
397
|
+
imageHighlightPage.steps.selectOptionFromMaxNumberOfPossibleSelectionsDropdown('no limit');
|
398
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
399
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
400
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
401
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
402
|
+
});
|
403
|
+
});
|
404
|
+
});
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import constants from "../../../fixtures/constants";
|
2
|
+
import { imageHighlightPage } from "../../../pages";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
|
6
|
+
describe('Create Item page - Image highlight: Supported file types', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Supported file types functionality: device popup', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
});
|
17
|
+
|
18
|
+
const supportedFormatFiles = {
|
19
|
+
jpg: 'highlightImage.jpg',
|
20
|
+
jpeg: 'sample.jpeg',
|
21
|
+
png: 'image.png',
|
22
|
+
gif: 'sample.gif',
|
23
|
+
svg: 'sample.svg'
|
24
|
+
};
|
25
|
+
|
26
|
+
Object.keys(supportedFormatFiles).forEach((fileType) => {
|
27
|
+
it(`User should be able to upload ${fileType} file in the upload section using link text \'device\' and it should be displayed in the \'Set correct answer\' section and \'Preview tab\'`, () => {
|
28
|
+
imageHighlightPage.steps.uploadFile(supportedFormatFiles[fileType]);
|
29
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
30
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
31
|
+
imageHighlightPage.steps.verifyUploadedImageFormatInSetCorrectAnswerSection(fileType);
|
32
|
+
cy.log('Checking in preview tab')
|
33
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
34
|
+
imageHighlightPage.steps.verifyUploadedImageFormatInPreviewTab(fileType);
|
35
|
+
imageHighlightPage.steps.switchToEditTab();
|
36
|
+
cy.log('Post step: Delete the image')
|
37
|
+
imageHighlightPage.steps.deleteImage();
|
38
|
+
imageHighlightPage.steps.clickOnDeleteButtonInDeleteImagePopup();
|
39
|
+
});
|
40
|
+
});
|
41
|
+
});
|
42
|
+
});
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import { toolSettingsComponent } from "../../../pages/components";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
import { dialogBoxBase, imageHighlightPage, rulerPage } from "../../../pages";
|
5
|
+
|
6
|
+
const css = Cypress.env('css');
|
7
|
+
|
8
|
+
describe('Create Item page: Tool settings', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Tool settings: Contents', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
17
|
+
});
|
18
|
+
|
19
|
+
toolSettingsComponent.tests.verifyToolSettingsContent();
|
20
|
+
});
|
21
|
+
|
22
|
+
describe('Tool settings: Edit tool settings', () => {
|
23
|
+
abortEarlySetup();
|
24
|
+
before(() => {
|
25
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
26
|
+
toolSettingsComponent.steps.expandToolSettingsAccordion();
|
27
|
+
});
|
28
|
+
|
29
|
+
it('When user clicks on edit icon for ruler tool, then popup for ruler tool settings should be displayed', () => {
|
30
|
+
toolSettingsComponent.steps.clickOnToolEditIcon(0);
|
31
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
32
|
+
});
|
33
|
+
|
34
|
+
it('When user modifies the settings for the ruler tool and clicks the \'Ok\' button, then ruler tool should enter selected state.', () => {
|
35
|
+
rulerPage.steps.expandUnitOfMeasurementDropdown();
|
36
|
+
rulerPage.steps.selectOptionFromUnitOfMeasurementDropdown('Inch');
|
37
|
+
rulerPage.steps.selectOptionFromLengthOfRulerOptions('12 in');
|
38
|
+
rulerPage.steps.selectColorBlock(1);
|
39
|
+
rulerPage.steps.expandRotationDropdown();
|
40
|
+
rulerPage.steps.selectOptionFromRotationDropdown('Allow rotation and display angle');
|
41
|
+
rulerPage.steps.enterInputToOpacityInputField(60);
|
42
|
+
rulerPage.steps.checkAddShowHideButtonCheckbox();
|
43
|
+
toolSettingsComponent.steps.clickOnOkButton();
|
44
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
45
|
+
toolSettingsComponent.steps.verifyToolSelectedState(0);
|
46
|
+
});
|
47
|
+
|
48
|
+
it('When user has made changes for ruler tool in edit tab then changes should be reflected in the ruler tool in the preview tab', () => {
|
49
|
+
cy.log('Switching to Preview Tab');
|
50
|
+
rulerPage.steps.switchToPreviewTab();
|
51
|
+
rulerPage.steps.verifyPreviewTabRulerVisibilityButtonLabel('Show');
|
52
|
+
rulerPage.steps.clickOnRulerVisibilityButton();
|
53
|
+
utilities.verifyElementVisibilityState(rulerPage.rulerPreviewTab(), 'visible');
|
54
|
+
rulerPage.steps.verifyLengthOfRulerInPreview('12in');
|
55
|
+
rulerPage.steps.verifyColorOfRulerInPreview(1);
|
56
|
+
rulerPage.steps.verifyRulerOpacityInPreview('0.6');
|
57
|
+
rulerPage.steps.verifyRotationButtonWithDegreeVisible();
|
58
|
+
});
|
59
|
+
|
60
|
+
it('CSS of the \'Hide ruler\' button', { tags: 'css' }, () => {
|
61
|
+
utilities.verifyCSS(rulerPage.rulerVisibilityButtonPreviewTab(), {
|
62
|
+
'border': `1px solid ${css.color.activeButtons}`,
|
63
|
+
'background-color': css.color.defaultBackground,
|
64
|
+
'font-size': css.fontSize.normal,
|
65
|
+
'font-weight': css.fontWeight.semibold
|
66
|
+
});
|
67
|
+
});
|
68
|
+
|
69
|
+
it('Accessibility of \'Hide ruler\' button', { tags: 'a11y' }, () => {
|
70
|
+
cy.checkAccessibility(rulerPage.rulerVisibilityButtonPreviewTab().parents('[class*="ItemEnginestyles__MainWrapper"]'));
|
71
|
+
});
|
72
|
+
});
|
73
|
+
});
|