itemengine-cypress-automation 1.0.129 → 1.0.131-updateILCrepo6March-02c78d1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +210 -0
- package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +91 -0
- package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +392 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +2 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -1
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +152 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +196 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +195 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +288 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/manuallyAndNonScored.js +141 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +245 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +413 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +218 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +245 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +163 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +196 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +83 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +653 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +180 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabScoringSection.js +229 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +90 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/switchingCasesBetweenOptionsLayout.js +50 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +204 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +204 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +298 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingPenaltyScoring.js +63 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +111 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +231 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsBasic.js +90 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +232 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +231 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsBasic.js +138 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +213 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +186 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +161 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +328 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +144 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabScoringSection.js +250 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +75 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +74 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +188 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +8 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +4 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +1 -52
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +3 -211
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +39 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -50
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +325 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +1 -146
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +78 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +265 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +75 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/responseAnswersAndAcceptedStudentInput.js +56 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +40 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +249 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +64 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +128 -0
- package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +889 -0
- package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +168 -0
- package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +203 -0
- package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +222 -0
- package/cypress/e2e/ILC/SimpleCalculator/calculatorFunctionality.js +349 -0
- package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +132 -0
- package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +35 -7
- package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +213 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +41 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +377 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +161 -0
- package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +250 -0
- package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
- package/cypress/fixtures/theme/ilc.json +6 -1
- package/cypress/fixtures/uploadResponseFileType.js +5 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +13 -13
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +24 -6
- package/cypress/pages/components/draggableOptionContainer.js +1 -0
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +42 -4
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +149 -5
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +954 -77
- package/cypress/pages/components/questionInputFieldComponent.js +1 -1
- package/cypress/pages/components/questionInstructionsComponent.js +2 -1
- package/cypress/pages/contentBlocksPage.js +515 -0
- package/cypress/pages/drawingResponsePage.js +2 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +359 -3
- package/cypress/pages/fillInTheGapsDropdownPage.js +21 -1
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +5 -57
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -24
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -435
- package/cypress/pages/fillInTheGapsTextPage.js +9 -2
- package/cypress/pages/graphingPage.js +484 -0
- package/cypress/pages/index.js +4 -1
- package/cypress/pages/simpleCalculatorPage.js +310 -0
- package/cypress/pages/uploadResponsePage.js +260 -92
- package/package.json +2 -2
- package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +0 -242
- package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +0 -99
- package/cypress/e2e/ILC/Passage/passageEditTab.js +0 -241
- package/cypress/e2e/ILC/Passage/passageHeaderSection.js +0 -73
- package/cypress/e2e/ILC/Passage/passagePreviewTab.js +0 -246
@@ -0,0 +1,298 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage } from "../../../../pages";
|
2
|
+
import { commonComponents } from "../../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
8
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
9
|
+
const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answer
|
10
|
+
const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
|
11
|
+
const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
|
12
|
+
const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
|
13
|
+
|
14
|
+
describe('Create item page - Fill in the gaps with dropdown: All or nothing with alternative answers', () => {
|
15
|
+
before(() => {
|
16
|
+
cy.loginAs('admin');
|
17
|
+
});
|
18
|
+
|
19
|
+
describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Correct answer\' points are more than \'Alternate answer\' points', () => {
|
20
|
+
abortEarlySetup();
|
21
|
+
before(() => {
|
22
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
23
|
+
cy.barsPreLoaderWait();
|
24
|
+
fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
|
25
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
26
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
27
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(2, optionsForDropdown3);
|
28
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
29
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
30
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
31
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, correctAnswerArray[2]);
|
32
|
+
fillInTheGapsDropdownPage.steps.addAlternativeAnswerAccordion(1);
|
33
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
|
34
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
|
35
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, alternateAnswerArray[2]);
|
36
|
+
fillInTheGapsDropdownPage.steps.allotPoints(10);
|
37
|
+
fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
38
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
39
|
+
});
|
40
|
+
|
41
|
+
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers from the correct accordion and respective dropdown numeration', () => {
|
42
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
43
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
44
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.correctAnswersLabel(), 'Correct answers');
|
45
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
46
|
+
});
|
47
|
+
|
48
|
+
it('CSS of correct answer section and dropdown numeration', { tags: 'css' }, () => {
|
49
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctAnswersLabel(), {
|
50
|
+
'color': css.color.sectionHeading,
|
51
|
+
'font-size': css.fontSize.default,
|
52
|
+
'font-weight': css.fontWeight.bold
|
53
|
+
});
|
54
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownNumerationPreviewTab(), {
|
55
|
+
'background-color': css.color.defaultBackground,
|
56
|
+
'border': `1px solid ${css.color.activeComponentBorder}`
|
57
|
+
});
|
58
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctAnswerResponse(), {
|
59
|
+
'color': css.color.text,
|
60
|
+
'font-size': css.fontSize.default,
|
61
|
+
'font-weight': css.fontWeight.regular,
|
62
|
+
'border': `1px solid ${css.color.correctOptionBorder}`
|
63
|
+
});
|
64
|
+
});
|
65
|
+
|
66
|
+
it('Accessibility of correct answer section and dropdown numeration', { tags: 'a11y' }, () => {
|
67
|
+
cy.checkAccessibility(commonComponents.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 dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
|
71
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
72
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
|
73
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(20, 20);
|
74
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
75
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
76
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
77
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
78
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
79
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
80
|
+
fillInTheGapsDropdownPage.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 dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed');
|
82
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
83
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
84
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
85
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
86
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
87
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
88
|
+
});
|
89
|
+
|
90
|
+
it('CSS of Correct answer state', { tags: 'css' }, () => {
|
91
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.previewScoreText(), {
|
92
|
+
'color': css.color.whiteText,
|
93
|
+
'background-color': css.color.correctAnswer
|
94
|
+
});
|
95
|
+
fillInTheGapsDropdownPage.correctIcon()
|
96
|
+
.verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
|
97
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctIncorrectAnswerBlock(), {
|
98
|
+
'background-color': css.color.correctAnswerLabelBg,
|
99
|
+
'border': `1px solid ${css.color.correctAnswer}`
|
100
|
+
});
|
101
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctIncorrectStatusMessageText(), {
|
102
|
+
'color': css.color.text,
|
103
|
+
'font-size': css.fontSize.default,
|
104
|
+
'font-weight': css.fontWeight.regular
|
105
|
+
});
|
106
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctIncorrectAnswerLabel(), {
|
107
|
+
'color': css.color.text,
|
108
|
+
'font-size': css.fontSize.default,
|
109
|
+
'font-weight': css.fontWeight.bold
|
110
|
+
});
|
111
|
+
});
|
112
|
+
|
113
|
+
it('Accessibility of correct answer state', { tags: 'a11y' }, () => {
|
114
|
+
cy.checkAccessibility(commonComponents.previewTabQuestionWrapper());
|
115
|
+
});
|
116
|
+
|
117
|
+
it('When the user attempts the question with alternative accordion responses, 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 dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
|
118
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
119
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
|
120
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(10, 20);
|
121
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
122
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
123
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
124
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
125
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
126
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
127
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
128
|
+
cy.log('When the user has attempted the question with alternative accordion response and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed');
|
129
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
130
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
131
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
132
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
133
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
134
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
135
|
+
});
|
136
|
+
|
137
|
+
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 dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
138
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
139
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }]);
|
140
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
141
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
142
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
143
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
144
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
145
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
146
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
147
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
148
|
+
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 dropdowns, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
149
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
150
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
151
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
152
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
153
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
154
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
155
|
+
});
|
156
|
+
|
157
|
+
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 dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
158
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
159
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }]);
|
160
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
161
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
162
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
163
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
164
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
165
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
166
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
167
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
168
|
+
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 dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
169
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
170
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
171
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
172
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
173
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
174
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
175
|
+
});
|
176
|
+
|
177
|
+
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 correct dropdown, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
178
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
179
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }]);
|
180
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
181
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
182
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
183
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
184
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
185
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
186
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
187
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
188
|
+
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 correct accordion response, incorrect icon should be displayed besides the alternative accordion response and no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
189
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
190
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
191
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
192
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
193
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
194
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
195
|
+
});
|
196
|
+
|
197
|
+
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, correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed beside alternative accordion responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
198
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
199
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }]);
|
200
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
201
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
202
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
203
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
204
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
205
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
206
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
207
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
208
|
+
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 correctly answered dropdowns, incorrect icon should be displayed beside alternative accordion responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
209
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
210
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
211
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
212
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
213
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
214
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
215
|
+
});
|
216
|
+
|
217
|
+
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, correct icon should be besides the common response, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
218
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
219
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
|
220
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
221
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
222
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
223
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
224
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
225
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
226
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
227
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
228
|
+
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 correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
229
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
230
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
231
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
232
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
233
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
234
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
235
|
+
});
|
236
|
+
|
237
|
+
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 dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with dropdown numeration should be displayed', () => {
|
238
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
239
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }]);
|
240
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
241
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
242
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
243
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
244
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
245
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
246
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
247
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
248
|
+
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 dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
249
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
250
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
251
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
252
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
253
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
254
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
255
|
+
});
|
256
|
+
|
257
|
+
it('CSS of incorrect answer state', { tags: 'css' }, () => {
|
258
|
+
fillInTheGapsDropdownPage.incorrectIcon()
|
259
|
+
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
260
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctIncorrectAnswerBlock(), {
|
261
|
+
'background-color': css.color.incorrectAnswerLabelBg,
|
262
|
+
'border': `1px solid ${css.color.incorrectAnswer}`
|
263
|
+
});
|
264
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctIncorrectStatusMessageText(), {
|
265
|
+
'color': css.color.text,
|
266
|
+
'font-size': css.fontSize.default,
|
267
|
+
'font-weight': css.fontWeight.regular
|
268
|
+
});
|
269
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctIncorrectAnswerLabel(), {
|
270
|
+
'color': css.color.text,
|
271
|
+
'font-size': css.fontSize.default,
|
272
|
+
'font-weight': css.fontWeight.bold
|
273
|
+
});
|
274
|
+
});
|
275
|
+
|
276
|
+
it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
|
277
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.previewTabQuestionWrapper());
|
278
|
+
});
|
279
|
+
|
280
|
+
it('When the user sets \'Award minimum score only if attempted\' in minimum scoring dropdown and allots minimum points such that minimum points are less than alternative answer points, then attempts the question with responses from the alternative accordion, the user should be awarded with alternative answer points', () => {
|
281
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
282
|
+
fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
|
283
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
284
|
+
fillInTheGapsDropdownPage.steps.allotMinimumPoints(3);
|
285
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
286
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
|
287
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(10, 20);
|
288
|
+
});
|
289
|
+
|
290
|
+
it('When the user sets minimum points such that minimum points are greater than alternative answer points, then attempts the question with responses from the alternative accordion, the user should be awarded with minimum points', () => {
|
291
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
292
|
+
fillInTheGapsDropdownPage.steps.allotMinimumPoints(13);
|
293
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
294
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
|
295
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(13, 20);
|
296
|
+
});
|
297
|
+
});
|
298
|
+
});
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
5
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
6
|
+
const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots'];
|
7
|
+
const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
|
8
|
+
const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
|
9
|
+
|
10
|
+
describe('Create item page - Fill in the gaps with dropdown: All or nothing with alternative answers', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('Question preview: Auto scored - All or nothing: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
|
21
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
22
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
23
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(2, optionsForDropdown3);
|
24
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
25
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
26
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
27
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, correctAnswerArray[2]);
|
28
|
+
});
|
29
|
+
|
30
|
+
//Penalty points for the entire question
|
31
|
+
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', () => {
|
32
|
+
fillInTheGapsDropdownPage.steps.expandPenaltyScoringDropdown();
|
33
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
|
34
|
+
fillInTheGapsDropdownPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
|
35
|
+
fillInTheGapsDropdownPage.steps.allotPenaltyPoints(2);
|
36
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
37
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }]);
|
38
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(-2, 20);
|
39
|
+
});
|
40
|
+
|
41
|
+
it('When the user attempts the question partially correct along with an incorrect response, then penalty points should get deducted from the awarded points', () => {
|
42
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
43
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
44
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(-2, 20);
|
45
|
+
});
|
46
|
+
|
47
|
+
it('When the user attempts the question correctly along with multiple incorrect responses, then penalty points should get deducted from the awarded points only once, the deducted penalty points should not increase as per number of attempted incorrect responses', () => {
|
48
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
49
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: incorrectAnswerArray[2] }]);
|
50
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(-2, 20);
|
51
|
+
});
|
52
|
+
|
53
|
+
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', () => {
|
54
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
55
|
+
fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
|
56
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
57
|
+
fillInTheGapsDropdownPage.steps.allotMinimumPoints(3);
|
58
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
59
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }]);
|
60
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(3, 20);
|
61
|
+
});
|
62
|
+
});
|
63
|
+
});
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
6
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
7
|
+
const correctAnswerArray = ['Flower', 'Leaf'];
|
8
|
+
const incorrectAnswerArray = ['Branch', 'Seed'];
|
9
|
+
|
10
|
+
describe('Create Item page - Fill in the gaps with dropdown: Manually and non scored', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('Question Preview: Manually Scored', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
fillInTheGapsDropdownPage.steps.addTextInQuestionInstructionsInputField('fill in the gaps');
|
21
|
+
fillInTheGapsDropdownPage.steps.expandScoringTypeDropdown();
|
22
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
23
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
24
|
+
});
|
25
|
+
|
26
|
+
it('Question instructions, question preview and response areas should be displayed in the preview tab', () => {
|
27
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionInstructionsTextPreviewTab('fill in the gaps');
|
28
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.questionContainerPreviewTab(), 'Lorem ipsum dolor sit amet, \n\n\nonsectetur adipiscing elit. Ut pellentesque tinciduntornare. Integer porttitor est quis urna porttitor, eget tempus tellus dapibus \n\n')
|
29
|
+
utilities.verifyElementCount(fillInTheGapsDropdownPage.dropdownPreviewTab(), 2);
|
30
|
+
fillInTheGapsDropdownPage.steps.verifyTextInDropdownsInPreviewTab([{ dropdownIndex: 0, dropdownText: '' }, { dropdownIndex: 1, dropdownText: '' }]);
|
31
|
+
});
|
32
|
+
|
33
|
+
fillInTheGapsDropdownPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored');
|
34
|
+
});
|
35
|
+
|
36
|
+
describe('Question Preview: Non Scored', () => {
|
37
|
+
abortEarlySetup();
|
38
|
+
before(() => {
|
39
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
40
|
+
cy.barsPreLoaderWait();
|
41
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
42
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
43
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
44
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
45
|
+
fillInTheGapsDropdownPage.steps.expandScoringTypeDropdown();
|
46
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
47
|
+
fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
48
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
49
|
+
});
|
50
|
+
|
51
|
+
fillInTheGapsDropdownPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
|
52
|
+
|
53
|
+
it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed and the correct answer section should be displayed with correct answers', () => {
|
54
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
55
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
56
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
57
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
58
|
+
fillInTheGapsDropdownPage.steps.switchToStudentView();
|
59
|
+
});
|
60
|
+
|
61
|
+
it('When the user attempts the question incorrectly and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect dropdowns, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
62
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
63
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
64
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
65
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
66
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
67
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
68
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
69
|
+
cy.log('When user clicks on Check answer button after he attempts the question incorrectly incorrect icons should be displayed besides all incorrect dropdowns, status message \'Your answer is incorrect\' should be displayed and correct answer section should not be displayed')
|
70
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
71
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
72
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
73
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
74
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
75
|
+
});
|
76
|
+
|
77
|
+
it('When the user attempts the question partially correct, then on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, incorrect icon should be displayed besides incorrect dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
78
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
79
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
80
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
81
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
82
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
83
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
84
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
85
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
86
|
+
cy.log('When user clicks on Check answer button after he attempts the question partially correct, correct icon should be displayed besides the correct dropdowns, incorrect icon should be displayed besides incorrect dropdown, status message \'Your answer is incorrect\' should be displayed and correct answer section should not be displayed')
|
87
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
88
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
89
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
90
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
91
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
92
|
+
});
|
93
|
+
|
94
|
+
it('When user attempts the question correctly, on switching to \'Grading\' view, then correct icons should be displayed beside all the correct dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
|
95
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
96
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
|
97
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
98
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
99
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
100
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
101
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
102
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
103
|
+
cy.log('When user clicks on Check answer button after he attempts the question correctly, then correct icon should be displayed besides the correct dropdowns, status message \'Your answer is correct\' should be displayed and correct answer section should not be displayed')
|
104
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
105
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
106
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
107
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
108
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
109
|
+
});
|
110
|
+
});
|
111
|
+
});
|