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.
Files changed (22) hide show
  1. package/cypress/e2e/ILC/HighlightImage/highlightImageAdditionalSettings.js +219 -0
  2. package/cypress/e2e/ILC/HighlightImage/highlightImageAdditionalSettingsBasic.js +252 -0
  3. package/cypress/e2e/ILC/HighlightImage/highlightImageAllOrNothingScoring.js +235 -0
  4. package/cypress/e2e/ILC/HighlightImage/highlightImageAllOrNothingWithAlternateAnswer.js +810 -0
  5. package/cypress/e2e/ILC/HighlightImage/highlightImageCustomizeHighlightProperties.js +669 -0
  6. package/cypress/e2e/ILC/HighlightImage/highlightImageCustomizeHighlightPropertiesFunctionality.js +356 -0
  7. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.js +125 -0
  8. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabHighlightSectionContents.js +318 -0
  9. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabScoring.js +403 -0
  10. package/cypress/e2e/ILC/HighlightImage/highlightImageHeaderSection.js +86 -0
  11. package/cypress/e2e/ILC/HighlightImage/highlightImageManuallyAndNonScoredScoring.js +176 -0
  12. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialDifferentWeightsScoring.js +210 -0
  13. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialDifferentWeightsWithAlternateAnswer.js +898 -0
  14. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialEqualWeightsScoring.js +208 -0
  15. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialEqualWeightsWithAlternateAnswer.js +894 -0
  16. package/cypress/e2e/ILC/HighlightImage/highlightImagePreviewTab.js +88 -0
  17. package/cypress/e2e/ILC/HighlightImage/highlightImageSetCorrectAnswerCheckboxes.js +244 -0
  18. package/cypress/e2e/ILC/HighlightImage/highlightImageSetCorrectAnswerSection.js +186 -0
  19. package/cypress/e2e/ILC/HighlightImage/highlightImageSupportedFileTypes.js +86 -0
  20. package/cypress/e2e/ILC/HighlightImage/highlightImageToolsFunctionalityEditTab.js +160 -0
  21. package/cypress/e2e/ILC/HighlightImage/highlightImageToolsFunctionalityPreviewTab.js +163 -0
  22. package/package.json +1 -1
