itemengine-cypress-automation 1.0.583 → 1.0.584-IEI-7048-098328c.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +8 -109
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +8 -109
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +8 -109
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/blankResponseScoring.js +2 -7
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +10 -139
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +9 -124
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +10 -139
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +9 -124
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +8 -109
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +9 -124
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/allOrNothingForAllViews.smoke.js +2 -243
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +77 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +78 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +78 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +104 -9
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsBasic.js +4 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +95 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +95 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +84 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsBasic.js +4 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +73 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +84 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +187 -2
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +79 -1
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +79 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +79 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +4 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +103 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +4 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +103 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +91 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +4 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +79 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +91 -0
- package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +209 -5
- package/cypress/e2e/ILC/ListOrderingNew/horizontalOrientationAllOrNothingForAllViews.smoke.js +195 -1
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +85 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +82 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +85 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +109 -6
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsBasic.js +4 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +103 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +91 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsBasic.js +4 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +79 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +91 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +207 -3
- package/cypress/e2e/ILC/Matching/Scoring/allOrNothingGroupedScoring.js +9 -1
- package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +102 -2
- package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +102 -2
- package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +107 -2
- package/cypress/e2e/ILC/Matching/Scoring/blankResponseScoring.js +36 -2
- package/cypress/e2e/ILC/Matching/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +5 -0
- package/cypress/e2e/ILC/Matching/Scoring/manuallyAndNonScored.js +1 -0
- package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsScoringBasic.js +10 -1
- package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +128 -2
- package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +115 -2
- package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +128 -2
- package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsBasic.js +9 -1
- package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +115 -2
- package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +102 -2
- package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +115 -2
- package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +226 -2
- package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +9 -1
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +102 -2
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +102 -2
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +102 -2
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/blankResponseScoring.js +32 -5
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/manuallyAndNonScored.js +3 -0
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsScoringBasic.js +10 -1
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +128 -2
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternatePoints.js +115 -2
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternatePoints.js +128 -2
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsBasic.js +9 -1
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +115 -2
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +102 -2
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +115 -2
- package/cypress/e2e/ILC/MatchingDropdown/allOrNothingScoringForAllViews.smoke.js +216 -2
- package/cypress/pages/components/correctIncorrectAnswerLabelComponent.js +18 -1
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +1 -25
- package/cypress/pages/listOrderingPage.js +60 -1
- package/cypress/pages/matchingPage.js +23 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
|
3
3
|
import utilities from "../../../support/helpers/utilities";
|
|
4
4
|
const css = Cypress.env('css');
|
|
5
5
|
const grepTags = Cypress.env('grepTags');
|
|
6
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
|
|
6
7
|
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
|
7
8
|
const views = utilities.getViews(correctAnswerViews);
|
|
8
9
|
var itemReferenceID = "";
|
|
@@ -115,7 +116,11 @@ describe('Create item page - Matching: All or nothing ', () => {
|
|
|
115
116
|
matchingPage.steps.verifyDropdownNumeration(2);
|
|
116
117
|
matchingPage.steps.verifyCorrectIncorrectIconsNotExist();
|
|
117
118
|
matchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
|
118
|
-
|
|
119
|
+
if(alternativeAnswerCheck === 'true') {
|
|
120
|
+
matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
|
|
121
|
+
} else {
|
|
122
|
+
utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
|
|
123
|
+
}
|
|
119
124
|
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
|
120
125
|
});
|
|
121
126
|
|
|
@@ -202,11 +207,213 @@ describe('Create item page - Matching: All or nothing ', () => {
|
|
|
202
207
|
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
|
203
208
|
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
|
204
209
|
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
210
|
+
if (alternativeAnswerCheck === 'true') {
|
|
211
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
212
|
+
}
|
|
205
213
|
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
206
214
|
});
|
|
207
215
|
});
|
|
208
216
|
});
|
|
209
217
|
|
|
218
|
+
if (alternativeAnswerCheck === 'true') {
|
|
219
|
+
views.forEach((view) => {
|
|
220
|
+
describe(`${view}: Auto scored - All or nothing scoring with alternate answers`, { tags: 'smoke' }, () => {
|
|
221
|
+
abortEarlySetup();
|
|
222
|
+
before(() => {
|
|
223
|
+
switch (view) {
|
|
224
|
+
case 'Question preview':
|
|
225
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
|
226
|
+
cy.barsPreLoaderWait();
|
|
227
|
+
matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
|
|
228
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
|
229
|
+
matchingPage.steps.allotPoints(20);
|
|
230
|
+
matchingPage.steps.addMultipleOptionFields(2);
|
|
231
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
|
232
|
+
matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
|
|
233
|
+
matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
|
234
|
+
matchingPage.steps.addAlternativeAnswerAccordion(1);
|
|
235
|
+
matchingPage.steps.allotPoints(10);
|
|
236
|
+
matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[4] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
|
237
|
+
matchingPage.steps.switchToPreviewTab();
|
|
238
|
+
break;
|
|
239
|
+
case 'Item preview':
|
|
240
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
241
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
242
|
+
break;
|
|
243
|
+
case 'Grading view':
|
|
244
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
245
|
+
break;
|
|
246
|
+
};
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
beforeEach(() => {
|
|
250
|
+
switch (view) {
|
|
251
|
+
case 'Question preview':
|
|
252
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
253
|
+
matchingPage.steps.resetQuestionPreview();
|
|
254
|
+
break;
|
|
255
|
+
case 'Item preview':
|
|
256
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
257
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
|
258
|
+
break;
|
|
259
|
+
case 'Grading view':
|
|
260
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
if (view === 'Question preview') {
|
|
266
|
+
after(() => {
|
|
267
|
+
matchingPage.steps.clickOnSaveQuestionButton();
|
|
268
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
269
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
|
274
|
+
if (view === 'Grading view') {
|
|
275
|
+
studentViewPage.steps.submitResponse();
|
|
276
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
277
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
278
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
279
|
+
};
|
|
280
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
281
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
|
282
|
+
matchingPage.steps.switchToGradingView();
|
|
283
|
+
matchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
284
|
+
};
|
|
285
|
+
matchingPage.steps.verifyDropdownNumeration(0);
|
|
286
|
+
matchingPage.steps.verifyDropdownNumeration(1);
|
|
287
|
+
matchingPage.steps.verifyDropdownNumeration(2);
|
|
288
|
+
matchingPage.steps.verifyCorrectIncorrectIconsNotExist();
|
|
289
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
|
290
|
+
matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
|
|
291
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
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', () => {
|
|
295
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }, { dropdownIndex: 1, dropdownOption: optionsArray[0] }, { dropdownIndex: 2, dropdownOption: optionsArray[2] }]);
|
|
296
|
+
if (view === 'Grading view') {
|
|
297
|
+
studentViewPage.steps.submitResponse();
|
|
298
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
299
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
300
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
301
|
+
};
|
|
302
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
303
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
|
304
|
+
matchingPage.steps.switchToGradingView();
|
|
305
|
+
};
|
|
306
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
|
|
307
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(1);
|
|
308
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(2);
|
|
309
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
310
|
+
matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
|
|
311
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
|
312
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
|
|
313
|
+
matchingPage.steps.disableShowAlternativeAnswersToggle();
|
|
314
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
315
|
+
matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
316
|
+
matchingPage.steps.clickShowAlternativeAnswersToggle();
|
|
317
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
318
|
+
matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(10 points)', 1);
|
|
319
|
+
matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Eagle'], ['Cat']], 1);
|
|
320
|
+
matchingPage.steps.clickShowAlternativeAnswersToggle();
|
|
321
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
it('When the user attempts the question partially correct with some correct, some incomplete and 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', () => {
|
|
325
|
+
if (view === 'Grading view') {
|
|
326
|
+
studentViewPage.steps.clearResponses();
|
|
327
|
+
};
|
|
328
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 2, dropdownOption: optionsArray[3] }]);
|
|
329
|
+
if (view === 'Grading view') {
|
|
330
|
+
studentViewPage.steps.submitResponse();
|
|
331
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
332
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
333
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
334
|
+
};
|
|
335
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
336
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
|
337
|
+
matchingPage.steps.switchToGradingView();
|
|
338
|
+
};
|
|
339
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
|
340
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(1);
|
|
341
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(2);
|
|
342
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
343
|
+
matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
|
|
344
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
|
345
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
|
|
346
|
+
matchingPage.steps.disableShowAlternativeAnswersToggle();
|
|
347
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
348
|
+
matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
349
|
+
matchingPage.steps.clickShowAlternativeAnswersToggle();
|
|
350
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
351
|
+
matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(10 points)', 1);
|
|
352
|
+
matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Eagle'], ['Cat']], 1);
|
|
353
|
+
matchingPage.steps.clickShowAlternativeAnswersToggle();
|
|
354
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
it('When the user attempts the question partially correct with all the dropdowns correctly attempted but one dropdown 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', () => {
|
|
358
|
+
if (view === 'Grading view') {
|
|
359
|
+
studentViewPage.steps.clearResponses();
|
|
360
|
+
};
|
|
361
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
|
362
|
+
if (view === 'Grading view') {
|
|
363
|
+
studentViewPage.steps.submitResponse();
|
|
364
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
365
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
366
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
367
|
+
};
|
|
368
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
369
|
+
matchingPage.steps.verifyPreviewScore(0, 20);
|
|
370
|
+
matchingPage.steps.switchToGradingView();
|
|
371
|
+
};
|
|
372
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
|
|
373
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
|
374
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
|
375
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
376
|
+
matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
|
|
377
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
|
378
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
|
|
379
|
+
matchingPage.steps.disableShowAlternativeAnswersToggle();
|
|
380
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
381
|
+
matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
382
|
+
matchingPage.steps.clickShowAlternativeAnswersToggle();
|
|
383
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
384
|
+
matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(10 points)', 1);
|
|
385
|
+
matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Eagle'], ['Cat']], 1);
|
|
386
|
+
matchingPage.steps.clickShowAlternativeAnswersToggle();
|
|
387
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
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', () => {
|
|
391
|
+
if (view === 'Grading view') {
|
|
392
|
+
studentViewPage.steps.clearResponses();
|
|
393
|
+
};
|
|
394
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
|
395
|
+
if (view === 'Grading view') {
|
|
396
|
+
studentViewPage.steps.submitResponse();
|
|
397
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
398
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
399
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
|
400
|
+
};
|
|
401
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
402
|
+
matchingPage.steps.verifyPreviewScore(20, 20);
|
|
403
|
+
matchingPage.steps.switchToGradingView();
|
|
404
|
+
matchingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
|
405
|
+
};
|
|
406
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
|
407
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
|
408
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
|
409
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
410
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
411
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
412
|
+
});
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
|
|
210
417
|
views.forEach((view) => {
|
|
211
418
|
describe(`${view}: Matching dropdown - Manually scored`, { tags: 'smoke' }, () => {
|
|
212
419
|
abortEarlySetup();
|
|
@@ -352,7 +559,11 @@ describe('Create item page - Matching: All or nothing ', () => {
|
|
|
352
559
|
matchingPage.steps.verifyDropdownNumeration(2);
|
|
353
560
|
matchingPage.steps.verifyCorrectIncorrectIconsNotExist();
|
|
354
561
|
matchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
|
355
|
-
|
|
562
|
+
if (alternativeAnswerCheck === 'true') {
|
|
563
|
+
matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '', 0);
|
|
564
|
+
} else {
|
|
565
|
+
utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
|
|
566
|
+
}
|
|
356
567
|
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
|
357
568
|
});
|
|
358
569
|
|
|
@@ -410,6 +621,9 @@ describe('Create item page - Matching: All or nothing ', () => {
|
|
|
410
621
|
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
|
411
622
|
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
|
412
623
|
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
624
|
+
if (alternativeAnswerCheck === 'true') {
|
|
625
|
+
matchingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
626
|
+
}
|
|
413
627
|
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
414
628
|
});
|
|
415
629
|
});
|
|
@@ -6,7 +6,8 @@ const selectors = {
|
|
|
6
6
|
correctAnswerContainer: () => cy.get('[class*="correct-answer-wrapper"]'),
|
|
7
7
|
correctIncorrectAnswerBlock: () => cy.get('[class*="-answer-block"]'),
|
|
8
8
|
correctIncorrectStatusMessageText: () => cy.get('[class*="AnswerStatusText"]'),
|
|
9
|
-
correctIncorrectAnswerLabel: () => cy.get('[class*="CorrectIncorrectLabel"]')
|
|
9
|
+
correctIncorrectAnswerLabel: () => cy.get('[class*="CorrectIncorrectLabel"]'),
|
|
10
|
+
correctAnswerLabelWrapper: () => cy.get('[class*="CorrectAnswerLabelWrapper"]')
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const steps = {
|
|
@@ -34,6 +35,22 @@ const steps = {
|
|
|
34
35
|
verifyCorrectIncorrectStatusMessageExists: () => {
|
|
35
36
|
utilities.verifyElementVisibilityState(correctIncorrectAnswerLabelComponent.correctIncorrectAnswerBlock(), 'exist');
|
|
36
37
|
},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @param {string} expectedLabel - The expected label text (e.g., "Correct answer", "Alternative answer 1", "Alternative answer 2").
|
|
41
|
+
* @param {string} expectedPoints - The expected points text (e.g., "(20 points)", "(10 points)").
|
|
42
|
+
* @param {number} [sectionIndex=0] - The index of the answer section (0 for first section, 1 for second section, etc.).
|
|
43
|
+
* @description Verifies the answer label and its associated point value in a specific section.
|
|
44
|
+
* This can be used for correct answer or alternative answer sections.
|
|
45
|
+
*/
|
|
46
|
+
verifyAnswerLabelAndPoints: (expectedLabel, expectedPoints, sectionIndex = 0) => {
|
|
47
|
+
correctIncorrectAnswerLabelComponent.correctAnswerLabelWrapper()
|
|
48
|
+
.eq(sectionIndex)
|
|
49
|
+
.within(() => {
|
|
50
|
+
cy.contains(expectedLabel).should('be.visible');
|
|
51
|
+
cy.get('p').should('contain.text', expectedPoints);
|
|
52
|
+
});
|
|
53
|
+
},
|
|
37
54
|
}
|
|
38
55
|
|
|
39
56
|
export const correctIncorrectAnswerLabelComponent = {
|
|
@@ -11,14 +11,13 @@ const selectors = {
|
|
|
11
11
|
specifyPointsForEachIncorrectDropzoneRadioButton: () => cy.get('input[aria-label*="Specify points for each incorrect"]'),
|
|
12
12
|
|
|
13
13
|
correctAnswersNumeration: () => cy.get('[class*="__AnswerCell"] .answer-numeration-number-box'),
|
|
14
|
-
correctAnswersOptions: () => cy.get('[class*="
|
|
14
|
+
correctAnswersOptions: () => cy.get('[class*="__AnswerWrapper"]'),
|
|
15
15
|
correctAnswersLabel: () => cy.get('.correct-answers-label'),
|
|
16
16
|
tickIconWrapper: () => cy.get('.tick-icon-wrapper'),
|
|
17
17
|
correctAnswerContainer: () => cy.get('.dnd-correct-answer-wrapper'),
|
|
18
18
|
correctIncorrectAnswerLabel: () => cy.get('[class*="CorrectIncorrectLabel"]'),
|
|
19
19
|
correctAnswerResponseWrapperWithoutEnumeration: () => cy.get('[class*="CorrectAnswers"] [class*="AnswerStatusIconAndResponseWrapper"]'),
|
|
20
20
|
answerStatusBanner: () => cy.get('[class*="AnswerStatusWrapper"]'),
|
|
21
|
-
correctAnswerPointsLabel: () => cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"] p'),
|
|
22
21
|
|
|
23
22
|
//additional settings
|
|
24
23
|
enterAriaLabelInputField: () => cy.get('input[aria-label*="Enter ARIA label"]'),
|
|
@@ -40,29 +39,6 @@ const steps = {
|
|
|
40
39
|
});
|
|
41
40
|
},
|
|
42
41
|
|
|
43
|
-
verifyCorrectAnswerSectionWithAlternateAnswers: (correctAnswersArray) => {
|
|
44
|
-
let answerIndex = 0;
|
|
45
|
-
let pointsLabelIndex = 0;
|
|
46
|
-
correctAnswersArray.forEach(({
|
|
47
|
-
correctAnswers, points
|
|
48
|
-
}) => {
|
|
49
|
-
correctAnswers.forEach((correctAnswer, index) => {
|
|
50
|
-
utilities.verifyTextContent(utilities.getNthElement(fillInTheGapsDragAndDropCommonComponents.correctAnswersNumeration(), answerIndex), index + 1);
|
|
51
|
-
correctAnswer.forEach((answerOption) => {
|
|
52
|
-
utilities.verifyTextContent(utilities.getNthElement(fillInTheGapsDragAndDropCommonComponents.correctAnswersOptions(), answerIndex), answerOption);
|
|
53
|
-
});
|
|
54
|
-
answerIndex += 1;
|
|
55
|
-
});
|
|
56
|
-
points.forEach((pointsText) => {
|
|
57
|
-
fillInTheGapsDragAndDropCommonComponents.correctAnswerPointsLabel()
|
|
58
|
-
.eq(pointsLabelIndex)
|
|
59
|
-
.should('have.text', pointsText);
|
|
60
|
-
pointsLabelIndex += 1;
|
|
61
|
-
})
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
66
42
|
verifyCorrectAnswerSectionNotExists: () => {
|
|
67
43
|
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropCommonComponents.correctAnswerContainer(), 'notExist');
|
|
68
44
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import constants from "../fixtures/constants";
|
|
2
2
|
import utilities from "../support/helpers/utilities";
|
|
3
|
-
import { autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, autoScoredStudentViewSettings, commonComponents, correctIncorrectAnswerLabelComponent, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, randomizeOptionsComponent, scoringSectionBaseEditTab, studentViewSettingsLabelComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, enableOuterBorderComponent, styleAndLayoutCustomizationAccordionComponent } from "./components"
|
|
3
|
+
import { autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, autoScoredStudentViewSettings, commonComponents, correctIncorrectAnswerLabelComponent, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, randomizeOptionsComponent, scoringSectionBaseEditTab, studentViewSettingsLabelComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, enableOuterBorderComponent, styleAndLayoutCustomizationAccordionComponent, showAlternativeAnswersComponent } from "./components"
|
|
4
4
|
import { listOrderingCommonStyleAndLayoutComponent } from "./components/listOrderingCommonStyleAndLayoutComponent";
|
|
5
5
|
import { createItemPage } from "./createItemPage";
|
|
6
6
|
import { dialogBoxBase } from "./dialogBoxBase";
|
|
@@ -20,6 +20,7 @@ const selectors = {
|
|
|
20
20
|
...enableOuterBorderComponent,
|
|
21
21
|
...styleAndLayoutCustomizationAccordionComponent,
|
|
22
22
|
...listOrderingCommonStyleAndLayoutComponent,
|
|
23
|
+
...showAlternativeAnswersComponent,
|
|
23
24
|
//Specify correct answer section
|
|
24
25
|
optionSpecifyCorrectAnswerSection: () => cy.get('.list-ordering-set-correct-answer [class*="AnswerWrapper"][role="button"]'),
|
|
25
26
|
optionTextSpecifyCorrectAnswerSection: () => cy.get('.draggable-item-wrapper[overflow] .question-text-wrapper'),
|
|
@@ -34,7 +35,9 @@ const selectors = {
|
|
|
34
35
|
optionWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .orderlist-option-wrapper, .vertical-list-order .reorder-as-same-list-items [class*="DraggableItemstyles__DraggableItemContainer"]'),
|
|
35
36
|
correctAnswersLabel: () => cy.get('[class*="question-preview-wrapper"] [class*="__CorrectAnswerLabel"]'),
|
|
36
37
|
correctAnswerSectionAnswerWrapper: () => cy.get('[class*="CorrectAnswers"] [class*="__OptionsWrapper"]'),
|
|
38
|
+
correctAnswersSectionWrapper: () => cy.get('[class*="ListOrderingResponsestyles__CorrectAnswers"]'),
|
|
37
39
|
correctAnswerSectionWrapper: () => cy.get('[class*="ListOrderingResponsestyles__CorrectAnswers"]'),
|
|
40
|
+
dropdownMenuWrapper: () => cy.get('.dropdown-menu-wrapper'),
|
|
38
41
|
correctAnswerSectionAnswerText: () => cy.get('.question-text-wrapper'),
|
|
39
42
|
correctAnswerSectionIconWrapper: () => cy.get('[class*="CorrectAnswerstyles__IconWrapper"], .correct-answer-wrapper [class*="DraggableItemstyles__DraggableItemContainer"]'),
|
|
40
43
|
questionBorderPreviewTab: () => cy.get('[class*="ListOrderingResponsestyles__ResponseContainer"]'),
|
|
@@ -155,6 +158,7 @@ const steps = {
|
|
|
155
158
|
...listOrderingCommonStyleAndLayoutComponent.steps,
|
|
156
159
|
...createItemPage.steps,
|
|
157
160
|
...dialogBoxBase.steps,
|
|
161
|
+
...showAlternativeAnswersComponent.steps,
|
|
158
162
|
|
|
159
163
|
/**
|
|
160
164
|
* Verifies the border value of specify correct answer section options
|
|
@@ -959,6 +963,61 @@ const steps = {
|
|
|
959
963
|
});
|
|
960
964
|
},
|
|
961
965
|
|
|
966
|
+
/**
|
|
967
|
+
* @param {string[]} optionsTextArray array of options in the alternative answer section
|
|
968
|
+
* @param {string[]} positionArray array of positions for the alternative answer section
|
|
969
|
+
* @param {number} sectionIndex index of the alternative answer section (1 for first alternative, 2 for second, etc.)
|
|
970
|
+
* @description this function verifies the correct order of options and their positions in alternative answer section
|
|
971
|
+
*/
|
|
972
|
+
verifyOptionsPositionInAlternativeAnswerSection: (sectionIndex, optionsTextArray, positionArray) => {
|
|
973
|
+
listOrderingPage.correctAnswersSectionWrapper()
|
|
974
|
+
.eq(sectionIndex)
|
|
975
|
+
.within(() => {
|
|
976
|
+
// Verify option text content
|
|
977
|
+
optionsTextArray.forEach((optionsText, index) => {
|
|
978
|
+
utilities.getNthElement(listOrderingPage.dropdownMenuWrapper(), index)
|
|
979
|
+
.within(() => {
|
|
980
|
+
utilities.verifyTextContent(cy.get('[data-testid="question-instruction-element"]'), optionsText);
|
|
981
|
+
});
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
// Verify dropdown position values
|
|
985
|
+
positionArray.forEach((position, dropdownIndex) => {
|
|
986
|
+
utilities.getNthElement(listOrderingPage.dropdownMenuWrapper(), dropdownIndex)
|
|
987
|
+
.within(() => {
|
|
988
|
+
utilities.verifyInnerText(listOrderingPage.dropdownSelectedOptionLabel(), position);
|
|
989
|
+
});
|
|
990
|
+
});
|
|
991
|
+
});
|
|
992
|
+
},
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* @param {number} sectionIndex index of the answer section (0 for correct answer, 1 for first alternative, etc.)
|
|
996
|
+
* @param {string[]} optionsTextArray array of options text in the answer section
|
|
997
|
+
* @description this function verifies the correct order of options in correct answer or alternative answer section for "Reorder as separate list" layout
|
|
998
|
+
*/
|
|
999
|
+
verifyOptionsInCorrectAndAlternativeAnswerSection: (sectionIndex, optionsTextArray) => {
|
|
1000
|
+
listOrderingPage.correctAnswersWrapper()
|
|
1001
|
+
.eq(sectionIndex)
|
|
1002
|
+
.within(() => {
|
|
1003
|
+
// Verify each option has correct icon and text content
|
|
1004
|
+
optionsTextArray.forEach((optionsText, index) => {
|
|
1005
|
+
// Verify correct icon exists
|
|
1006
|
+
utilities.getNthElement(listOrderingPage.correctAnswerSectionIconWrapper(), index)
|
|
1007
|
+
.within(() => {
|
|
1008
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
|
|
1009
|
+
});
|
|
1010
|
+
|
|
1011
|
+
// Verify option text content
|
|
1012
|
+
utilities.getNthElement(listOrderingPage.correctAnswerSectionAnswerWrapper(), index)
|
|
1013
|
+
.within(() => {
|
|
1014
|
+
utilities.verifyTextContent(listOrderingPage.correctAnswerSectionAnswerText(), optionsText);
|
|
1015
|
+
});
|
|
1016
|
+
});
|
|
1017
|
+
});
|
|
1018
|
+
},
|
|
1019
|
+
|
|
1020
|
+
|
|
962
1021
|
/**
|
|
963
1022
|
* Verifies the selected option position in the dropdown for the specified dropdown index.
|
|
964
1023
|
* @param {number} dropdownIndex - The index of the dropdown to verify.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import constants from "../fixtures/constants";
|
|
2
2
|
import utilities from "../support/helpers/utilities";
|
|
3
|
-
import { createQuestionBasePage, questionInstructionsComponent, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, draggableOptionContainer, draggableOptionsSectionComponent, correctIncorrectAnswerLabelComponent, maximumCapacityPerDropzoneComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, commonComponents, randomizeOptionsComponent, autoScoredScoringSectionMultiResponseType, allowMultipleInstancesOfSameDraggableOptionComponent, studentViewSettingsLabelComponent, ariaLabelSectionComponent, additionalSettingsAccessibilitySectionComponent, gradingViewEnumerationComponent, additionalSettingsPanel, toolSettingsComponent, styleAndLayoutCustomizationAccordionComponent, connectorStyleStyleAndLayoutCustomizationComponent } from "./components";
|
|
3
|
+
import { createQuestionBasePage, questionInstructionsComponent, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, draggableOptionContainer, draggableOptionsSectionComponent, correctIncorrectAnswerLabelComponent, maximumCapacityPerDropzoneComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, commonComponents, randomizeOptionsComponent, autoScoredScoringSectionMultiResponseType, allowMultipleInstancesOfSameDraggableOptionComponent, studentViewSettingsLabelComponent, ariaLabelSectionComponent, additionalSettingsAccessibilitySectionComponent, gradingViewEnumerationComponent, additionalSettingsPanel, toolSettingsComponent, styleAndLayoutCustomizationAccordionComponent, connectorStyleStyleAndLayoutCustomizationComponent, showAlternativeAnswersComponent } from "./components";
|
|
4
4
|
import { createItemPage } from "./createItemPage";
|
|
5
5
|
const css = Cypress.env('css');
|
|
6
6
|
const options = ['option 1', 'option 2', 'option 3'];
|
|
@@ -26,6 +26,7 @@ const selectors = {
|
|
|
26
26
|
...additionalSettingsPanel,
|
|
27
27
|
...connectorStyleStyleAndLayoutCustomizationComponent,
|
|
28
28
|
...ckEditorToolbar,
|
|
29
|
+
...showAlternativeAnswersComponent,
|
|
29
30
|
//Edit tab
|
|
30
31
|
promptInputField: () => cy.get('.edit-mcq-stems-wrapper [role="textbox"]'),
|
|
31
32
|
promptInputFieldWrapper: () => cy.get('.edit-mcq-stems-wrapper .edit-mcq-option-wrapper'),
|
|
@@ -108,6 +109,7 @@ const selectors = {
|
|
|
108
109
|
correctAnswersNumeration: () => cy.get('.answer-numeration-number-box'),
|
|
109
110
|
correctAnswerResponseWrapper: () => cy.get('[class*="ClozeWithDragAndDropstyles__AnswerCell"]'),
|
|
110
111
|
correctAnswersOptions: () => cy.get('.match-list-drag-and-drop'),
|
|
112
|
+
correctAnswersWrapper: () => cy.get('[class*="ClozeWithDragAndDropstyles__CorrectAnswers"]'),
|
|
111
113
|
correctAnswersOptionContainer: () => cy.get('.draggable-selected-option, .draggable-item'),
|
|
112
114
|
gradingViewOption: () => cy.get('.item-content-wrapper'),
|
|
113
115
|
questionBorderPreviewTab: () => cy.get('[class*="ClozeWithDragAndDropstyles__WrapperDiv"]'),
|
|
@@ -228,6 +230,7 @@ const steps = {
|
|
|
228
230
|
...styleAndLayoutCustomizationAccordionComponent.steps,
|
|
229
231
|
...connectorStyleStyleAndLayoutCustomizationComponent.steps,
|
|
230
232
|
...createItemPage.steps,
|
|
233
|
+
...showAlternativeAnswersComponent.steps,
|
|
231
234
|
//Edit tab
|
|
232
235
|
addPrompt: () => {
|
|
233
236
|
matchingPage.addPromptButton()
|
|
@@ -958,6 +961,25 @@ const steps = {
|
|
|
958
961
|
});
|
|
959
962
|
},
|
|
960
963
|
|
|
964
|
+
/**
|
|
965
|
+
* @param {Array<{label: string, points: string, answers: string[][]}>} alternativeAnswers - Array of alternative answer objects.
|
|
966
|
+
* @description Verifies alternative answer sections with labels, points, enumeration, and answers.
|
|
967
|
+
* Example: verifyAlternativeAnswerSections([{label: 'Alternative answer 1', points: '(10 points)', answers: [['Elephant'], ['Fish'], ['Cat']]}])
|
|
968
|
+
*/
|
|
969
|
+
verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount: (alternativeAnswers = []) => {
|
|
970
|
+
matchingPage.correctAnswersWrapper()
|
|
971
|
+
.eq(1)
|
|
972
|
+
.within(() => {
|
|
973
|
+
utilities.verifyElementCount(matchingPage.correctAnswersOptions(), alternativeAnswers.length);
|
|
974
|
+
alternativeAnswers.forEach((correctAnswer, index) => {
|
|
975
|
+
utilities.verifyTextContent(utilities.getNthElement(matchingPage.correctAnswersNumeration(), index), index + 1);
|
|
976
|
+
correctAnswer.forEach((answerOption) => {
|
|
977
|
+
utilities.verifyTextContent(utilities.getNthElement(matchingPage.correctAnswersOptions(), index), answerOption);
|
|
978
|
+
});
|
|
979
|
+
});
|
|
980
|
+
});
|
|
981
|
+
},
|
|
982
|
+
|
|
961
983
|
/**
|
|
962
984
|
* Verifies correct answer responses in the correct answer section and counts the number of correct answer groups.
|
|
963
985
|
* @param {string[][]} correctAnswerArray - An array of arrays containing correct answer responses for each group.
|