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,235 @@
|
|
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
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
const flowerHighlightRegion = [[24, 6], [24, 24], [56, 24], [56, 6]];
|
8
|
+
const branchesHighlightRegion = [[36, 36], [36, 46], [58, 46], [58, 36]];
|
9
|
+
const leafHighlightRegion = [[54, 48], [54, 72], [82, 72], [82, 48]];
|
10
|
+
const rootsHighlightRegion = [[28, 84], [28, 98], [74, 98], [74, 84]];
|
11
|
+
|
12
|
+
describe('Create Item page - Highlight image: Preview tab Scoring Section', () => {
|
13
|
+
before(() => {
|
14
|
+
cy.loginAs('admin');
|
15
|
+
});
|
16
|
+
|
17
|
+
describe('Show correct answer', () => {
|
18
|
+
abortEarlySetup();
|
19
|
+
before(() => {
|
20
|
+
cy.log('Navigating to highlight image question type');
|
21
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
22
|
+
cy.barsPreLoaderWait();
|
23
|
+
highlightImagePage.steps.addQuestionInstructions();
|
24
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
25
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
26
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
27
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
28
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
29
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
30
|
+
});
|
31
|
+
|
32
|
+
highlightImagePage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet();
|
33
|
+
|
34
|
+
it('When the user has set correct answer options and alloted points \'Show correct answer\' checkbox should be displayed and it should be unchecked by default and points for the question should be displayed beside it', () => {
|
35
|
+
highlightImagePage.steps.switchToEditTab();
|
36
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
37
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
38
|
+
highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
|
39
|
+
highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
|
40
|
+
highlightImagePage.steps.allotPoints(10);
|
41
|
+
highlightImagePage.steps.switchToPreviewTab();
|
42
|
+
highlightImagePage.steps.verifyDefaultShowCorrectAnswerCheckboxAndLabel();
|
43
|
+
highlightImagePage.steps.verifyPreviewTabScoreText(0, 10);
|
44
|
+
});
|
45
|
+
|
46
|
+
it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab users response should not persist', () => {
|
47
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(0);
|
48
|
+
highlightImagePage.steps.switchToEditTab();
|
49
|
+
highlightImagePage.steps.switchToPreviewTab();
|
50
|
+
highlightImagePage.steps.verifyRegionIsNotHighlighted(0);
|
51
|
+
highlightImagePage.steps.verifyRegionIsNotHighlighted(1);
|
52
|
+
highlightImagePage.steps.verifyRegionIsNotHighlighted(2);
|
53
|
+
});
|
54
|
+
});
|
55
|
+
|
56
|
+
describe('Question Preview: AutoScored - All or Nothing', () => {
|
57
|
+
abortEarlySetup();
|
58
|
+
before(() => {
|
59
|
+
cy.log('Navigating to highlight image question type');
|
60
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
61
|
+
cy.barsPreLoaderWait();
|
62
|
+
highlightImagePage.steps.addQuestionInstructions();
|
63
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
64
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
65
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
66
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
67
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
68
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
69
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
70
|
+
highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
|
71
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
72
|
+
highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
|
73
|
+
highlightImagePage.steps.checkMultipleSelectionCheckbox();
|
74
|
+
highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
|
75
|
+
highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(3);
|
76
|
+
highlightImagePage.steps.allotPoints(20);
|
77
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
78
|
+
highlightImagePage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
79
|
+
highlightImagePage.steps.switchToPreviewTab();
|
80
|
+
});
|
81
|
+
|
82
|
+
highlightImagePage.tests.verifyCSSOfPreviewAndEditTabAndScoringContents();
|
83
|
+
|
84
|
+
highlightImagePage.tests.verifya11yOfCreateItemWrapperContents();
|
85
|
+
|
86
|
+
it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct tab regions should be highlighted with green border and green background, border and label should not be displayed below the question preview, and correct answer container should not be displayed', () => {
|
87
|
+
highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
|
88
|
+
highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
|
89
|
+
highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
90
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(0);
|
91
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(3);
|
92
|
+
highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
|
93
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
94
|
+
highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
|
95
|
+
});
|
96
|
+
|
97
|
+
it('When user selects Check answer button without attempting the question, correct/incorrect answer border for the question and label should not be displayed below the question preview and correct answer container should not be displayed', () => {
|
98
|
+
highlightImagePage.steps.checkAnswer();
|
99
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(0);
|
100
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(1);
|
101
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(2);
|
102
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(3);
|
103
|
+
highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
|
104
|
+
highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
105
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
106
|
+
highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
|
107
|
+
});
|
108
|
+
|
109
|
+
it('When user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and incorrect regions should be displayed with red cross-mark icons and red background, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with \'Correct answers:\' label and all correct answers along with numeration should be displayed', () => {
|
110
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(1);
|
111
|
+
highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
|
112
|
+
highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
|
113
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(0);
|
114
|
+
highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
|
115
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(2);
|
116
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(3);
|
117
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
|
118
|
+
highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
|
119
|
+
highlightImagePage.steps.verifyHighlightNumerationPreviewTab(3, 4);
|
120
|
+
utilities.verifyInnerText(highlightImagePage.correctAnswerContainerLabel(), 'Correct answers:');
|
121
|
+
highlightImagePage.steps.verifyIncorrectAttemptBorder();
|
122
|
+
highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
123
|
+
|
124
|
+
highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
125
|
+
|
126
|
+
cy.log('When user attempts the question incorrectly and clicks on the \'Check answer\' button, the user should be awarded 0 points and incorrect regions should be displayed with red cross-mark icons and red background, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
|
127
|
+
highlightImagePage.steps.checkAnswer();
|
128
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(0);
|
129
|
+
highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
|
130
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(2);
|
131
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(3);
|
132
|
+
highlightImagePage.steps.verifyIncorrectAttemptBorder();
|
133
|
+
highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
134
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
135
|
+
});
|
136
|
+
|
137
|
+
it('CSS of incorrect answer state', { tags: 'css' }, () => {
|
138
|
+
highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
|
139
|
+
cy.log('Verifying CSS of incorrect cross-mark icon')
|
140
|
+
utilities.verifyCSS(highlightImagePage.correctIncorectAnswerLabel(), {
|
141
|
+
'color': css.color.incorrectAnswer,
|
142
|
+
'font-size': css.fontSize.normal,
|
143
|
+
'font-weight': css.fontWeight.bold
|
144
|
+
});
|
145
|
+
highlightImagePage.steps.verifyIncorrectAttemptBorder();
|
146
|
+
highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
|
147
|
+
});
|
148
|
+
|
149
|
+
it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
|
150
|
+
highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
|
151
|
+
cy.checkAccessibility(highlightImagePage.previewTabQuestionWrapper());
|
152
|
+
cy.log('Post step: Deselect show answer checkbox')
|
153
|
+
highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
|
154
|
+
});
|
155
|
+
|
156
|
+
it('When user attempts the question partially correct by selecting some correct regions and incorrect regions then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points, green check-mark icons and green background should be displayed for the correct regions, red cross-mark icons and red background should be displayed for the incorrect selected regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with the unattempted correct tab answer along with numeration should be displayed', () => {
|
157
|
+
highlightImagePage.steps.resetQuestionPreview();
|
158
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(0);
|
159
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(1);
|
160
|
+
highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
|
161
|
+
highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
|
162
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(0);
|
163
|
+
highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
|
164
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(2);
|
165
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(3);
|
166
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 4'], [1]);
|
167
|
+
highlightImagePage.steps.verifyHighlightNumerationPreviewTab(3, 4);
|
168
|
+
highlightImagePage.steps.verifyIncorrectAttemptBorder();
|
169
|
+
highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
170
|
+
|
171
|
+
highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
172
|
+
|
173
|
+
cy.log('When user attempts the question partially correct and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed beside the correct regions, red cross-mark icons and red background should be displayed beside the incorrect selected regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
|
174
|
+
highlightImagePage.steps.checkAnswer();
|
175
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(0);
|
176
|
+
highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
|
177
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(2);
|
178
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(3);
|
179
|
+
highlightImagePage.steps.verifyIncorrectAttemptBorder();
|
180
|
+
highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
181
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
182
|
+
});
|
183
|
+
|
184
|
+
it('When user attempts the question correctly then on selecting \'Show correct answer\' checkbox, the user should be awarded full points and green check-mark icons and green background should be displayed in all correct highlight regions, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed', () => {
|
185
|
+
highlightImagePage.steps.resetQuestionPreview();
|
186
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(0);
|
187
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(3);
|
188
|
+
highlightImagePage.steps.verifyPreviewTabScoreText(20, 20);
|
189
|
+
highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
|
190
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(0);
|
191
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(1);
|
192
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(2);
|
193
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(3);
|
194
|
+
highlightImagePage.steps.verifyCorrectAttemptBorder();
|
195
|
+
highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
196
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
197
|
+
|
198
|
+
highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
199
|
+
|
200
|
+
cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, the user should be awarded full points and green check-mark icons and green background should be displayed in all correct highlight regions, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
|
201
|
+
highlightImagePage.steps.checkAnswer();
|
202
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(0);
|
203
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(1);
|
204
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(2);
|
205
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(3);
|
206
|
+
highlightImagePage.steps.verifyCorrectAttemptBorder();
|
207
|
+
highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
208
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
209
|
+
});
|
210
|
+
|
211
|
+
it('CSS of check score text full score state and Correct Answer label', { tags: 'css' }, () => {
|
212
|
+
utilities.verifyCSS(highlightImagePage.previewScoreText(), {
|
213
|
+
'color': css.color.primaryBtn,
|
214
|
+
'background-color': css.color.correctAnswer
|
215
|
+
});
|
216
|
+
utilities.verifyCSS(highlightImagePage.correctIncorectAnswerLabel(), {
|
217
|
+
'color': css.color.correctAnswer,
|
218
|
+
'font-size': css.fontSize.normal,
|
219
|
+
'font-weight': css.fontWeight.bold
|
220
|
+
});
|
221
|
+
utilities.verifyCSS(highlightImagePage.correctIncorectAnswerLabel(), {
|
222
|
+
'color': css.color.correctAnswer,
|
223
|
+
'font-size': css.fontSize.normal,
|
224
|
+
'font-weight': css.fontWeight.bold
|
225
|
+
});
|
226
|
+
highlightImagePage.steps.verifyCorrectAttemptBorder();
|
227
|
+
});
|
228
|
+
|
229
|
+
it('Accessibility of check score text full score state and Correct Answer label', { tags: 'a11y' }, () => {
|
230
|
+
cy.checkAccessibility(highlightImagePage.previewTabQuestionWrapper());
|
231
|
+
});
|
232
|
+
|
233
|
+
highlightImagePage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(20);
|
234
|
+
});
|
235
|
+
});
|