@@ -0,0 +1,208 @@
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 branchesHighlightRegion = [[36, 36], [36, 46], [58, 46], [58, 36]];
8
+ const leafHighlightRegion = [[54, 48], [54, 72], [82, 72], [82, 48]];
9
+ const rootsHighlightRegion = [[28, 84], [28, 98], [74, 98], [74, 84]];
10
+
11
+ describe('Create Item page - Highlight image: Preview tab Scoring Section', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ describe('Question Preview: AutoScored - Partial equal weights', () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ cy.log('Navigating to highlight image question type');
20
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
21
+ cy.barsPreLoaderWait();
22
+ highlightImagePage.steps.addQuestionInstructions();
23
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
24
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
25
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
26
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
27
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
28
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
29
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
30
+ highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
31
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
32
+ highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
33
+ highlightImagePage.steps.checkMultipleSelectionCheckbox();
34
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
35
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(3);
36
+ highlightImagePage.steps.selectPartialEqualWeightsCheckbox();
37
+ highlightImagePage.steps.allotPoints(20);
38
+ highlightImagePage.steps.expandAdditonalSettings();
39
+ highlightImagePage.steps.checkAllowStudentsToCheckAnswerCheckbox();
40
+ highlightImagePage.steps.switchToPreviewTab();
41
+ });
42
+
43
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct tab regions should be highlighted and border should not be displayed, and correct answer container should not be displayed', () => {
44
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
45
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
46
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
47
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
48
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
49
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
50
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
51
+ highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
52
+ });
53
+
54
+ 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', () => {
55
+ highlightImagePage.steps.checkAnswer();
56
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
57
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
58
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
59
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
60
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
61
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
62
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
63
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
64
+ });
65
+
66
+ 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, label and border should not 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', () => {
67
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
68
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
69
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
70
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
71
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
72
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
73
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
74
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
75
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
76
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(3, 4);
77
+ utilities.verifyInnerText(highlightImagePage.correctAnswerContainerLabel(), 'Correct answers:');
78
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
79
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
80
+
81
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
82
+
83
+ 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, label and border should not be displayed below the question preview and the correct answer container should not be displayed')
84
+ highlightImagePage.steps.checkAnswer();
85
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
86
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
87
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
88
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
89
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
90
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
91
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
92
+ });
93
+
94
+ 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 points of the correct highlight region, 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, label and border should not be displayed below the question preview and the correct answer container with the unattempted correct tab answer along with numeration should be displayed', () => {
95
+ highlightImagePage.steps.resetQuestionPreview();
96
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
97
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
98
+ highlightImagePage.steps.verifyPreviewTabScoreText(10, 20);
99
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
100
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
101
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
102
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
103
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
104
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 4'], [1]);
105
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(3, 4);
106
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
107
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
108
+
109
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
110
+
111
+ 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, label and border should not be displayed below the question preview and the correct answer container should not be displayed')
112
+ highlightImagePage.steps.checkAnswer();
113
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
114
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
115
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
116
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
117
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
118
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
119
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
120
+ });
121
+
122
+ 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, label and border should not be displayed below the question preview and the correct answer container should not be displayed', () => {
123
+ highlightImagePage.steps.resetQuestionPreview();
124
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
125
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
126
+ highlightImagePage.steps.verifyPreviewTabScoreText(20, 20);
127
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
128
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
129
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
130
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
131
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
132
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
133
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
134
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
135
+
136
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
137
+
138
+ 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, label and border should not be displayed below the question preview and the correct answer container should not be displayed')
139
+ highlightImagePage.steps.checkAnswer();
140
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
141
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
142
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
143
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
144
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
145
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
146
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
147
+ });
148
+
149
+ highlightImagePage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(20);
150
+
151
+ highlightImagePage.tests.verifyPenaltyPointsFunctionalityForIncorrectAnswer(7, 20);
152
+
153
+ highlightImagePage.tests.verifyMinimumScoreIfAttemptedAndPenaltyPointsFunctionalityForIncorrectAnswer([1, 7, 12], 12, 20);
154
+ });
155
+
156
+ describe('Partial equal weights: Round down score', () => {
157
+ abortEarlySetup();
158
+ before(() => {
159
+ cy.log('Navigating to highlight image question type');
160
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
161
+ cy.barsPreLoaderWait();
162
+ highlightImagePage.steps.addQuestionInstructions();
163
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
164
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
165
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
166
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
167
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
168
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
169
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
170
+ highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
171
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
172
+ highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
173
+ highlightImagePage.steps.checkMultipleSelectionCheckbox();
174
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
175
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(1);
176
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(3);
177
+ highlightImagePage.steps.selectPartialEqualWeightsCheckbox();
178
+ highlightImagePage.steps.allotPoints(6.3)
179
+ highlightImagePage.steps.expandAdditonalSettings();
180
+ highlightImagePage.steps.checkAllowStudentsToCheckAnswerCheckbox();
181
+ highlightImagePage.steps.switchToPreviewTab();
182
+ });
183
+
184
+ it('When the \'Round down score\' checkbox is selected, then in Preview tab when user enters partially or fully correct answers responses the score displayed should be rounded down to the nearest whole number', () => {
185
+ highlightImagePage.steps.verifyCheckedStateOfRoundDownScoreCheckbox();
186
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
187
+ highlightImagePage.steps.verifyPreviewTabScoreText(2, 6.3);
188
+ highlightImagePage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
189
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
190
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
191
+ highlightImagePage.steps.verifyPreviewTabScoreText(6, 6.3);
192
+ highlightImagePage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
193
+ });
194
+
195
+ it('When the \'Round down score\' checkbox is not selected, then in Preview tab when user selects partially or fully correct answers the points should be displayed in decimal points if applicable as per the options selected by the user', () => {
196
+ highlightImagePage.steps.switchToEditTab()
197
+ highlightImagePage.steps.uncheckRoundDownScoreCheckbox()
198
+ highlightImagePage.steps.switchToPreviewTab();
199
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
200
+ highlightImagePage.steps.verifyPreviewTabScoreText(2.1, 6.3);
201
+ highlightImagePage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
202
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
203
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
204
+ highlightImagePage.steps.verifyPreviewTabScoreText(6.3, 6.3);
205
+ highlightImagePage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
206
+ });
207
+ });
208
+ });