itemengine-cypress-automation 1.0.145-equationAndCheckAnswerSeelctorUpdate-b61f46e.0 → 1.0.146-21MarchFixes-bcfcf83.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingPenaltyScoring.js +0 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +0 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToCorrectPoints.js +0 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +0 -1
- package/cypress/e2e/ILC/Graphing/Scoring/manuallyAndNonScoredScoring.js +0 -2
- package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +0 -12
- package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +0 -2
- package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +1 -0
- package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/Graphing/specifyCorrectAnswerSection.js +0 -1
- package/cypress/e2e/ILC/Graphing/studentViewSettings.js +0 -1
- package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +8 -8
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +256 -0
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +252 -0
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +335 -0
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingPenaltyScoring.js +60 -0
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingScoringCellShadeCount.js +157 -0
- package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +2 -2
- package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +497 -0
- package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +0 -0
- package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +200 -0
- package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +280 -0
- package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +281 -0
- package/cypress/e2e/ILC/Matching/checkAnswerFunctionalityForAllViews.smoke.js +142 -0
- package/cypress/e2e/ILC/Matching/previewTabContentsForAllViews.smoke.js +146 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingPenaltyScoring.js +55 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsBasic.js +116 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +307 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialEqualWeightsBasic.js +163 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/allOrNothingBasicForAllViews.smoke.js +2 -3
- package/cypress/e2e/ILC/MultipleSelectionGridNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +3 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +2 -5
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +11 -10
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +6 -9
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +12 -5
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +1 -2
- package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -0
- package/cypress/pages/components/desmosToolComponent.js +1 -1
- package/cypress/pages/components/gridQuestionCommonComponent.js +28 -4
- package/cypress/pages/components/index.js +1 -0
- package/cypress/pages/components/specifyRowsAndColumnsComponent.js +132 -0
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +3 -113
- package/cypress/pages/geoGebraToolsPage.js +1 -1
- package/cypress/pages/graphingPage.js +6 -0
- package/cypress/pages/gridFillPage.js +67 -12
- package/cypress/pages/index.js +2 -1
- package/cypress/pages/matchingPage.js +433 -0
- package/cypress/pages/multipleSelectionGridPage.js +11 -3
- package/cypress/pages/singleSelectionGridPage.js +2 -1
- package/cypress/pages/textEntryMathPage.js +5 -0
- package/cypress/pages/textEntryMathWithImagePage.js +6 -1
- package/package.json +1 -1
package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js
ADDED
@@ -0,0 +1,200 @@
|
|
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: All or nothing with alternative answers', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Correct answer\' points are equal to \'Alternative 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.allotPoints(20);
|
20
|
+
matchingPage.steps.addMultipleOptionFields(3);
|
21
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
22
|
+
matchingPage.steps.enterTextInOptionInputField(optionsArray);
|
23
|
+
matchingPage.steps.expandMaxCapacityPerDropzoneDropdown();
|
24
|
+
matchingPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
|
25
|
+
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
26
|
+
matchingPage.steps.addAlternativeAnswerAccordion(1);
|
27
|
+
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Penguin', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
28
|
+
matchingPage.steps.allotPoints(20);
|
29
|
+
matchingPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
30
|
+
matchingPage.steps.switchToPreviewTab();
|
31
|
+
});
|
32
|
+
|
33
|
+
it('When the user selects \'Grading\' view without attempting the question, cell numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers from the correct accordion and respective cell numeration', () => {
|
34
|
+
matchingPage.steps.switchToGradingView();
|
35
|
+
matchingPage.steps.verifyDropzoneNumeration();
|
36
|
+
utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
|
37
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
38
|
+
});
|
39
|
+
|
40
|
+
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\' and correct answer section should not be displayed', () => {
|
41
|
+
matchingPage.steps.resetQuestionPreview();
|
42
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
43
|
+
matchingPage.steps.verifyPreviewScore(20, 20);
|
44
|
+
matchingPage.steps.switchToGradingView();
|
45
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
46
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
47
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
48
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
49
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
50
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
51
|
+
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')
|
52
|
+
matchingPage.steps.checkAnswer();
|
53
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
54
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
55
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
56
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
57
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
58
|
+
});
|
59
|
+
|
60
|
+
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', () => {
|
61
|
+
matchingPage.steps.resetQuestionPreview();
|
62
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Penguin', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
63
|
+
matchingPage.steps.verifyPreviewScore(10, 20);
|
64
|
+
matchingPage.steps.switchToGradingView();
|
65
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
66
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
67
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
68
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
69
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
70
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
71
|
+
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')
|
72
|
+
matchingPage.steps.checkAnswer();
|
73
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
74
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
75
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
76
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
77
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
78
|
+
});
|
79
|
+
|
80
|
+
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 along with dropzone numeration should be displayed', () => {
|
81
|
+
matchingPage.steps.resetQuestionPreview();
|
82
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }]);
|
83
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
84
|
+
matchingPage.steps.switchToGradingView();
|
85
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
86
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
87
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
88
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
89
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
90
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
91
|
+
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')
|
92
|
+
matchingPage.steps.checkAnswer();
|
93
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
94
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
95
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
96
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
97
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
98
|
+
});
|
99
|
+
|
100
|
+
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 along with dropzone cell numeration should be displayed', () => {
|
101
|
+
matchingPage.steps.resetQuestionPreview();
|
102
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Penguin', dropzoneIndex: 1 }]);
|
103
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
104
|
+
matchingPage.steps.switchToGradingView();
|
105
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
106
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
107
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
108
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
109
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
110
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
111
|
+
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')
|
112
|
+
matchingPage.steps.checkAnswer();
|
113
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
114
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
115
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
116
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
117
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
118
|
+
});
|
119
|
+
|
120
|
+
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 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 along with dropzone cell numeration should be displayed', () => {
|
121
|
+
matchingPage.steps.resetQuestionPreview();
|
122
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
123
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
124
|
+
matchingPage.steps.switchToGradingView();
|
125
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
126
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
127
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
128
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
129
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
130
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
131
|
+
cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one response incomplete 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')
|
132
|
+
matchingPage.steps.checkAnswer();
|
133
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
134
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
135
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
136
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
137
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
138
|
+
});
|
139
|
+
|
140
|
+
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 along with dropzone cell numeration should be displayed', () => {
|
141
|
+
matchingPage.steps.resetQuestionPreview();
|
142
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Penguin', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
143
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
144
|
+
matchingPage.steps.switchToGradingView();
|
145
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
146
|
+
matchingPage.steps.verifyIncorrectOptionIcon(1);
|
147
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
148
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
149
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
150
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
151
|
+
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')
|
152
|
+
matchingPage.steps.checkAnswer();
|
153
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
154
|
+
matchingPage.steps.verifyIncorrectOptionIcon(1);
|
155
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
156
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
157
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
158
|
+
});
|
159
|
+
|
160
|
+
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 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 along with dropzone cell numeration should be displayed', () => {
|
161
|
+
matchingPage.steps.resetQuestionPreview();
|
162
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Cat', dropzoneIndex: 2 }]);
|
163
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
164
|
+
matchingPage.steps.switchToGradingView();
|
165
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
166
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
167
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
168
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
169
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
170
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
171
|
+
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')
|
172
|
+
matchingPage.steps.checkAnswer();
|
173
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
174
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
175
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
176
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
177
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
178
|
+
});
|
179
|
+
|
180
|
+
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 along with dropzone cell numeration should be displayed', () => {
|
181
|
+
matchingPage.steps.resetQuestionPreview();
|
182
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Eagle', dropzoneIndex: 0 }]);
|
183
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
184
|
+
matchingPage.steps.switchToGradingView();
|
185
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
186
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
187
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
188
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
189
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
190
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
191
|
+
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')
|
192
|
+
matchingPage.steps.checkAnswer();
|
193
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
194
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
195
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
196
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
197
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
198
|
+
});
|
199
|
+
});
|
200
|
+
});
|
@@ -0,0 +1,280 @@
|
|
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: All or nothing with alternative answers', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Correct answer\' points are more than \'Alternative 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.allotPoints(20);
|
20
|
+
matchingPage.steps.addMultipleOptionFields(3);
|
21
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
22
|
+
matchingPage.steps.enterTextInOptionInputField(optionsArray);
|
23
|
+
matchingPage.steps.expandMaxCapacityPerDropzoneDropdown();
|
24
|
+
matchingPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
|
25
|
+
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
26
|
+
matchingPage.steps.addAlternativeAnswerAccordion(1);
|
27
|
+
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Penguin', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
28
|
+
matchingPage.steps.allotPoints(10);
|
29
|
+
matchingPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
30
|
+
matchingPage.steps.switchToPreviewTab();
|
31
|
+
});
|
32
|
+
|
33
|
+
it('When the user selects \'Grading\' view without attempting the question, cell numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers from the correct accordion and respective cell numeration', () => {
|
34
|
+
matchingPage.steps.switchToGradingView();
|
35
|
+
matchingPage.steps.verifyDropzoneNumeration();
|
36
|
+
utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
|
37
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
38
|
+
});
|
39
|
+
|
40
|
+
it('CSS of correct answer section and dropzone cell numeration', { tags: 'css' }, () => {
|
41
|
+
utilities.verifyCSS(matchingPage.correctAnswersLabel(), {
|
42
|
+
'color': css.color.sectionHeading,
|
43
|
+
'font-size': css.fontSize.default,
|
44
|
+
'font-weight': css.fontWeight.bold
|
45
|
+
});
|
46
|
+
utilities.verifyCSS(matchingPage.dropzoneNumeration(), {
|
47
|
+
'background-color': css.color.defaultBackground,
|
48
|
+
'border': `1px solid ${css.color.activeComponentBorder}`
|
49
|
+
});
|
50
|
+
utilities.verifyCSS(matchingPage.correctAnswerContainer().find('[class*="GreenBlock"]'), {
|
51
|
+
'background-color': css.color.correctAnswer
|
52
|
+
});
|
53
|
+
utilities.verifyCSS(matchingPage.correctAnswerContainer().find('[class*="GreenBlock"] svg g'), {
|
54
|
+
'fill': css.color.defaultBackground
|
55
|
+
});
|
56
|
+
utilities.verifyCSS(matchingPage.correctAnswersOptions(), {
|
57
|
+
'color': css.color.text,
|
58
|
+
'font-size': css.fontSize.default,
|
59
|
+
'font-weight': css.fontWeight.regular,
|
60
|
+
});
|
61
|
+
utilities.verifyCSS(matchingPage.correctAnswersOptions().parents('[class*="__AnswerWrapper"]'), {
|
62
|
+
'border': `1px solid ${css.color.correctOptionBorder}`
|
63
|
+
});
|
64
|
+
});
|
65
|
+
|
66
|
+
it('Accessibility of correct answer section and dropzone cell numeration', { tags: 'a11y' }, () => {
|
67
|
+
cy.checkAccessibility(matchingPage.previewTabQuestionWrapper());
|
68
|
+
});
|
69
|
+
|
70
|
+
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\' and correct answer section should not be displayed', () => {
|
71
|
+
matchingPage.steps.resetQuestionPreview();
|
72
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
73
|
+
matchingPage.steps.verifyPreviewScore(20, 20);
|
74
|
+
matchingPage.steps.switchToGradingView();
|
75
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
76
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
77
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
78
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
79
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
80
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
81
|
+
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')
|
82
|
+
matchingPage.steps.checkAnswer();
|
83
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
84
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
85
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
86
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
87
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
88
|
+
});
|
89
|
+
|
90
|
+
it('CSS of Correct answer state', { tags: 'css' }, () => {
|
91
|
+
utilities.verifyCSS(matchingPage.previewScoreText(), {
|
92
|
+
'color': css.color.whiteText,
|
93
|
+
'background-color': css.color.correctAnswer
|
94
|
+
});
|
95
|
+
matchingPage.correctIcon()
|
96
|
+
.verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
|
97
|
+
utilities.verifyCSS(matchingPage.correctIncorrectAnswerBlock(), {
|
98
|
+
'background-color': css.color.correctAnswerLabelBg,
|
99
|
+
'border': `1px solid ${css.color.correctAnswer}`
|
100
|
+
});
|
101
|
+
utilities.verifyCSS(matchingPage.correctIncorrectStatusMessageText(), {
|
102
|
+
'color': css.color.text,
|
103
|
+
'font-size': css.fontSize.default,
|
104
|
+
'font-weight': css.fontWeight.regular
|
105
|
+
});
|
106
|
+
});
|
107
|
+
|
108
|
+
it('Accessibility of correct answer state', { tags: 'a11y' }, () => {
|
109
|
+
cy.checkAccessibility(matchingPage.previewTabQuestionWrapper());
|
110
|
+
});
|
111
|
+
|
112
|
+
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', () => {
|
113
|
+
matchingPage.steps.resetQuestionPreview();
|
114
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Penguin', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
115
|
+
matchingPage.steps.verifyPreviewScore(10, 20);
|
116
|
+
matchingPage.steps.switchToGradingView();
|
117
|
+
// matchingPage.steps.verifyCorrectOptionIcon(0);
|
118
|
+
// matchingPage.steps.verifyCorrectOptionIcon(1);
|
119
|
+
// matchingPage.steps.verifyCorrectOptionIcon(2);
|
120
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
121
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
122
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
123
|
+
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')
|
124
|
+
matchingPage.steps.checkAnswer();
|
125
|
+
// matchingPage.steps.verifyCorrectOptionIcon(0);
|
126
|
+
// matchingPage.steps.verifyCorrectOptionIcon(1);
|
127
|
+
// matchingPage.steps.verifyCorrectOptionIcon(2);
|
128
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
129
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
130
|
+
});
|
131
|
+
|
132
|
+
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 along with dropzone numeration should be displayed', () => {
|
133
|
+
matchingPage.steps.resetQuestionPreview();
|
134
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }]);
|
135
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
136
|
+
matchingPage.steps.switchToGradingView();
|
137
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
138
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
139
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
140
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
141
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
142
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
143
|
+
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')
|
144
|
+
matchingPage.steps.checkAnswer();
|
145
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
146
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
147
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
148
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
149
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
150
|
+
});
|
151
|
+
|
152
|
+
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 along with dropzone cell numeration should be displayed', () => {
|
153
|
+
matchingPage.steps.resetQuestionPreview();
|
154
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Penguin', dropzoneIndex: 1 }]);
|
155
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
156
|
+
matchingPage.steps.switchToGradingView();
|
157
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
158
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
159
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
160
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
161
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
162
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
163
|
+
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')
|
164
|
+
matchingPage.steps.checkAnswer();
|
165
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
166
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
167
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
168
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
169
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
170
|
+
});
|
171
|
+
|
172
|
+
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 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 along with dropzone cell numeration should be displayed', () => {
|
173
|
+
matchingPage.steps.resetQuestionPreview();
|
174
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
175
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
176
|
+
matchingPage.steps.switchToGradingView();
|
177
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
178
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
179
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
180
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
181
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
182
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
183
|
+
cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one response incomplete 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')
|
184
|
+
matchingPage.steps.checkAnswer();
|
185
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
186
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
187
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
188
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
189
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
190
|
+
});
|
191
|
+
|
192
|
+
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 along with dropzone cell numeration should be displayed', () => {
|
193
|
+
matchingPage.steps.resetQuestionPreview();
|
194
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Penguin', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
195
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
196
|
+
matchingPage.steps.switchToGradingView();
|
197
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
198
|
+
matchingPage.steps.verifyIncorrectOptionIcon(1);
|
199
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
200
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
201
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
202
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
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, 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')
|
204
|
+
matchingPage.steps.checkAnswer();
|
205
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
206
|
+
matchingPage.steps.verifyIncorrectOptionIcon(1);
|
207
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
208
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
209
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
210
|
+
});
|
211
|
+
|
212
|
+
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 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 along with dropzone cell numeration should be displayed', () => {
|
213
|
+
matchingPage.steps.resetQuestionPreview();
|
214
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Cat', dropzoneIndex: 2 }]);
|
215
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
216
|
+
matchingPage.steps.switchToGradingView();
|
217
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
218
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
219
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
220
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
221
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
222
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
223
|
+
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')
|
224
|
+
matchingPage.steps.checkAnswer();
|
225
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
226
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
227
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
228
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
229
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
230
|
+
});
|
231
|
+
|
232
|
+
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 along with dropzone cell numeration should be displayed', () => {
|
233
|
+
matchingPage.steps.resetQuestionPreview();
|
234
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Eagle', dropzoneIndex: 0 }]);
|
235
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
236
|
+
matchingPage.steps.switchToGradingView();
|
237
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
238
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
239
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
240
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
241
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
242
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
243
|
+
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')
|
244
|
+
matchingPage.steps.checkAnswer();
|
245
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
246
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
247
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
248
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
249
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
250
|
+
});
|
251
|
+
|
252
|
+
it('CSS of incorrect answer state', { tags: 'css' }, () => {
|
253
|
+
matchingPage.incorrectIcon()
|
254
|
+
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
255
|
+
utilities.verifyCSS(matchingPage.correctIncorrectAnswerBlock(), {
|
256
|
+
'background-color': css.color.incorrectAnswerLabelBg,
|
257
|
+
'border': `1px solid ${css.color.incorrectAnswer}`
|
258
|
+
});
|
259
|
+
utilities.verifyCSS(matchingPage.correctIncorrectStatusMessageText(), {
|
260
|
+
'color': css.color.text,
|
261
|
+
'font-size': css.fontSize.default,
|
262
|
+
'font-weight': css.fontWeight.regular
|
263
|
+
});
|
264
|
+
utilities.verifyCSS(matchingPage.correctIncorrectAnswerLabel(), {
|
265
|
+
'color': css.color.text,
|
266
|
+
'font-size': css.fontSize.default,
|
267
|
+
'font-weight': css.fontWeight.bold
|
268
|
+
});
|
269
|
+
cy.log('Verifying css of an incorrect option')
|
270
|
+
utilities.verifyCSS(matchingPage.dropzonePreviewTab().parents('.cell'), {
|
271
|
+
'background-color': css.color.optionsBg,
|
272
|
+
'border': `2px dashed ${css.color.incorrectAnswer}`
|
273
|
+
});
|
274
|
+
});
|
275
|
+
|
276
|
+
it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
|
277
|
+
cy.checkAccessibility(matchingPage.previewTabQuestionWrapper());
|
278
|
+
});
|
279
|
+
});
|
280
|
+
});
|