itemengine-cypress-automation 1.0.193-packageUpdated-b3f3d0b.0 → 1.0.193
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +3 -3
- package/cypress/e2e/ILC/AudioPlayerNew/audioOverviewAndTranscript.js +568 -0
- package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +4 -4
- package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +5 -5
- package/cypress/e2e/ILC/AudioPlayerNew/customizePlayerLayoutSettings.js +2 -2
- package/cypress/e2e/ILC/AudioPlayerNew/headerSection.js +125 -0
- package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +5 -5
- package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +4 -4
- package/cypress/e2e/ILC/AudioPlayerNew/studentViewSettings.js +3 -3
- package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +19 -17
- package/cypress/e2e/ILC/ChartsBar/previewContentsForAllViews.smoke.js +7 -4
- package/cypress/e2e/ILC/ChartsLine/allOrNothingScoringForAllViews.smoke.js +366 -0
- package/cypress/e2e/ILC/ChartsLine/checkAnswerFunctionalityForAllViews.smoke.js +183 -0
- package/cypress/e2e/ILC/ChartsLine/gradingViewAndCorrectAnswerView.smoke.js +281 -0
- package/cypress/e2e/ILC/ChartsLine/previewContentsForAllViews.smoke.js +595 -0
- package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +8 -8
- package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +241 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +241 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternatePoints.js +285 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/manuallyAndNonScored.js +164 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +281 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsScoring.js +467 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +250 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeigtsCorrectPointsGreaterThanAlternativePoints.js +281 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +260 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsScoring.js +184 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +229 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +261 -0
- package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +409 -0
- package/cypress/e2e/ILC/chartsDotsPlot/checkAnswerFunctionalityForAllViews.smoke.js +199 -0
- package/cypress/e2e/ILC/chartsDotsPlot/gradingViewAndCorrectAnswerView.smoke.js +223 -0
- package/cypress/e2e/ILC/chartsDotsPlot/previewContentsForAllViews.smoke.js +402 -0
- package/cypress/pages/audioPlayerPage.js +229 -9
- package/cypress/pages/chartsBarPage.js +2 -70
- package/cypress/pages/chartsDotPlotPage.js +986 -3
- package/cypress/pages/chartsLinePage.js +368 -9
- package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +0 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -0
- package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
- package/cypress/pages/components/barAndLineChartComponent.js +27 -1
- package/cypress/pages/components/chartsCommonComponent.js +31 -2
- package/cypress/pages/components/createQuestionBasePage.js +1 -0
- package/cypress/pages/components/layoutSectionComponent.js +2 -2
- package/cypress/pages/components/singleMultipleSelectionModeComponent.js +5 -0
- package/cypress/pages/components/toolSettingsComponent.js +2 -2
- package/cypress/pages/feedbackScalePage.js +1 -1
- package/cypress/pages/gridFillPage.js +13 -6
- package/cypress/pages/imageHighlightPage.js +308 -2
- package/cypress/pages/numberLinePage.js +40 -16
- package/cypress/pages/videoResponsePage.js +350 -6
- package/package.json +1 -1
@@ -0,0 +1,285 @@
|
|
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 = [[40, 6], [40, 20], [55, 20], [55, 6]];
|
7
|
+
const branchesHighlightRegion = [[50, 30], [50, 42], [65, 42], [65, 30]];
|
8
|
+
const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
|
9
|
+
const rootsHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
|
10
|
+
|
11
|
+
describe('Create Item page - Image highlight: All or nothing with alternative answers', () => {
|
12
|
+
before(() => {
|
13
|
+
cy.loginAs('admin');
|
14
|
+
});
|
15
|
+
|
16
|
+
describe('Question Preview: AutoScored - All or Nothing with alternate answer: When correct answer points are more than alternate answer points', () => {
|
17
|
+
abortEarlySetup();
|
18
|
+
before(() => {
|
19
|
+
cy.log('Navigating to highlight image question type');
|
20
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
21
|
+
cy.barsPreLoaderWait();
|
22
|
+
imageHighlightPage.steps.addQuestionInstructions();
|
23
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
24
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
25
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
26
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
27
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
28
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
29
|
+
imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
|
30
|
+
imageHighlightPage.steps.selectMultipleSelectionToggle();
|
31
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
32
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(3);
|
33
|
+
imageHighlightPage.steps.allotPoints(20);
|
34
|
+
imageHighlightPage.steps.clickOnAddAlternativeAnswerButton();
|
35
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
36
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
37
|
+
imageHighlightPage.steps.allotPoints(12);
|
38
|
+
imageHighlightPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
39
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
40
|
+
});
|
41
|
+
|
42
|
+
it('When the user switches to \'Grading view\' without attempting the question then the no regions should be highlighted, \'Your answer is incorrect\' label should be displayed and the correct answer section with the answers of the correct accordion should be displayed', () => {
|
43
|
+
cy.log('Total points displayed besides Show correct answer checkbox should be of alternate answer points')
|
44
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
45
|
+
imageHighlightPage.steps.switchToGradingView();
|
46
|
+
imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab()
|
47
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
48
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
49
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
50
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
|
51
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
|
52
|
+
});
|
53
|
+
|
54
|
+
it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
55
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
56
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
57
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(3);
|
58
|
+
imageHighlightPage.steps.verifyPreviewScore(20, 20);
|
59
|
+
imageHighlightPage.steps.switchToGradingView();
|
60
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
61
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
62
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
63
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
|
64
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
65
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
66
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
67
|
+
|
68
|
+
cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
|
69
|
+
imageHighlightPage.steps.checkAnswer();
|
70
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
71
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
72
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
73
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
|
74
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
75
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
76
|
+
});
|
77
|
+
|
78
|
+
it('CSS of correct answer section', { tags: 'css' }, () => {
|
79
|
+
utilities.verifyCSS(imageHighlightPage.correctIncorrectAnswerTextWrapper(), {
|
80
|
+
'border': `1px solid ${css.color.correctAnswer}`,
|
81
|
+
'color': css.color.text,
|
82
|
+
'font-size': css.fontSize.default,
|
83
|
+
'font-weight': css.fontWeight.normal
|
84
|
+
});
|
85
|
+
utilities.verifyCSS(imageHighlightPage.highlightNumerationPreviewTab(), {
|
86
|
+
'color': css.color.text,
|
87
|
+
'font-size': css.fontSize.small,
|
88
|
+
'font-weight': css.fontWeight.regular
|
89
|
+
});
|
90
|
+
});
|
91
|
+
|
92
|
+
it('Accessibility of correct answer section', { tags: 'a11y' }, () => {
|
93
|
+
cy.checkAccessibility(imageHighlightPage.previewTabQuestionWrapper());
|
94
|
+
});
|
95
|
+
|
96
|
+
it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with points specified for alternative accordion (less than full points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
|
97
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
98
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
99
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
100
|
+
imageHighlightPage.steps.verifyPreviewScore(12, 20);
|
101
|
+
imageHighlightPage.steps.switchToGradingView();
|
102
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
103
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
104
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
105
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
|
106
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
107
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
108
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
109
|
+
|
110
|
+
cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
|
111
|
+
imageHighlightPage.steps.checkAnswer();
|
112
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
113
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
114
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
115
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
|
116
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
117
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
118
|
+
});
|
119
|
+
|
120
|
+
it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion should be displayed', () => {
|
121
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
122
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(3);
|
123
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
124
|
+
imageHighlightPage.steps.switchToGradingView();
|
125
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
126
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
127
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
128
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
|
129
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
|
130
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
131
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
132
|
+
|
133
|
+
cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
134
|
+
imageHighlightPage.steps.checkAnswer();
|
135
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
136
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
137
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
138
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
|
139
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
140
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
141
|
+
});
|
142
|
+
|
143
|
+
it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion should be displayed', () => {
|
144
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
145
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
146
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
147
|
+
imageHighlightPage.steps.switchToGradingView();
|
148
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
149
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
150
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
151
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
|
152
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
|
153
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
154
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
155
|
+
|
156
|
+
cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
157
|
+
imageHighlightPage.steps.checkAnswer();
|
158
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
159
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
160
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
161
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
|
162
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
163
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
164
|
+
});
|
165
|
+
|
166
|
+
it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, green check-mark icon should be displayed besides response field with correct answer responses, red cross-mark icon should be displayed beside responses from the alternative tab, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion should be displayed', () => {
|
167
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
168
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
169
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(3);
|
170
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
171
|
+
imageHighlightPage.steps.switchToGradingView();
|
172
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
173
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
|
174
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
175
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
|
176
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
|
177
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
178
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
179
|
+
|
180
|
+
cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
181
|
+
imageHighlightPage.steps.checkAnswer();
|
182
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
183
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
|
184
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
185
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
|
186
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
187
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
188
|
+
});
|
189
|
+
|
190
|
+
it('Race condition 1: When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, green check-mark icon should be besides the common response, no icon should be displayed beside unattempted response, \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion should be displayed', () => {
|
191
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
192
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
193
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
194
|
+
imageHighlightPage.steps.switchToGradingView();
|
195
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
196
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
197
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
198
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
|
199
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
|
200
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
201
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
202
|
+
|
203
|
+
cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
204
|
+
imageHighlightPage.steps.checkAnswer();
|
205
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
206
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
207
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
208
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
|
209
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
210
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
211
|
+
});
|
212
|
+
|
213
|
+
it('Race condition 2: When the user attempts the question partially correct with all the responses, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the response from the correct accordion, incorrect icon should be displayed besides the responses from the alternative accordion and no icon should be displayed beside unattempted response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion should be displayed', () => {
|
214
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
215
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
216
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
217
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(3);
|
218
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
219
|
+
imageHighlightPage.steps.switchToGradingView();
|
220
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
221
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
|
222
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
223
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
|
224
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
|
225
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
226
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
227
|
+
|
228
|
+
cy.log('When the user has attempted the question with partially correct with all the response and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the correct accordion, incorrect icon should be displayed besides the responses from the alternative accordion and no icon should be displayed beside unattempted response, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
229
|
+
imageHighlightPage.steps.checkAnswer();
|
230
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
231
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
|
232
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
233
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
|
234
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
235
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
236
|
+
});
|
237
|
+
|
238
|
+
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers should be displayed', () => {
|
239
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
240
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
241
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
242
|
+
imageHighlightPage.steps.switchToGradingView();
|
243
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
244
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
245
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(2);
|
246
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
|
247
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
|
248
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
249
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
250
|
+
|
251
|
+
cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
252
|
+
imageHighlightPage.steps.checkAnswer();
|
253
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
254
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
255
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(2);
|
256
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
|
257
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
258
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
259
|
+
});
|
260
|
+
|
261
|
+
it('CSS of incorrect answer state', { tags: 'css' }, () => {
|
262
|
+
utilities.verifyCSS(imageHighlightPage.correctIncorrectAnswerTextWrapper(), {
|
263
|
+
'border': `1px solid ${css.color.incorrectAnswer}`,
|
264
|
+
'color': css.color.text,
|
265
|
+
'font-size': css.fontSize.default,
|
266
|
+
'font-weight': css.fontWeight.normal
|
267
|
+
});
|
268
|
+
utilities.verifyCSS(imageHighlightPage.highlightNumerationPreviewTab(), {
|
269
|
+
'color': css.color.text,
|
270
|
+
'font-size': css.fontSize.small,
|
271
|
+
'font-weight': css.fontWeight.regular
|
272
|
+
});
|
273
|
+
utilities.verifyCSS(imageHighlightPage.correctAnswerContainerAnswerWrapper().find('.question-text-wrapper'), {
|
274
|
+
'color': css.color.text,
|
275
|
+
'font-size': css.fontSize.default,
|
276
|
+
'font-weight': css.fontWeight.normal
|
277
|
+
});
|
278
|
+
|
279
|
+
});
|
280
|
+
|
281
|
+
it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
|
282
|
+
cy.checkAccessibility(imageHighlightPage.previewTabQuestionWrapper());
|
283
|
+
});
|
284
|
+
});
|
285
|
+
});
|
@@ -0,0 +1,164 @@
|
|
1
|
+
import { imageHighlightPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
const flowerHighlightRegion = [[40, 6], [40, 20], [55, 20], [55, 6]];
|
5
|
+
const branchesHighlightRegion = [[50, 30], [50, 42], [65, 42], [65, 30]];
|
6
|
+
const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
|
7
|
+
const rootsHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
|
8
|
+
|
9
|
+
describe('Create Item page - Matching: Manually and non scored', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Question Preview: Manually Scored', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
18
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
19
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
20
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
21
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
22
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
23
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
24
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
25
|
+
imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
|
26
|
+
imageHighlightPage.steps.selectMultipleSelectionToggle();
|
27
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
28
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
29
|
+
imageHighlightPage.steps.expandScoringTypeDropdown();
|
30
|
+
imageHighlightPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
31
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
32
|
+
});
|
33
|
+
|
34
|
+
it('In Preview tab, question instructions and highlight regions should be displayed in the preview tab', () => {
|
35
|
+
imageHighlightPage.steps.verifyQuestionInstructionsTextPreviewTab('Select the appropriate highlight in the image below');
|
36
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(0, flowerHighlightRegion);
|
37
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(1, branchesHighlightRegion);
|
38
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(2, leafHighlightRegion);
|
39
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(3, rootsHighlightRegion);
|
40
|
+
});
|
41
|
+
|
42
|
+
imageHighlightPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored');
|
43
|
+
});
|
44
|
+
|
45
|
+
describe('Question Preview: Non Scored', () => {
|
46
|
+
abortEarlySetup();
|
47
|
+
before(() => {
|
48
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
49
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
50
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
51
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
52
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
53
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
54
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
55
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
56
|
+
imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
|
57
|
+
imageHighlightPage.steps.selectMultipleSelectionToggle();
|
58
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
59
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
60
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
61
|
+
imageHighlightPage.steps.expandScoringTypeDropdown();
|
62
|
+
imageHighlightPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
63
|
+
imageHighlightPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
64
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
65
|
+
});
|
66
|
+
|
67
|
+
imageHighlightPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
|
68
|
+
|
69
|
+
it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed and the correct answer section should be displayed with correct answers', () => {
|
70
|
+
imageHighlightPage.steps.switchToGradingView();
|
71
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
72
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
73
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
74
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
|
75
|
+
//TODO: Remove comment after https://redmine.zeuslearning.com/issues/565569 is resolved
|
76
|
+
//imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
77
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2', 'Option 3'], [1, 2, 3]);
|
78
|
+
imageHighlightPage.steps.switchToStudentView();
|
79
|
+
});
|
80
|
+
|
81
|
+
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, red cross-marks should be displayed besides all incorrect responses, a status message should not be displayed and correct answer section with all correct answers along with numeration should be displayed', () => {
|
82
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(3);
|
83
|
+
imageHighlightPage.steps.switchToGradingView();
|
84
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
85
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
86
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
87
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(3);
|
88
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2', 'Option 3'], [1, 2, 3]);
|
89
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
90
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
91
|
+
cy.log('When the user attempts the question incorrectly and clicks on \'Check answer\' red cross-marks should be displayed besides all incorrect responses, a status message should not be displayed and correct answer section should not be displayed')
|
92
|
+
imageHighlightPage.steps.checkAnswer();
|
93
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
94
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
95
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
96
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(3);
|
97
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
98
|
+
});
|
99
|
+
|
100
|
+
it('When the user attempts the question partially correct with some correct, some incomplete, some incorrect options, then the user should be awarded points alloted to the responses and on switching to \'Grading\' view, green check-mark should be displayed besides the correct answer responses, red cross-mark should be displayed besides incorrect answer response, a status message should not be displayed and correct answer section with all correct answers along with numeration should be displayed', () => {
|
101
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
102
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(3);
|
103
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
104
|
+
imageHighlightPage.steps.switchToGradingView();
|
105
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
106
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
107
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
108
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(3);
|
109
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2', 'Option 3'], [1, 2, 3]);
|
110
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
111
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
112
|
+
cy.log('When the user attempts the question partially correct with some correct, some incomplete, some incorrect options and clicks on \'Check answer\' green check-mark should be displayed besides the correct answer responses, red cross-mark should be displayed besides incorrect answer response, a status message should not be displayed and correct answer section should not be displayed')
|
113
|
+
imageHighlightPage.steps.checkAnswer();
|
114
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
115
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
116
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
117
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(3);
|
118
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
119
|
+
});
|
120
|
+
|
121
|
+
it('When the user attempts the question partially correct with all the responses correctly attempted but one response incomplete, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, green check-mark should be displayed besides the correct answer responses, red cross-mark should be displayed besides incorrect answer response, a status message should not be displayed and correct answer section with all correct answers along with numeration should be displayed', () => {
|
122
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
123
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
124
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
125
|
+
imageHighlightPage.steps.switchToGradingView();
|
126
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
127
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
128
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
129
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
|
130
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2', 'Option 3'], [1, 2, 3]);
|
131
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
132
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
133
|
+
cy.log('When the user attempts the question partially correct with all the responses correctly attempted but one response incomplete and clicks on \'Check answer\' green check-mark should be displayed besides the correct answer responses, red cross-mark should be displayed besides incorrect answer response, a status message should not be displayed and correct answer section should not be displayed')
|
134
|
+
imageHighlightPage.steps.checkAnswer();
|
135
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
136
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
137
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
138
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
|
139
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then green check-marks should be displayed beside all the correct responses, green check-mark should be displayed besides the correct answer responses, a status message and correct answer section should not be displayed', () => {
|
143
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
144
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
145
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
146
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
147
|
+
imageHighlightPage.steps.switchToGradingView();
|
148
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
149
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
150
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
151
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
|
152
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
153
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
154
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
155
|
+
cy.log('When the user attempts the question with all the responses correctly attempted and clicks on \'Check answer\' green check-mark should be displayed besides the correct answer responses, a status message should not be displayed and correct answer section should not be displayed')
|
156
|
+
imageHighlightPage.steps.checkAnswer();
|
157
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
158
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
159
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
160
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
|
161
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
162
|
+
});
|
163
|
+
});
|
164
|
+
});
|