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
@@ -0,0 +1,281 @@
|
|
1
|
+
import { dialogBoxBase, matchingPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
const grepTags = Cypress.env('grepTags');
|
6
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
7
|
+
const views = utilities.getViews(correctAnswerViews);
|
8
|
+
var itemReferenceID = "";
|
9
|
+
const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
|
10
|
+
const optionsArray = ['Cat', 'Elephant', 'Fish', 'Bear', 'Eagle'];
|
11
|
+
|
12
|
+
describe('Create item page - Fill in the gaps over image - drag and drop: All or nothing ', () => {
|
13
|
+
before(() => {
|
14
|
+
cy.loginAs('admin');
|
15
|
+
});
|
16
|
+
|
17
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
18
|
+
describe('Question preview modes: Student view and Grading view', () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
22
|
+
cy.barsPreLoaderWait();
|
23
|
+
matchingPage.steps.addMultipleOptionFields(2);
|
24
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
25
|
+
matchingPage.steps.enterTextInOptionInputField(optionsArray);
|
26
|
+
matchingPage.steps.switchToPreviewTab();
|
27
|
+
});
|
28
|
+
|
29
|
+
matchingPage.tests.verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet();
|
30
|
+
|
31
|
+
it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
|
32
|
+
matchingPage.steps.switchToEditTab();
|
33
|
+
matchingPage.steps.allotPoints(20);
|
34
|
+
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
35
|
+
matchingPage.steps.switchToPreviewTab();
|
36
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
37
|
+
});
|
38
|
+
|
39
|
+
it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab, users response should not persist', () => {
|
40
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
41
|
+
matchingPage.steps.resetQuestionPreview();
|
42
|
+
matchingPage.steps.verifyDropzoneTextContentPreviewTab(0, '');
|
43
|
+
matchingPage.steps.verifyDropzoneTextContentPreviewTab(1, '');
|
44
|
+
matchingPage.steps.verifyDropzoneTextContentPreviewTab(2, '');
|
45
|
+
});
|
46
|
+
});
|
47
|
+
};
|
48
|
+
|
49
|
+
views.forEach((view) => {
|
50
|
+
describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
|
51
|
+
abortEarlySetup();
|
52
|
+
before(() => {
|
53
|
+
switch (view) {
|
54
|
+
case 'Question preview':
|
55
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
56
|
+
cy.barsPreLoaderWait();
|
57
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
58
|
+
matchingPage.steps.allotPoints(20);
|
59
|
+
matchingPage.steps.addMultipleOptionFields(2);
|
60
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
61
|
+
matchingPage.steps.enterTextInOptionInputField(optionsArray);
|
62
|
+
matchingPage.steps.expandMaxCapacityPerDropzoneDropdown();
|
63
|
+
matchingPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
|
64
|
+
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
65
|
+
matchingPage.steps.switchToPreviewTab();
|
66
|
+
break;
|
67
|
+
case 'Item preview':
|
68
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
69
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
70
|
+
break;
|
71
|
+
case 'Grading view':
|
72
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
73
|
+
break;
|
74
|
+
};
|
75
|
+
});
|
76
|
+
|
77
|
+
beforeEach(() => {
|
78
|
+
switch (view) {
|
79
|
+
case 'Question preview':
|
80
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
81
|
+
matchingPage.steps.resetQuestionPreview();
|
82
|
+
break;
|
83
|
+
case 'Item preview':
|
84
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
85
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
86
|
+
break;
|
87
|
+
case 'Grading view':
|
88
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
89
|
+
break;
|
90
|
+
}
|
91
|
+
});
|
92
|
+
|
93
|
+
if (view === 'Question preview') {
|
94
|
+
after(() => {
|
95
|
+
matchingPage.steps.clickOnSaveQuestionButton();
|
96
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
97
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
98
|
+
});
|
99
|
+
};
|
100
|
+
|
101
|
+
it('When the user selects \'Grading\' view without attempting the question, dropzone numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
102
|
+
if (view === 'Grading view') {
|
103
|
+
studentViewPage.steps.submitResponse();
|
104
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
105
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
106
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
107
|
+
};
|
108
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
109
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
110
|
+
matchingPage.steps.switchToGradingView();
|
111
|
+
matchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
112
|
+
};
|
113
|
+
matchingPage.steps.verifyDropzoneNumeration();
|
114
|
+
utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
|
115
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
116
|
+
});
|
117
|
+
|
118
|
+
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, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
119
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Eagle', dropzoneIndex: 1 }, { optionText: 'Fish', dropzoneIndex: 2 }]);
|
120
|
+
if (view === 'Grading view') {
|
121
|
+
studentViewPage.steps.submitResponse();
|
122
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
123
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
124
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
125
|
+
};
|
126
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
127
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
128
|
+
matchingPage.steps.switchToGradingView();
|
129
|
+
};
|
130
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
131
|
+
matchingPage.steps.verifyIncorrectOptionIcon(1);
|
132
|
+
matchingPage.steps.verifyIncorrectOptionIcon(2);
|
133
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
134
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When the user attempts the question partially correct with some correct, some incomplete, some incorrect options, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
138
|
+
if (view === 'Grading view') {
|
139
|
+
studentViewPage.steps.clearResponses();
|
140
|
+
};
|
141
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Eagle', dropzoneIndex: 2 }]);
|
142
|
+
if (view === 'Grading view') {
|
143
|
+
studentViewPage.steps.submitResponse();
|
144
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
145
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
146
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
147
|
+
};
|
148
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
149
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
150
|
+
matchingPage.steps.switchToGradingView();
|
151
|
+
};
|
152
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
153
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
154
|
+
matchingPage.steps.verifyIncorrectOptionIcon(2);
|
155
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
156
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
157
|
+
});
|
158
|
+
|
159
|
+
it('When the user attempts the question partially correct with all the dropzone correctly attempted but one dropzone incomplete, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
160
|
+
if (view === 'Grading view') {
|
161
|
+
studentViewPage.steps.clearResponses();
|
162
|
+
};
|
163
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
164
|
+
if (view === 'Grading view') {
|
165
|
+
studentViewPage.steps.submitResponse();
|
166
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
167
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
168
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
169
|
+
};
|
170
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
171
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
172
|
+
matchingPage.steps.switchToGradingView();
|
173
|
+
};
|
174
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
175
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
176
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
177
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
178
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
179
|
+
});
|
180
|
+
|
181
|
+
it('When the user attempts the question partially correct with all the dropzone correctly attempted but with an extra option which is not set as correct answer, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section should be displayed along with numeration', () => {
|
182
|
+
if (view === 'Grading view') {
|
183
|
+
studentViewPage.steps.clearResponses();
|
184
|
+
};
|
185
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
186
|
+
if (view === 'Grading view') {
|
187
|
+
studentViewPage.steps.submitResponse();
|
188
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
189
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
190
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
191
|
+
};
|
192
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
193
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
194
|
+
matchingPage.steps.switchToGradingView();
|
195
|
+
};
|
196
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
197
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0, 1);
|
198
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
199
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
200
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
201
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
202
|
+
});
|
203
|
+
|
204
|
+
it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, 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', () => {
|
205
|
+
if (view === 'Grading view') {
|
206
|
+
studentViewPage.steps.clearResponses();
|
207
|
+
};
|
208
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
209
|
+
if (view === 'Grading view') {
|
210
|
+
studentViewPage.steps.submitResponse();
|
211
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
212
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
213
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
214
|
+
};
|
215
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
216
|
+
matchingPage.steps.verifyPreviewScore(20, 20);
|
217
|
+
matchingPage.steps.switchToGradingView();
|
218
|
+
matchingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
219
|
+
};
|
220
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
221
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
222
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
223
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
224
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
225
|
+
});
|
226
|
+
});
|
227
|
+
});
|
228
|
+
|
229
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
230
|
+
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
231
|
+
abortEarlySetup();
|
232
|
+
before(() => {
|
233
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
234
|
+
cy.barsPreLoaderWait();
|
235
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
236
|
+
matchingPage.steps.allotPoints(20);
|
237
|
+
matchingPage.steps.addMultipleOptionFields(2);
|
238
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
239
|
+
matchingPage.steps.enterTextInOptionInputField(optionsArray);
|
240
|
+
matchingPage.steps.expandMaxCapacityPerDropzoneDropdown();
|
241
|
+
matchingPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
|
242
|
+
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
243
|
+
matchingPage.steps.allotPoints(20);
|
244
|
+
});
|
245
|
+
|
246
|
+
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', () => {
|
247
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
248
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
249
|
+
matchingPage.steps.allotMinimumPoints(2);
|
250
|
+
matchingPage.steps.switchToPreviewTab();
|
251
|
+
matchingPage.steps.switchToGradingView();
|
252
|
+
matchingPage.steps.verifyPreviewScore(2, 20);
|
253
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
254
|
+
});
|
255
|
+
|
256
|
+
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', () => {
|
257
|
+
matchingPage.steps.resetQuestionPreview();
|
258
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Eagle', dropzoneIndex: 1 }, { optionText: 'Fish', dropzoneIndex: 2 }]);;
|
259
|
+
matchingPage.steps.verifyPreviewScore(2, 20);
|
260
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
261
|
+
});
|
262
|
+
|
263
|
+
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', () => {
|
264
|
+
matchingPage.steps.switchToEditTab();
|
265
|
+
matchingPage.steps.expandMinimumScoringDropdown();
|
266
|
+
matchingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
267
|
+
matchingPage.steps.allotMinimumPoints(2);
|
268
|
+
matchingPage.steps.switchToPreviewTab();
|
269
|
+
matchingPage.steps.switchToGradingView();
|
270
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
271
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
272
|
+
});
|
273
|
+
|
274
|
+
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', () => {
|
275
|
+
matchingPage.steps.resetQuestionPreview();
|
276
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Eagle', dropzoneIndex: 1 }, { optionText: 'Fish', dropzoneIndex: 2 }]);
|
277
|
+
matchingPage.steps.verifyPreviewScore(2, 20);
|
278
|
+
});
|
279
|
+
});
|
280
|
+
};
|
281
|
+
});
|
@@ -0,0 +1,142 @@
|
|
1
|
+
import { matchingPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
var itemReferenceID = "";
|
5
|
+
const checkAnswerViews = ['Question preview', 'Item preview', 'Student view'];
|
6
|
+
const views = utilities.getViews(checkAnswerViews);
|
7
|
+
const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
|
8
|
+
const optionsArray = ['Cat', 'Elephant', 'Fish', 'Bear', 'Eagle'];
|
9
|
+
|
10
|
+
describe('Create item page - Fill in the gaps with text - Check answer functionality', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
views.forEach((view) => {
|
16
|
+
//Note: Remove after https://redmine.zeuslearning.com/issues/549542 is fixed
|
17
|
+
const checkAnswer = (view) => {
|
18
|
+
switch (view) {
|
19
|
+
case 'Question preview':
|
20
|
+
case 'Item preview':
|
21
|
+
matchingPage.steps.checkAnswer();
|
22
|
+
break;
|
23
|
+
case 'Student view':
|
24
|
+
studentViewPage.steps.checkAnswer();
|
25
|
+
break;
|
26
|
+
default:
|
27
|
+
throw new Error(`Unsupported page identifier: ${view}`);
|
28
|
+
}
|
29
|
+
};
|
30
|
+
|
31
|
+
describe(`${view} - Check answer functionality`, { tags: 'smoke' }, () => {
|
32
|
+
abortEarlySetup();
|
33
|
+
before(() => {
|
34
|
+
switch (view) {
|
35
|
+
case 'Question preview':
|
36
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
37
|
+
cy.barsPreLoaderWait();
|
38
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
39
|
+
matchingPage.steps.allotPoints(20);
|
40
|
+
matchingPage.steps.addMultipleOptionFields(2);
|
41
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
42
|
+
matchingPage.steps.enterTextInOptionInputField(optionsArray);
|
43
|
+
matchingPage.steps.expandMaxCapacityPerDropzoneDropdown();
|
44
|
+
matchingPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
|
45
|
+
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
46
|
+
matchingPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
47
|
+
matchingPage.steps.switchToPreviewTab();
|
48
|
+
break;
|
49
|
+
case 'Item preview':
|
50
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
51
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
52
|
+
break;
|
53
|
+
case 'Student view':
|
54
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
55
|
+
break;
|
56
|
+
}
|
57
|
+
});
|
58
|
+
|
59
|
+
beforeEach(() => {
|
60
|
+
switch (view) {
|
61
|
+
case 'Question preview':
|
62
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
63
|
+
matchingPage.steps.resetQuestionPreview();
|
64
|
+
break;
|
65
|
+
case 'Item preview':
|
66
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
67
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
68
|
+
break;
|
69
|
+
case 'Student view':
|
70
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
71
|
+
break;
|
72
|
+
}
|
73
|
+
});
|
74
|
+
|
75
|
+
if (view === 'Question preview') {
|
76
|
+
after(() => {
|
77
|
+
matchingPage.steps.clickOnSaveQuestionButton();
|
78
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
79
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
80
|
+
});
|
81
|
+
};
|
82
|
+
|
83
|
+
it('When the user selects \'Check answer\' button without attempting the question, then correct/incorrect icons, correct/incorrect answer status message and correct answer section should not be displayed', () => {
|
84
|
+
checkAnswer(view);
|
85
|
+
matchingPage.steps.verifyCorrectIncorrectIconsNotExist();
|
86
|
+
matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
87
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
88
|
+
});
|
89
|
+
|
90
|
+
it('When the user attempts the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
|
91
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Eagle', dropzoneIndex: 1 }, { optionText: 'Fish', dropzoneIndex: 2 }]);
|
92
|
+
checkAnswer(view);
|
93
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
94
|
+
matchingPage.steps.verifyIncorrectOptionIcon(1);
|
95
|
+
matchingPage.steps.verifyIncorrectOptionIcon(2);
|
96
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
97
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
98
|
+
});
|
99
|
+
|
100
|
+
it('When the user attempts the question partially correct and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, correct icons should be displayed besides correct responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
|
101
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Eagle', dropzoneIndex: 2 }]);
|
102
|
+
checkAnswer(view);
|
103
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
104
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
105
|
+
matchingPage.steps.verifyIncorrectOptionIcon(2);
|
106
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
107
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
108
|
+
});
|
109
|
+
|
110
|
+
it('When the user attempts the question partially correct with all the dropzone correctly attempted but one dropzone incomplete, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
111
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
112
|
+
checkAnswer(view);
|
113
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
114
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
115
|
+
matchingPage.steps.verifyCorrectOptionIcon(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 dropzone correctly attempted but with an extra option which is not set as correct answer, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section should be displayed along with numeration', () => {
|
121
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
122
|
+
checkAnswer(view);
|
123
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
124
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0, 1);
|
125
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
126
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
127
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
128
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
129
|
+
});
|
130
|
+
|
131
|
+
it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, 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', () => {
|
132
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
133
|
+
checkAnswer(view);
|
134
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
135
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
136
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
137
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
138
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
139
|
+
});
|
140
|
+
});
|
141
|
+
});
|
142
|
+
});
|
@@ -0,0 +1,146 @@
|
|
1
|
+
import { matchingPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
5
|
+
const views = utilities.getViews(previewContentViews);
|
6
|
+
var itemReferenceID = "";
|
7
|
+
const css = Cypress.env('css');
|
8
|
+
|
9
|
+
describe('Create item page - Matching - Preview contents in all views', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
views.forEach((view) => {
|
15
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
switch (view) {
|
19
|
+
case 'Question preview':
|
20
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
21
|
+
cy.barsPreLoaderWait();
|
22
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
23
|
+
matchingPage.steps.allotPoints(10);
|
24
|
+
cy.log('Add image to prompt input field')
|
25
|
+
matchingPage.steps.focusInPromptInputField(0);
|
26
|
+
matchingPage.steps.selectImageOptionFromCKEditorToolbar();
|
27
|
+
matchingPage.steps.addImageToInputField();
|
28
|
+
matchingPage.steps.enterTextInOnePromptInputField(0, 'Fox');
|
29
|
+
cy.log('Add bold text to prompt input field')
|
30
|
+
matchingPage.steps.focusInPromptInputField(1);
|
31
|
+
matchingPage.steps.selectBoldOptionFromCKEditorToolbar();
|
32
|
+
matchingPage.steps.enterTextInOnePromptInputField(1, 'This is a bold option');
|
33
|
+
cy.log('Add equation to prompt input field')
|
34
|
+
matchingPage.steps.enterTextInOnePromptInputField(2, 'Solve the following');
|
35
|
+
matchingPage.steps.focusInPromptInputField(2);
|
36
|
+
matchingPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
37
|
+
matchingPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
38
|
+
cy.log('Add image to option input field')
|
39
|
+
matchingPage.steps.focusInOptionsInputField(0);
|
40
|
+
matchingPage.steps.selectImageOptionFromCKEditorToolbar();
|
41
|
+
matchingPage.steps.addImageToInputField();
|
42
|
+
matchingPage.steps.enterTextInOneOptionInputField(0, 'Fox');
|
43
|
+
cy.log('Add bold text to input field')
|
44
|
+
matchingPage.steps.focusInOptionsInputField(1);
|
45
|
+
matchingPage.steps.selectBoldOptionFromCKEditorToolbar();
|
46
|
+
matchingPage.steps.enterTextInOneOptionInputField(1, 'This is a bold option');
|
47
|
+
cy.log('Add equation to option input field')
|
48
|
+
matchingPage.steps.enterTextInOneOptionInputField(2, 'Solve the following');
|
49
|
+
matchingPage.steps.focusInOptionsInputField(2);
|
50
|
+
matchingPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
51
|
+
matchingPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
52
|
+
matchingPage.steps.addMultipleOptionFields(1);
|
53
|
+
matchingPage.steps.enterTextInOneOptionInputField(3, 'Elephant');
|
54
|
+
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Fox', dropzoneIndex: 0 }, { optionText: 'This is a bold option', dropzoneIndex: 1 }, { optionText: 'Solve the following', dropzoneIndex: 2 }]);
|
55
|
+
matchingPage.steps.switchToPreviewTab();
|
56
|
+
break;
|
57
|
+
case 'Item view':
|
58
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
59
|
+
break;
|
60
|
+
case 'Item preview':
|
61
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
62
|
+
matchingPage.steps.switchToPreviewTab();
|
63
|
+
break;
|
64
|
+
case 'Student view':
|
65
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
66
|
+
break;
|
67
|
+
case 'Grading view':
|
68
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
69
|
+
break;
|
70
|
+
case 'Correct answer view':
|
71
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
72
|
+
break;
|
73
|
+
default:
|
74
|
+
throw new Error('Invalid view');
|
75
|
+
}
|
76
|
+
});
|
77
|
+
|
78
|
+
after(() => {
|
79
|
+
if (view === 'Question preview') {
|
80
|
+
matchingPage.steps.clickOnSaveQuestionButton();
|
81
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
82
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
83
|
+
}
|
84
|
+
if (view === 'Student view') {
|
85
|
+
studentViewPage.steps.submitResponse();
|
86
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
87
|
+
}
|
88
|
+
});
|
89
|
+
|
90
|
+
it('Question instructions should be visible', () => {
|
91
|
+
utilities.verifyInnerText(matchingPage.questionInstructionsText(), 'Fill the categories with the right answer.');
|
92
|
+
utilities.verifyElementVisibilityState(matchingPage.questionInstructionsText(), 'visible');
|
93
|
+
});
|
94
|
+
|
95
|
+
it('The prompt should have image, equation, bold text displayed', () => {
|
96
|
+
matchingPage.steps.verifyPromptWithImageInPreviewTab(0);
|
97
|
+
matchingPage.steps.verifyPromptWithBoldTextInPreviewTab(1);
|
98
|
+
matchingPage.steps.verifyPromptWithEquationTextInPreviewTab(2);
|
99
|
+
});
|
100
|
+
|
101
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
102
|
+
it(`When the user has added image, equation, bold text to the options input fields, then they should be displayed in the options container in ${view}`, () => {
|
103
|
+
matchingPage.steps.verifyDraggableOptionWithImageInPreviewTab(0);
|
104
|
+
matchingPage.steps.verifyDraggableOptionWithBoldTextInPreviewTab(1);
|
105
|
+
matchingPage.steps.verifyDraggableOptionWithEquationTextInPreviewTab(2);
|
106
|
+
matchingPage.steps.verifyDropzoneTextContentPreviewTab(0, '');
|
107
|
+
matchingPage.steps.verifyDropzoneTextContentPreviewTab(1, '');
|
108
|
+
matchingPage.steps.verifyDropzoneTextContentPreviewTab(2, '');
|
109
|
+
});
|
110
|
+
|
111
|
+
it('User should be able to drag and drop image, bold text and equation options in the dropzone', () => {
|
112
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Fox', dropzoneIndex: 0 }, { optionText: 'This is a bold option', dropzoneIndex: 1 }, { optionText: 'Solve the following', dropzoneIndex: 2 }]);
|
113
|
+
matchingPage.steps.verifyDropzoneTextContentPreviewTab(0, 'Fox');
|
114
|
+
matchingPage.steps.verifyDropzoneWithImageInPreviewTab(0);
|
115
|
+
matchingPage.steps.verifyDropzoneTextContentPreviewTab(1, 'This is a bold option');
|
116
|
+
matchingPage.steps.verifyDropzoneContainsTextPreviewTab(2, 'Solve the following');
|
117
|
+
matchingPage.steps.verifyDropzoneWithEquationTextInPreviewTab(2);
|
118
|
+
});
|
119
|
+
} else if (view === 'Grading view') {
|
120
|
+
it(`The submitted options should be in the respective dropzone and the options container should not be displayed`, () => {
|
121
|
+
matchingPage.steps.verifyDropzoneContainsTextPreviewTab(0, 'Fox');
|
122
|
+
matchingPage.steps.verifyDropzoneContainsTextPreviewTab(1, 'This is a bold option');
|
123
|
+
matchingPage.steps.verifyDropzoneWithImageInPreviewTab(0);
|
124
|
+
matchingPage.steps.verifyDropzoneWithEquationTextInPreviewTab(2);
|
125
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
126
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
127
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
128
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
129
|
+
utilities.verifyElementVisibilityState(matchingPage.correctAnswersOptions(), 'notExist');
|
130
|
+
});
|
131
|
+
|
132
|
+
it('The content in the dropzone should not be editable', () => {
|
133
|
+
matchingPage.steps.verifyGradingViewOptionDisabled([{ optionText: 'Elephant', dropzoneIndex: 0 }]);
|
134
|
+
});
|
135
|
+
} else {
|
136
|
+
it('The dropzone should be displayed filled with answers', () => {
|
137
|
+
utilities.verifyElementCount(matchingPage.dropzonePreviewTab(), 3);
|
138
|
+
matchingPage.steps.verifyDropzoneTextContentPreviewTab(0, 'Fox');
|
139
|
+
matchingPage.steps.verifyDropzoneWithImageInPreviewTab(0);
|
140
|
+
matchingPage.steps.verifyDropzoneTextContentPreviewTab(1, 'This is a bold option');
|
141
|
+
matchingPage.steps.verifyDropzoneWithEquationTextInPreviewTab(2);
|
142
|
+
});
|
143
|
+
}
|
144
|
+
});
|
145
|
+
});
|
146
|
+
});
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { multipleSelectionGridPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Create item page - Multiple selection grid: All or nothing with alternative answers', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Question preview: Auto scored - All or nothing: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
13
|
+
cy.barsPreLoaderWait();
|
14
|
+
multipleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not')
|
15
|
+
multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
16
|
+
multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
17
|
+
multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
18
|
+
multipleSelectionGridPage.steps.allotPoints(20);
|
19
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
20
|
+
});
|
21
|
+
|
22
|
+
//Penalty points for the entire question
|
23
|
+
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', () => {
|
24
|
+
multipleSelectionGridPage.steps.expandPenaltyScoringDropdown();
|
25
|
+
multipleSelectionGridPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
|
26
|
+
multipleSelectionGridPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
|
27
|
+
multipleSelectionGridPage.steps.allotPenaltyPoints(2);
|
28
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
29
|
+
multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 1 }]);
|
30
|
+
multipleSelectionGridPage.steps.verifyPreviewScore(-2, 20);
|
31
|
+
});
|
32
|
+
|
33
|
+
it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
|
34
|
+
multipleSelectionGridPage.steps.resetQuestionPreview();
|
35
|
+
multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
36
|
+
multipleSelectionGridPage.steps.verifyPreviewScore(-2, 20);
|
37
|
+
});
|
38
|
+
|
39
|
+
it('When the user attempts the question correctly along with multiple incorrect options, 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 options', () => {
|
40
|
+
multipleSelectionGridPage.steps.resetQuestionPreview();
|
41
|
+
multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
42
|
+
multipleSelectionGridPage.steps.verifyPreviewScore(-2, 20);
|
43
|
+
});
|
44
|
+
|
45
|
+
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', () => {
|
46
|
+
multipleSelectionGridPage.steps.switchToEditTab();
|
47
|
+
multipleSelectionGridPage.steps.expandMinimumScoringDropdown();
|
48
|
+
multipleSelectionGridPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
49
|
+
multipleSelectionGridPage.steps.allotMinimumPoints(3);
|
50
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
51
|
+
multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
52
|
+
multipleSelectionGridPage.steps.verifyPreviewScore(3, 20);
|
53
|
+
});
|
54
|
+
});
|
55
|
+
});
|