itemengine-cypress-automation 1.0.105 → 1.0.107
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +129 -0
- package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +482 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +123 -0
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +554 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -41
- package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +5 -3
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +284 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +412 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +203 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories2.js +340 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +336 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +253 -0
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +266 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +57 -640
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +1 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +209 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +209 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +303 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingPenaltyScoring.js +68 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsBasic.js +149 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +218 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +191 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +219 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +240 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +107 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/manuallyAndNonScored.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +0 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +408 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +2 -2
- package/cypress/e2e/ILC/MultipleSelection/headerSection.js +1 -0
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +0 -6
- package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +242 -0
- package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +99 -0
- package/cypress/e2e/ILC/Passage/passageEditTab.js +241 -0
- package/cypress/e2e/ILC/Passage/passageHeaderSection.js +73 -0
- package/cypress/e2e/ILC/Passage/passagePreviewTab.js +246 -0
- package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +138 -33
- package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +30 -6
- package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +167 -101
- package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/SingleSelection/headerSection.js +20 -5
- package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +1 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +12 -7
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +1336 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +419 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +443 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +411 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +411 -0
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
- package/cypress/fixtures/specialAndMathCharacters.js +2 -0
- package/cypress/fixtures/theme/ilc.json +4 -2
- package/cypress/pages/audioResponsePage.js +326 -165
- package/cypress/pages/components/additionalSettingsPanel.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +162 -2
- package/cypress/pages/components/colorPopupComponent.js +115 -26
- package/cypress/pages/components/customizeMathCharacterComponent.js +133 -0
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +74 -4
- package/cypress/pages/components/editCategoryFlyout.js +164 -2
- package/cypress/pages/components/equationEditorFlyout.js +36 -1
- package/cypress/pages/components/essayResponseCommonComponents.js +0 -2
- package/cypress/pages/components/figOverImageCanvasComponent.js +587 -134
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/playbackControlsBaseComponent.js +137 -2
- package/cypress/pages/correctAnswerViewPage.js +12 -1
- package/cypress/pages/drawingResponsePage.js +26 -151
- package/cypress/pages/essayResponseMathPage.js +28 -16
- package/cypress/pages/essayResponsePage.js +187 -7
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +78 -14
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +178 -221
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +79 -0
- package/cypress/pages/multipleSelectionPage.js +1 -1
- package/cypress/pages/readingRulerPage.js +219 -104
- package/cypress/pages/singleSelectionPage.js +1 -0
- package/cypress/pages/textEntryMathPage.js +17 -6
- package/cypress/pages/videoResponsePage.js +0 -8
- package/package.json +1 -1
- package/scripts/sorry-cypress.mjs +1 -1
@@ -0,0 +1,219 @@
|
|
1
|
+
import { fillInTheGapsOverImageDropdownPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
7
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
8
|
+
const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answer
|
9
|
+
const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
|
10
|
+
const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
|
11
|
+
const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
|
12
|
+
|
13
|
+
describe('Create item page - Fill in the gaps over image with dropdown: Partial equal weights with alternative answers', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
describe('Question preview: Auto scored - Partial equal weights with alternative answer - When \'Correct answer\' points are more than \'Alternate answer\' points', () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
cy.log('Navigate to fill in the gaps over image - dropdown question type');
|
22
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
23
|
+
cy.barsPreLoaderWait();
|
24
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
25
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
26
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
27
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
28
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(80);
|
29
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
30
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
31
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(2, optionsForDropdown3);
|
32
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(15);
|
33
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
34
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
35
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, correctAnswerArray[2]);
|
36
|
+
fillInTheGapsOverImageDropdownPage.steps.addAlternativeAnswerAccordion(1);
|
37
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
|
38
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
|
39
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, alternateAnswerArray[2]);
|
40
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(9);
|
41
|
+
fillInTheGapsOverImageDropdownPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
|
42
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
43
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
44
|
+
});
|
45
|
+
|
46
|
+
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', () => {
|
47
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
48
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
49
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswersLabel(), 'Correct answers');
|
50
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
51
|
+
});
|
52
|
+
|
53
|
+
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, correct/incorrect status message should not be displayed and correct answer section should not be displayed', () => {
|
54
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
55
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
|
56
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(15, 15);
|
57
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
58
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
59
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
|
60
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
|
61
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
62
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
63
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
64
|
+
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, correct/incorrect status message should not be displayed and correct answer section should not be displayed');
|
65
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
|
66
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
67
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
|
68
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
|
69
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
70
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
71
|
+
});
|
72
|
+
|
73
|
+
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, correct/incorrect status message should not be displayed and correct answer section should not be displayed', () => {
|
74
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
75
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
|
76
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(9, 15);
|
77
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
78
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
79
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
|
80
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
|
81
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
82
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
83
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
84
|
+
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, correct/incorrect status message should not be displayed and correct answer section should not be displayed');
|
85
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
|
86
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
87
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
|
88
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
|
89
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
90
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
91
|
+
});
|
92
|
+
|
93
|
+
it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
94
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
95
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }]);
|
96
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(5, 15);
|
97
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
98
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
99
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
100
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
101
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
102
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
103
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
104
|
+
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, correct/incorrect status message should not be displayed and correct answer section should not be displayed');
|
105
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
|
106
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
107
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
108
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
109
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
110
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
111
|
+
});
|
112
|
+
|
113
|
+
it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
114
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
115
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }]);
|
116
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(3, 15);
|
117
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
118
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
119
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
120
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
121
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
122
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
123
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
124
|
+
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, correct/incorrect status message should not be displayed and correct answer section should not be displayed');
|
125
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
|
126
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
127
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
128
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
129
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
130
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
131
|
+
});
|
132
|
+
|
133
|
+
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 points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed beside alternative accordion responses, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
134
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
135
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }]);
|
136
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(5, 15);
|
137
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
138
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
139
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
140
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
141
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
142
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
143
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
144
|
+
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, correct icon should be displayed besides the correctly answered dropdowns, incorrect icon should be displayed beside alternative accordion responses, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
145
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
|
146
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
147
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
148
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
149
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
150
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
151
|
+
});
|
152
|
+
|
153
|
+
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 points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be besides the common response, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
154
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
155
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
|
156
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(5, 15);
|
157
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
158
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
159
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
160
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
|
161
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
162
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
163
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
164
|
+
cy.log('When the user has attempted the question with common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correctly answered dropdown, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
165
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
|
166
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
167
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
168
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
|
169
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
170
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
171
|
+
});
|
172
|
+
|
173
|
+
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
174
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
175
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
176
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 15);
|
177
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
178
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
179
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
180
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
181
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
182
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
183
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
184
|
+
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 dropdowns, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
185
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
|
186
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
187
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
188
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
189
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
190
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
191
|
+
});
|
192
|
+
|
193
|
+
it('Overachiever case: When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response from the correct accordion overpowers the combined score of the alternative accordion answers then on switching to the \'Grading view\', then points awarded should be of the correct accordion, correct icons should be displayed for the correct accordion response, incorrect icon should be displayed for the alternative accordion responses, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
|
194
|
+
cy.log('Pre-step: Switching to Edit tab and allotting points to alternative accordion such that the difference between the points is substantial and there are no common responses between the two accordions')
|
195
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToEditTab();
|
196
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, optionsForDropdown3[3]);
|
197
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(5);
|
198
|
+
fillInTheGapsOverImageDropdownPage.steps.expandCorrectAnswerAccordion();
|
199
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(23);
|
200
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
201
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
|
202
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(7.67, 23);
|
203
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
204
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
205
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
206
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
|
207
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
208
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
209
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
210
|
+
cy.log('When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response from the correct accordion overpowers the combined score of the alternative accordion answers and clicks on the \'Check answer\' button, correct icons should be displayed beside correct accordion responses, incorrect icons should be displayed beside alternative accordion responses, correct/incorrect answer label, correct answer container should not be displayed')
|
211
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
|
212
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
213
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
214
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
|
215
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
216
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
217
|
+
});
|
218
|
+
});
|
219
|
+
});
|
@@ -0,0 +1,240 @@
|
|
1
|
+
import { dialogBoxBase, fillInTheGapsOverImageDropdownPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const grepTags = Cypress.env('grepTags');
|
5
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
6
|
+
const views = utilities.getViews(correctAnswerViews);
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
9
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
10
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
11
|
+
const correctAnswerArray = ['Flower', 'Leaf'];
|
12
|
+
const incorrectAnswerArray = ['Branch', 'Seed'];
|
13
|
+
|
14
|
+
describe('Create item page - Fill in the gaps over image - dropdown: All or nothing ', () => {
|
15
|
+
before(() => {
|
16
|
+
cy.loginAs('admin');
|
17
|
+
});
|
18
|
+
|
19
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
20
|
+
describe('Question preview modes: Student view and Grading view', () => {
|
21
|
+
abortEarlySetup();
|
22
|
+
before(() => {
|
23
|
+
cy.log('Navigate to fill in the gaps over image - dropdown question type');
|
24
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
25
|
+
cy.barsPreLoaderWait();
|
26
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
27
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
28
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
29
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
30
|
+
});
|
31
|
+
|
32
|
+
|
33
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet();
|
34
|
+
|
35
|
+
it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
|
36
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToEditTab();
|
37
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
38
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
39
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
40
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
41
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 20);
|
42
|
+
});
|
43
|
+
|
44
|
+
it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab, users response should not persist', () => {
|
45
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }]);
|
46
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
47
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyTextDisplayedInDropdownPreviewTab(0, '');
|
48
|
+
});
|
49
|
+
});
|
50
|
+
};
|
51
|
+
|
52
|
+
views.forEach((view) => {
|
53
|
+
describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
|
54
|
+
abortEarlySetup();
|
55
|
+
before(() => {
|
56
|
+
switch (view) {
|
57
|
+
case 'Question preview':
|
58
|
+
cy.log('Navigate to fill in the gaps over image - dropdown question type');
|
59
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
60
|
+
cy.barsPreLoaderWait();
|
61
|
+
fillInTheGapsOverImageDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
62
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
63
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
64
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
65
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
66
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
67
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
68
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
69
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
70
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
71
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
72
|
+
break;
|
73
|
+
case 'Item preview':
|
74
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
75
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
76
|
+
break;
|
77
|
+
case 'Grading view':
|
78
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
79
|
+
break;
|
80
|
+
};
|
81
|
+
});
|
82
|
+
|
83
|
+
beforeEach(() => {
|
84
|
+
switch (view) {
|
85
|
+
case 'Question preview':
|
86
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
87
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
88
|
+
break;
|
89
|
+
case 'Item preview':
|
90
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
91
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
92
|
+
break;
|
93
|
+
case 'Grading view':
|
94
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
95
|
+
break;
|
96
|
+
}
|
97
|
+
});
|
98
|
+
|
99
|
+
if (view === 'Question preview') {
|
100
|
+
after(() => {
|
101
|
+
fillInTheGapsOverImageDropdownPage.steps.clickOnSaveQuestionButton();
|
102
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
103
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
104
|
+
});
|
105
|
+
};
|
106
|
+
|
107
|
+
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
108
|
+
if (view === 'Grading view') {
|
109
|
+
studentViewPage.steps.submitResponse();
|
110
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
111
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
112
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
113
|
+
};
|
114
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
115
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 20);
|
116
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
117
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
118
|
+
};
|
119
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
120
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswersLabel(), 'Correct answers');
|
121
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
122
|
+
});
|
123
|
+
|
124
|
+
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', () => {
|
125
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
126
|
+
if (view === 'Grading view') {
|
127
|
+
studentViewPage.steps.submitResponse();
|
128
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
129
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
130
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
131
|
+
};
|
132
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
133
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 20);
|
134
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
135
|
+
};
|
136
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
137
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
138
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
139
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When the user attempts the question partially correct, 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', () => {
|
143
|
+
if (view === 'Grading view') {
|
144
|
+
studentViewPage.steps.clearResponses();
|
145
|
+
};
|
146
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
147
|
+
if (view === 'Grading view') {
|
148
|
+
studentViewPage.steps.submitResponse();
|
149
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
150
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
151
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
152
|
+
};
|
153
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
154
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 20);
|
155
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
156
|
+
};
|
157
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
158
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
159
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
160
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
161
|
+
});
|
162
|
+
|
163
|
+
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', () => {
|
164
|
+
if (view === 'Grading view') {
|
165
|
+
studentViewPage.steps.clearResponses();
|
166
|
+
};
|
167
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
|
168
|
+
if (view === 'Grading view') {
|
169
|
+
studentViewPage.steps.submitResponse();
|
170
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
171
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
172
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
173
|
+
};
|
174
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
175
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(20, 20);
|
176
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
177
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
178
|
+
};
|
179
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
180
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
|
181
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
182
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
183
|
+
});
|
184
|
+
});
|
185
|
+
});
|
186
|
+
|
187
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
188
|
+
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
189
|
+
abortEarlySetup();
|
190
|
+
before(() => {
|
191
|
+
cy.log('Navigate to fill in the gaps over image - dropdown question type');
|
192
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
193
|
+
cy.barsPreLoaderWait();
|
194
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
195
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
196
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
197
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
198
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
199
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
200
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
201
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
202
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
203
|
+
});
|
204
|
+
|
205
|
+
it('When the user selects \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with minimum points', () => {
|
206
|
+
fillInTheGapsOverImageDropdownPage.steps.expandMinimumScoringDropdown();
|
207
|
+
fillInTheGapsOverImageDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
208
|
+
fillInTheGapsOverImageDropdownPage.steps.allotMinimumPoints(2);
|
209
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
210
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
211
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(2, 20);
|
212
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
213
|
+
});
|
214
|
+
|
215
|
+
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
216
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
217
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
218
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(2, 20);
|
219
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
220
|
+
});
|
221
|
+
|
222
|
+
it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with 0 points', () => {
|
223
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToEditTab();
|
224
|
+
fillInTheGapsOverImageDropdownPage.steps.expandMinimumScoringDropdown();
|
225
|
+
fillInTheGapsOverImageDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
226
|
+
fillInTheGapsOverImageDropdownPage.steps.allotMinimumPoints(2);
|
227
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
228
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
229
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 20);
|
230
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
231
|
+
});
|
232
|
+
|
233
|
+
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
234
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
235
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
236
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(2, 20);
|
237
|
+
});
|
238
|
+
});
|
239
|
+
};
|
240
|
+
});
|
@@ -0,0 +1,124 @@
|
|
1
|
+
import { fillInTheGapsOverImageDropdownPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
var itemReferenceID = "";
|
5
|
+
const checkAnswerViews = ['Question preview', 'Item preview', 'Student view'];
|
6
|
+
const views = utilities.getViews(checkAnswerViews);
|
7
|
+
|
8
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
9
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
10
|
+
const correctAnswerArray = ['Flower', 'Leaf'];
|
11
|
+
const incorrectAnswerArray = ['Branch', 'Seed'];
|
12
|
+
|
13
|
+
describe('Create item page - Fill in the gaps over image - dropdown - Check answer functionality', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
views.forEach((view) => {
|
19
|
+
//Note: Remove after https://redmine.zeuslearning.com/issues/549542 is fixed
|
20
|
+
const checkAnswer = (view) => {
|
21
|
+
switch (view) {
|
22
|
+
case 'Question preview':
|
23
|
+
case 'Item preview':
|
24
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
|
25
|
+
break;
|
26
|
+
case 'Student view':
|
27
|
+
studentViewPage.steps.checkAnswer();
|
28
|
+
break;
|
29
|
+
default:
|
30
|
+
throw new Error(`Unsupported page identifier: ${view}`);
|
31
|
+
}
|
32
|
+
};
|
33
|
+
|
34
|
+
describe(`${view} - Check answer functionality`, { tags: 'smoke' }, () => {
|
35
|
+
abortEarlySetup();
|
36
|
+
before(() => {
|
37
|
+
switch (view) {
|
38
|
+
case 'Question preview':
|
39
|
+
cy.log('Navigate to fill in the gaps over image - dropdown question type');
|
40
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
41
|
+
cy.barsPreLoaderWait();
|
42
|
+
fillInTheGapsOverImageDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
43
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
44
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
45
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
46
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
47
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
48
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
49
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
50
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
51
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
52
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
53
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
54
|
+
break;
|
55
|
+
case 'Item preview':
|
56
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
57
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
58
|
+
break;
|
59
|
+
case 'Student view':
|
60
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
61
|
+
break;
|
62
|
+
}
|
63
|
+
});
|
64
|
+
|
65
|
+
beforeEach(() => {
|
66
|
+
switch (view) {
|
67
|
+
case 'Question preview':
|
68
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
69
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
70
|
+
break;
|
71
|
+
case 'Item preview':
|
72
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
73
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
74
|
+
break;
|
75
|
+
case 'Student view':
|
76
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
77
|
+
break;
|
78
|
+
}
|
79
|
+
});
|
80
|
+
|
81
|
+
if (view === 'Question preview') {
|
82
|
+
after(() => {
|
83
|
+
fillInTheGapsOverImageDropdownPage.steps.clickOnSaveQuestionButton();
|
84
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
85
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
86
|
+
});
|
87
|
+
};
|
88
|
+
|
89
|
+
it('When the user selects \'Check answer\' button without attempting the question, then correct/incorrect icons, correct/incorrect answer status message and correct answer section should not be displayed', () => {
|
90
|
+
checkAnswer(view);
|
91
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconsNotExist();
|
92
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
93
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
94
|
+
});
|
95
|
+
|
96
|
+
it('When the user attempts the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
|
97
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
98
|
+
checkAnswer(view);
|
99
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
100
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
101
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
102
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
103
|
+
});
|
104
|
+
|
105
|
+
it('When the user attempts the question partially correct and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, correct icons should be displayed besides correct responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
|
106
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
107
|
+
checkAnswer(view);
|
108
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
109
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
110
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
111
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
112
|
+
});
|
113
|
+
|
114
|
+
it('When user attempts the question correctly, and clicks on \'Check answer\' button, then correct icons should be displayed besides correct responses, a status message with text \'Your answer is correct\' should be displayed. Correct answer section should not be displayed', () => {
|
115
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
|
116
|
+
checkAnswer(view);
|
117
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
118
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
|
119
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
120
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
121
|
+
});
|
122
|
+
});
|
123
|
+
});
|
124
|
+
});
|