itemengine-cypress-automation 1.0.238-deletedCypressRepeat-09cad14.0 → 1.0.238
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +3 -3
- package/cypress/e2e/ILC/ChartsBar/labelOptionsSection.js +2 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +14 -13
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsBasic.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +5 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +4 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +1 -1
- package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/ImageHighlight/additionalSettingsBasic.js +2 -1
- package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +6 -3
- package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +2 -1
- package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsScoringBasic.js +6 -6
- package/cypress/e2e/ILC/Matching/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -4
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +144 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +144 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/manuallyAndNonScored.js +112 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsScoringBasic.js +397 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +179 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternatePoints.js +158 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternatePoints.js +179 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsBasic.js +143 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +167 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +145 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +166 -0
- package/cypress/e2e/ILC/NumberLine/additionalSettings.js +12 -10
- package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +3 -5
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +3 -3
- package/cypress/e2e/ILC/NumberLineLabel/editTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/NumberLineLabel/editTabScoring.js +2 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +2 -1
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +6 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +10 -2
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +13 -1
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +10 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +4 -2
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +37 -5
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +6 -0
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +1 -0
- package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +4 -5
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +6 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +4 -1
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +2 -0
- package/cypress/e2e/ILC/UploadResponse/uploadedFileProperties.js +1 -1
- package/cypress/pages/audioResponsePage.js +1 -0
- package/cypress/pages/components/createQuestionBasePage.js +49 -4
- package/cypress/pages/components/draggableOptionsStyleAndLayoutComponent.js +1 -1
- package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +22 -0
- package/cypress/pages/components/gridQuestionCommonComponent.js +5 -2
- package/cypress/pages/components/imageCanvasComponent.js +6 -9
- package/cypress/pages/components/numberLineCommonComponent.js +6 -6
- package/cypress/pages/components/questionInstructionsComponent.js +3 -2
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +2 -2
- package/cypress/pages/feedbackScalePage.js +1 -1
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +0 -1
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +2 -0
- package/cypress/pages/geoGebraActivityPage.js +13 -1
- package/cypress/pages/imageHighlightPage.js +1 -0
- package/cypress/pages/listOrderingPage.js +1 -1
- package/cypress/pages/matchingPage.js +21 -0
- package/cypress/pages/multipleSelectionGridPage.js +16 -0
- package/cypress/pages/numberLineLabelPage.js +16 -3
- package/cypress/pages/shortTextResponsePage.js +1 -0
- package/package.json +1 -1
- /package/cypress/e2e/ILC/NumberLineLabel/verticalNumberLine/{checkAnswerFunctionalityForAllViews.js → checkAnswerFunctionalityForAllViews.smoke.js} +0 -0
@@ -0,0 +1,397 @@
|
|
1
|
+
import { matchingPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../../support/helpers/utilities";
|
4
|
+
const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
|
5
|
+
const optionsArray = ['Cat', 'Elephant', 'Fish', 'Bear', 'Eagle', 'Penguin'];
|
6
|
+
|
7
|
+
describe('Create item page - Matching: Partial different weights', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Auto scored - Partial different weights', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
18
|
+
matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
|
19
|
+
matchingPage.steps.addMultipleOptionFields(3);
|
20
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
21
|
+
matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
|
22
|
+
matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
23
|
+
matchingPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
24
|
+
matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 9, 1: 6, 2: 5 });
|
25
|
+
matchingPage.steps.switchToPreviewTab();
|
26
|
+
});
|
27
|
+
|
28
|
+
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
29
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
30
|
+
matchingPage.steps.switchToGradingView();
|
31
|
+
matchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
32
|
+
matchingPage.steps.verifyDropdownNumeration(0);
|
33
|
+
matchingPage.steps.verifyDropdownNumeration(1);
|
34
|
+
matchingPage.steps.verifyDropdownNumeration(2);
|
35
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(0);
|
36
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(0);
|
37
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(0);
|
38
|
+
utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
|
39
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
40
|
+
});
|
41
|
+
|
42
|
+
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', () => {
|
43
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[4] }, { dropdownIndex: 2, dropdownOption: optionsArray[2] }]);
|
44
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
45
|
+
matchingPage.steps.switchToGradingView();
|
46
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
|
47
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(1);
|
48
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(2);
|
49
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
50
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
51
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
52
|
+
});
|
53
|
+
|
54
|
+
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', () => {
|
55
|
+
matchingPage.steps.resetQuestionPreview();
|
56
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
|
57
|
+
matchingPage.steps.verifyPreviewScore(9, 20);
|
58
|
+
matchingPage.steps.switchToGradingView();
|
59
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
60
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
|
61
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(2);
|
62
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
63
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
64
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
65
|
+
});
|
66
|
+
|
67
|
+
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', () => {
|
68
|
+
matchingPage.steps.resetQuestionPreview();
|
69
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
70
|
+
matchingPage.steps.verifyPreviewScore(11, 20);
|
71
|
+
matchingPage.steps.switchToGradingView();
|
72
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(0);
|
73
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
74
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
75
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
76
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
77
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
78
|
+
});
|
79
|
+
|
80
|
+
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', () => {
|
81
|
+
matchingPage.steps.resetQuestionPreview();
|
82
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
83
|
+
matchingPage.steps.verifyPreviewScore(20, 20);
|
84
|
+
matchingPage.steps.switchToGradingView();
|
85
|
+
matchingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
86
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
87
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
88
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
89
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
90
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
91
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
92
|
+
});
|
93
|
+
});
|
94
|
+
|
95
|
+
describe('Question preview: Auto scored - Partial different weights: Minimum scoring', () => {
|
96
|
+
abortEarlySetup();
|
97
|
+
before(() => {
|
98
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
99
|
+
cy.barsPreLoaderWait();
|
100
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
101
|
+
matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
|
102
|
+
matchingPage.steps.addMultipleOptionFields(3);
|
103
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
104
|
+
matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
|
105
|
+
matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
106
|
+
matchingPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
107
|
+
matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 1, 1: 6, 2: 5 });
|
108
|
+
});
|
109
|
+
|
110
|
+
it('When the user selects \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with minimum points', () => {
|
111
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
112
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
113
|
+
matchingPage.steps.allotMinimumPoints(2);
|
114
|
+
matchingPage.steps.switchToPreviewTab();
|
115
|
+
matchingPage.steps.switchToGradingView();
|
116
|
+
matchingPage.steps.verifyPreviewScore(2, 12);
|
117
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
118
|
+
});
|
119
|
+
|
120
|
+
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
121
|
+
matchingPage.steps.resetQuestionPreview();
|
122
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[4] }, { dropdownIndex: 2, dropdownOption: optionsArray[2] }]);
|
123
|
+
matchingPage.steps.verifyPreviewScore(2, 12);
|
124
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
125
|
+
});
|
126
|
+
|
127
|
+
it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with 0 points', () => {
|
128
|
+
matchingPage.steps.switchToEditTab();
|
129
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
130
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
131
|
+
matchingPage.steps.allotMinimumPoints(2);
|
132
|
+
matchingPage.steps.switchToPreviewTab();
|
133
|
+
matchingPage.steps.switchToGradingView();
|
134
|
+
matchingPage.steps.verifyPreviewScore(0, 12);
|
135
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
136
|
+
});
|
137
|
+
|
138
|
+
it('When the user has selected \'Award minimum score only if attempted\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
139
|
+
matchingPage.steps.resetQuestionPreview();
|
140
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[4] }, { dropdownIndex: 2, dropdownOption: optionsArray[2] }]);
|
141
|
+
matchingPage.steps.verifyPreviewScore(2, 12);
|
142
|
+
});
|
143
|
+
|
144
|
+
it('When the user attempts the question partially correct such that points of the correctly attempted option are greater than minimum points, then the user should be awarded with points as per the correctly attempted response', () => {
|
145
|
+
matchingPage.steps.resetQuestionPreview();
|
146
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
|
147
|
+
matchingPage.steps.verifyPreviewScore(6, 12);
|
148
|
+
});
|
149
|
+
|
150
|
+
it('When the user attempts the question partially correct such that minimum points are greater than points of the correctly attempted option, then the user should be awarded with minimum points', () => {
|
151
|
+
matchingPage.steps.resetQuestionPreview();
|
152
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[4] }, { dropdownIndex: 2, dropdownOption: optionsArray[2] }]);
|
153
|
+
matchingPage.steps.verifyPreviewScore(2, 12);
|
154
|
+
});
|
155
|
+
});
|
156
|
+
|
157
|
+
describe('Question preview: Auto scored - Partial different weights: Rounding', () => {
|
158
|
+
abortEarlySetup();
|
159
|
+
before(() => {
|
160
|
+
const promptTextArray1 = promptTextArray.concat(['Domestic']);
|
161
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
162
|
+
cy.barsPreLoaderWait();
|
163
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
164
|
+
matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
|
165
|
+
matchingPage.steps.addMultipleOptionFields(3);
|
166
|
+
matchingPage.steps.addPrompt();
|
167
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray1);
|
168
|
+
matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
|
169
|
+
matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }, { dropdownIndex: 3, dropdownOption: optionsArray[3] }]);
|
170
|
+
matchingPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
171
|
+
matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 2.67, 1: 1.99, 2: 1.34, 3: 4.5 });
|
172
|
+
});
|
173
|
+
|
174
|
+
it('When the user sets \'Rounding\' to \'Round down if <=0.99\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value greater than 0.5 and less than 0.99, then the points awarded should be rounded down to the nearest integer value', () => {
|
175
|
+
matchingPage.steps.expandRoundingDropdown();
|
176
|
+
matchingPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.99');
|
177
|
+
matchingPage.steps.switchToPreviewTab();
|
178
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }]);
|
179
|
+
matchingPage.steps.verifyPreviewScore(2, 10.5);
|
180
|
+
});
|
181
|
+
|
182
|
+
it('When the user has set \'Rounding\' to \'Round down if <=0.99\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.99, then the points awarded should be rounded down to the nearest integer value', () => {
|
183
|
+
matchingPage.steps.resetQuestionPreview();
|
184
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 1, dropdownOption: optionsArray[2] }]);
|
185
|
+
matchingPage.steps.verifyPreviewScore(1, 10.5);
|
186
|
+
});
|
187
|
+
|
188
|
+
it('When the user sets \'Rounding\' to \'Round down if <=0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value less than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
|
189
|
+
matchingPage.steps.switchToEditTab();
|
190
|
+
matchingPage.steps.expandRoundingDropdown();
|
191
|
+
matchingPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50');
|
192
|
+
matchingPage.steps.switchToPreviewTab();
|
193
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
194
|
+
matchingPage.steps.verifyPreviewScore(1, 10.5);
|
195
|
+
});
|
196
|
+
|
197
|
+
it('When the user has set \'Rounding\' to \'Round down if <=0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
|
198
|
+
matchingPage.steps.resetQuestionPreview();
|
199
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 3, dropdownOption: optionsArray[3] }]);
|
200
|
+
matchingPage.steps.verifyPreviewScore(4, 10.5);
|
201
|
+
});
|
202
|
+
|
203
|
+
it('When the user sets \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value less than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
|
204
|
+
matchingPage.steps.switchToEditTab();
|
205
|
+
matchingPage.steps.expandRoundingDropdown();
|
206
|
+
matchingPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50; Round up if > 0.50');
|
207
|
+
matchingPage.steps.switchToPreviewTab();
|
208
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
209
|
+
matchingPage.steps.verifyPreviewScore(1, 10.5);
|
210
|
+
});
|
211
|
+
|
212
|
+
it('When the user has set \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
|
213
|
+
matchingPage.steps.resetQuestionPreview();
|
214
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 3, dropdownOption: optionsArray[3] }]);
|
215
|
+
matchingPage.steps.verifyPreviewScore(4, 10.5);
|
216
|
+
});
|
217
|
+
|
218
|
+
it('When the user has set \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value greater than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
|
219
|
+
matchingPage.steps.resetQuestionPreview();
|
220
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }]);
|
221
|
+
matchingPage.steps.verifyPreviewScore(3, 10.5);
|
222
|
+
});
|
223
|
+
|
224
|
+
it('When \'Round negative score to zero\' is in checked state and the user attempts the question incorrectly, then the user should be awarded with 0 points', () => {
|
225
|
+
cy.log('Pre-step: Setting penalty scoring to \'Penalty points for the entire question\', allotting penalty points')
|
226
|
+
matchingPage.steps.switchToEditTab();
|
227
|
+
matchingPage.steps.expandPenaltyScoringDropdown();
|
228
|
+
matchingPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
|
229
|
+
matchingPage.steps.allotPenaltyPoints(4);
|
230
|
+
matchingPage.steps.switchToPreviewTab();
|
231
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
232
|
+
matchingPage.steps.verifyPreviewScore(0, 10.5);
|
233
|
+
});
|
234
|
+
|
235
|
+
it('When the user unchecks \'Round negative score to zero\' checkbox and the user attempts the question incorrectly, then the user should be awarded with negative points', () => {
|
236
|
+
matchingPage.steps.switchToEditTab();
|
237
|
+
matchingPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
|
238
|
+
matchingPage.steps.switchToPreviewTab();
|
239
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
240
|
+
matchingPage.steps.verifyPreviewScore(-4, 10.5);
|
241
|
+
});
|
242
|
+
});
|
243
|
+
|
244
|
+
describe.only('Question preview: Auto scored - Partial different weights: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
|
245
|
+
abortEarlySetup();
|
246
|
+
before(() => {
|
247
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
248
|
+
cy.barsPreLoaderWait();
|
249
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
250
|
+
matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
|
251
|
+
matchingPage.steps.addMultipleOptionFields(3);
|
252
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
253
|
+
matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
|
254
|
+
matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
255
|
+
matchingPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
256
|
+
matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 9, 1: 6, 2: 5 });
|
257
|
+
});
|
258
|
+
|
259
|
+
//Penalty points for the entire question
|
260
|
+
it('When the user sets penalty scoring to \'Penalty points for the entire question\', allots penalty points and attempts the question incorrectly, then the user should be awarded with negative points', () => {
|
261
|
+
matchingPage.steps.expandPenaltyScoringDropdown();
|
262
|
+
matchingPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
|
263
|
+
matchingPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
|
264
|
+
matchingPage.steps.allotPenaltyPoints(4);
|
265
|
+
matchingPage.steps.switchToPreviewTab();
|
266
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
267
|
+
matchingPage.steps.verifyPreviewScore(-4, 20);
|
268
|
+
});
|
269
|
+
|
270
|
+
it('When the user attempts the question correctly along with an incorrect response, then penalty points should get deducted from the awarded points', () => {
|
271
|
+
matchingPage.steps.resetQuestionPreview();
|
272
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[4] }]);
|
273
|
+
matchingPage.steps.verifyPreviewScore(5, 20);
|
274
|
+
});
|
275
|
+
|
276
|
+
it('When the user attempts the question correctly along with multiple incorrect responses, then penalty points should get deducted from the awarded points only once, the deducted penalty points should not increase as per number of attempted incorrect responses', () => {
|
277
|
+
matchingPage.steps.resetQuestionPreview();
|
278
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[3] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
|
279
|
+
matchingPage.steps.verifyPreviewScore(5, 20);
|
280
|
+
});
|
281
|
+
|
282
|
+
it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
|
283
|
+
matchingPage.steps.switchToEditTab();
|
284
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
285
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
286
|
+
matchingPage.steps.allotMinimumPoints(3);
|
287
|
+
matchingPage.steps.switchToPreviewTab();
|
288
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
289
|
+
matchingPage.steps.verifyPreviewScore(3, 20);
|
290
|
+
cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
|
291
|
+
matchingPage.steps.switchToEditTab();
|
292
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
293
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
|
294
|
+
});
|
295
|
+
|
296
|
+
//Penalty points for each incorrect dropzone - Specify total penalty points
|
297
|
+
it('When the user sets penalty scoring to \'Penalty points for each incorrect dropdown\', and \'Specify total penalty points\' radio button in checked state, allots total penalty points and attempts the question incorrectly, then the user should be awarded with negative points of all the empty and incorrect dropdown', () => {
|
298
|
+
matchingPage.steps.expandPenaltyScoringDropdown();
|
299
|
+
matchingPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect dropzone');
|
300
|
+
matchingPage.steps.allotTotalPenaltyPoints(4);
|
301
|
+
matchingPage.steps.switchToPreviewTab();
|
302
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
303
|
+
matchingPage.steps.verifyPreviewScore(-2.01, 20);
|
304
|
+
});
|
305
|
+
|
306
|
+
it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
|
307
|
+
matchingPage.steps.resetQuestionPreview();
|
308
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
|
309
|
+
matchingPage.steps.verifyPreviewScore(14.33, 20);
|
310
|
+
});
|
311
|
+
|
312
|
+
it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect dropdown should get deducted from the awarded points', () => {
|
313
|
+
matchingPage.steps.resetQuestionPreview();
|
314
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[3] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
|
315
|
+
matchingPage.steps.verifyPreviewScore(7.66, 20);
|
316
|
+
});
|
317
|
+
|
318
|
+
it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
|
319
|
+
matchingPage.steps.switchToEditTab();
|
320
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
321
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
322
|
+
matchingPage.steps.allotMinimumPoints(3);
|
323
|
+
matchingPage.steps.switchToPreviewTab();
|
324
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
325
|
+
matchingPage.steps.verifyPreviewScore(3, 20);
|
326
|
+
cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
|
327
|
+
matchingPage.steps.switchToEditTab();
|
328
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
329
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
|
330
|
+
});
|
331
|
+
|
332
|
+
//Penalty points for each incorrect dropzone - Specify points for each incorrect dropzone
|
333
|
+
it('When the user has set penalty scoring to \'Penalty points for each incorrect dropdown\', and \'Specify total penalty points\' radio button in checked state, allots total penalty points and attempts the question incorrectly, then the user should be awarded with negative points for the incorrect and empty dropdown', () => {
|
334
|
+
matchingPage.steps.selectPenaltyPointsForEachIncorrectDropzone();
|
335
|
+
matchingPage.steps.allotPenaltyPointsForEachIncorrectDropzone(4);
|
336
|
+
matchingPage.steps.switchToPreviewTab();
|
337
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
338
|
+
matchingPage.steps.verifyPreviewScore(-12, 20);
|
339
|
+
});
|
340
|
+
|
341
|
+
it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
|
342
|
+
matchingPage.steps.resetQuestionPreview();
|
343
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
344
|
+
matchingPage.steps.verifyPreviewScore(7, 20);
|
345
|
+
});
|
346
|
+
|
347
|
+
it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect dropdown should get deducted from the awarded points', () => {
|
348
|
+
matchingPage.steps.resetQuestionPreview();
|
349
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[3] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
|
350
|
+
matchingPage.steps.verifyPreviewScore(1, 20);
|
351
|
+
});
|
352
|
+
|
353
|
+
it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
|
354
|
+
matchingPage.steps.switchToEditTab();
|
355
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
356
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
357
|
+
matchingPage.steps.allotMinimumPoints(3);
|
358
|
+
matchingPage.steps.switchToPreviewTab();
|
359
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
360
|
+
matchingPage.steps.verifyPreviewScore(3, 20);
|
361
|
+
cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
|
362
|
+
matchingPage.steps.switchToEditTab();
|
363
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
364
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
|
365
|
+
});
|
366
|
+
|
367
|
+
//Penalty points for each incorrect option - Automatically set penalty for each incorrect dropzone to total points / no. of incorrect dropzone
|
368
|
+
it('When the user has set penalty scoring to \'Penalty points for each incorrect dropdown\', and checks \'Automatically set penalty for each incorrect dropdown to total points / no. of incorrect dropdown\' checkbox and attempts the question incorrectly, then the user should be awarded with negative points for the incorrect and empty dropdown', () => {
|
369
|
+
matchingPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
|
370
|
+
matchingPage.steps.switchToPreviewTab();
|
371
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
372
|
+
matchingPage.steps.verifyPreviewScore(-9.99, 20);
|
373
|
+
});
|
374
|
+
|
375
|
+
it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
|
376
|
+
matchingPage.steps.resetQuestionPreview();
|
377
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
378
|
+
matchingPage.steps.verifyPreviewScore(7.67, 20);
|
379
|
+
});
|
380
|
+
|
381
|
+
it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect option should get deducted from the awarded points', () => {
|
382
|
+
matchingPage.steps.resetQuestionPreview();
|
383
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
|
384
|
+
matchingPage.steps.verifyPreviewScore(-0.66, 20);
|
385
|
+
});
|
386
|
+
|
387
|
+
it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
|
388
|
+
matchingPage.steps.switchToEditTab();
|
389
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
390
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
391
|
+
matchingPage.steps.allotMinimumPoints(3);
|
392
|
+
matchingPage.steps.switchToPreviewTab();
|
393
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
394
|
+
matchingPage.steps.verifyPreviewScore(3, 20);
|
395
|
+
});
|
396
|
+
});
|
397
|
+
});
|
@@ -0,0 +1,179 @@
|
|
1
|
+
import { matchingPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
|
6
|
+
const optionsArray = ['Cat', 'Elephant', 'Fish', 'Bear', 'Eagle', 'Penguin'];
|
7
|
+
|
8
|
+
describe('Create item page - Matching: Partial different weights', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Question preview: Auto scored - Partial different weights - When \'Alternative answer\' points are more than \'Correct answer\' points', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
17
|
+
cy.barsPreLoaderWait();
|
18
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
19
|
+
matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
|
20
|
+
matchingPage.steps.addMultipleOptionFields(3);
|
21
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
22
|
+
matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
|
23
|
+
matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
24
|
+
matchingPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
25
|
+
matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 1, 1: 5, 2: 7 });
|
26
|
+
matchingPage.steps.addAlternativeAnswerAccordion(1);
|
27
|
+
matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
28
|
+
matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 4, 1: 5, 2: 6 });
|
29
|
+
matchingPage.steps.switchToPreviewTab();
|
30
|
+
});
|
31
|
+
|
32
|
+
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers from the correct accordion and respective dropdown numeration', () => {
|
33
|
+
matchingPage.steps.switchToGradingView();
|
34
|
+
matchingPage.steps.verifyDropdownNumeration(0);
|
35
|
+
matchingPage.steps.verifyDropdownNumeration(1);
|
36
|
+
matchingPage.steps.verifyDropdownNumeration(2);
|
37
|
+
utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
|
38
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
|
39
|
+
});
|
40
|
+
|
41
|
+
it('When the user attempts the question with responses from the correct accordion, then the user should be awarded points of the correct accordion (less than full points) and on switching to \'Grading\' view, green check-marks should be displayed beside all the correct responses, status message and correct answer section should not be displayed', () => {
|
42
|
+
matchingPage.steps.resetQuestionPreview();
|
43
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
44
|
+
matchingPage.steps.verifyPreviewScore(13, 15);
|
45
|
+
matchingPage.steps.switchToGradingView();
|
46
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
47
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
48
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
49
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
50
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
51
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
52
|
+
});
|
53
|
+
|
54
|
+
it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with full points and on switching to \'Grading\' view, green check-marks should be displayed beside all the correct responses, status message and correct answer section should not be displayed', () => {
|
55
|
+
matchingPage.steps.resetQuestionPreview();
|
56
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
57
|
+
matchingPage.steps.verifyPreviewScore(15, 15);
|
58
|
+
matchingPage.steps.switchToGradingView();
|
59
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
60
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
61
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
62
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
63
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
64
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
65
|
+
});
|
66
|
+
|
67
|
+
it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded with points of the correctly attempted responses according to the correct accordion and on switching to \'Grading\' view, green check-mark should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
|
68
|
+
matchingPage.steps.resetQuestionPreview();
|
69
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }]);
|
70
|
+
matchingPage.steps.verifyPreviewScore(6, 15);
|
71
|
+
matchingPage.steps.switchToGradingView();
|
72
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
73
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
74
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(2);
|
75
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
76
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
|
77
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
78
|
+
});
|
79
|
+
|
80
|
+
it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded with points of the correctly attempted responses from the alternative accordion and on switching to \'Grading\' view, green check-mark should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
|
81
|
+
matchingPage.steps.resetQuestionPreview();
|
82
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }]);
|
83
|
+
matchingPage.steps.verifyPreviewScore(9, 15);
|
84
|
+
matchingPage.steps.switchToGradingView();
|
85
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
86
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
87
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(2);
|
88
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
89
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
|
90
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
91
|
+
});
|
92
|
+
|
93
|
+
it('When the user attempts the question partially correct with all the responses correct as per the alternative accordion but one response incomplete, then the user should be awarded with points of the correctly attempted responses and on switching to \'Grading\' view, green check-mark should be displayed besides the response from the correct accordion and alternative accordion and no icon should be displayed beside unattempted response, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
|
94
|
+
matchingPage.steps.resetQuestionPreview();
|
95
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
96
|
+
matchingPage.steps.verifyPreviewScore(10, 15);
|
97
|
+
matchingPage.steps.switchToGradingView();
|
98
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
99
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
|
100
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
101
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
102
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
|
103
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
104
|
+
});
|
105
|
+
|
106
|
+
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 with points of the correctly attempted responses and on switching to \'Grading\' view, green check-mark icon should be displayed besides response field with alternative answer responses, red cross-mark icon should be displayed beside responses from the correct accordion responses as score achieved from the alternative responses is more than correct responses, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
|
107
|
+
matchingPage.steps.resetQuestionPreview();
|
108
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
109
|
+
matchingPage.steps.verifyPreviewScore(11, 15);
|
110
|
+
matchingPage.steps.switchToGradingView();
|
111
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
|
112
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
113
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
114
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
115
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
|
116
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
117
|
+
});
|
118
|
+
|
119
|
+
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 with points of the correctly attempted responses 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 as points achieved from the correct accordion is more, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
|
120
|
+
matchingPage.steps.resetQuestionPreview();
|
121
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
122
|
+
matchingPage.steps.verifyPreviewScore(12, 15);
|
123
|
+
matchingPage.steps.switchToGradingView();
|
124
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
125
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(1);
|
126
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
127
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
128
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
|
129
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
130
|
+
});
|
131
|
+
|
132
|
+
it('Race condition : When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with with points of the correctly attempted responses from the tab that has more points alloted for the response and on switching to \'Grading\' view, green check-mark icon should be besides the common response, no icons should be displayed beside unattempted responses, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
|
133
|
+
matchingPage.steps.resetQuestionPreview();
|
134
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
135
|
+
matchingPage.steps.verifyPreviewScore(7, 15);
|
136
|
+
matchingPage.steps.switchToGradingView();
|
137
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(0);
|
138
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
|
139
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
140
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
141
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
|
142
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
143
|
+
});
|
144
|
+
|
145
|
+
it('When the user attempts the question incorrectly, then the user should be awarded with 0 points and on switching to \'Grading\' view, red cross-marks should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response, status message should not be displayed and correct answer section with all alternative answers along with dropdown numeration should be displayed', () => {
|
146
|
+
matchingPage.steps.resetQuestionPreview();
|
147
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
|
148
|
+
matchingPage.steps.verifyPreviewScore(0, 15);
|
149
|
+
matchingPage.steps.switchToGradingView();
|
150
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
|
151
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
|
152
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(2);
|
153
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
154
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
|
155
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
156
|
+
});
|
157
|
+
|
158
|
+
it('Overachiever case: When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response selected from the correct accordion overpowers the combined score of the alternative accordion answers then on switching to the \'Grading view\', then points awarded should be of the correct accordion, green check-mark icons should be displayed for the correct accordion response, red cross-mark icon should be displayed for the alternative accordion responses, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with correct accordion answers for the responses marked incorrect', () => {
|
159
|
+
cy.log('Pre-step: Switching to Edit tab and allotting points to alternative accordion such that the difference between the points is substantial and the points per response are in decimal')
|
160
|
+
matchingPage.steps.switchToEditTab();
|
161
|
+
matchingPage.steps.deleteAlternativeAnswerAccordion(0);
|
162
|
+
matchingPage.steps.addAlternativeAnswerAccordion(1);
|
163
|
+
matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
|
164
|
+
matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 11.4, 1: 1.2, 2: 10.4 });
|
165
|
+
matchingPage.steps.expandCorrectAnswerAccordion();
|
166
|
+
matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 1.2, 1: 2.2, 2: 1.6 });
|
167
|
+
matchingPage.steps.switchToPreviewTab();
|
168
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
|
169
|
+
matchingPage.steps.verifyPreviewScore(10.4, 23);
|
170
|
+
matchingPage.steps.switchToGradingView();
|
171
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
|
172
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(1);
|
173
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
174
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
175
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Eagle']]);
|
176
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
177
|
+
});
|
178
|
+
});
|
179
|
+
});
|