itemengine-cypress-automation 1.0.155-migrationScripts-86e4c95.0 → 1.0.156-01AprilFixes-fc21452.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/DesmosGraphing/additionalSettings.js +5 -5
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +2 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +4 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionMinimumAndPenaltyScoring.js +1 -1
- package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +6 -6
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +2 -3
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +34 -29
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +2 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +4 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +2 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/minimumScoringPenaltyPointsAndRoundingDropdown.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsForDropdowns.js +7 -7
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +20 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +4 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +5 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +4 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +5 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsForAnswerInputFields.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +4 -3
- package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +0 -8
- package/cypress/e2e/ILC/GeogebraActivity/additionalSettings.js +1 -1
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +39 -35
- package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +1 -1
- package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +8 -6
- package/cypress/e2e/ILC/GridFill/customizeLayoutFillColor.js +475 -0
- package/cypress/e2e/ILC/GridFill/customizeLayoutFillImageBackgroundImage.js +669 -0
- package/cypress/e2e/ILC/GridFill/customizeLayoutSectionShadeCellsGridBorders.js +1 -1
- package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +0 -11
- package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +204 -0
- package/cypress/e2e/ILC/GridFill/gridLayoutEditTabFunctionality.js +229 -0
- package/cypress/e2e/ILC/GridFill/gridLayoutPreviewTabFunctionality.js +219 -0
- package/cypress/e2e/ILC/GridFill/minimumScoringPenaltyPointsAndRoundingDropdown.js +2 -0
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +0 -2
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
- package/cypress/e2e/ILC/Matching/draggableOptions.js +1 -1
- package/cypress/e2e/ILC/Matching/headerSection.js +82 -0
- package/cypress/e2e/ILC/Matching/specifyCorrectAnswerSection.js +93 -0
- package/cypress/e2e/ILC/MultipleSelection/blockCreateItem.js +2 -2
- package/cypress/e2e/ILC/MultipleSelection/editTabScoringSection.js +3 -0
- package/cypress/e2e/ILC/MultipleSelection/minimumScoringPenaltyPointsAndRoundingDropdown.js +1 -1
- package/cypress/e2e/ILC/MultipleSelection/multipleSelectionBasicAccessibility.js +8 -10
- package/cypress/e2e/ILC/MultipleSelection/specifyCorrectAnswerSection.js +3 -3
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +16 -25
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/manuallyAndNonScored.js +140 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +403 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +363 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +393 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +377 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialEqualWeightsBasic.js +1 -1
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +341 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +373 -0
- package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +0 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +27 -8
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +15 -34
- package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +13 -15
- package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +4 -4
- package/cypress/e2e/ILC/SimpleCalculator/editTabFunctionality.js +4 -2
- package/cypress/e2e/ILC/SingleSelection/blockCreateItem.js +2 -2
- package/cypress/e2e/ILC/SingleSelection/specifyCorrectAnswerSection.js +3 -3
- package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +183 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +185 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +263 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/manuallyAndNonScored.js +140 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +233 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +205 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +233 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +214 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsBasic.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +183 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +213 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +21 -17
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +25 -25
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +20 -17
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -2
- package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +2 -3
- package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +3 -3
- package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +2 -2
- package/cypress/fixtures/fillColorDefaultProperties.js +35 -0
- package/cypress/fixtures/theme/ilc.json +2 -1
- package/cypress/fixtures/uploads/sampleVirus.zip +0 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
- package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +4 -1
- package/cypress/pages/components/colorPopupComponent.js +6 -3
- package/cypress/pages/components/commonComponents.js +1 -1
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +4 -3
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +47 -12
- package/cypress/pages/components/gridQuestionCommonComponent.js +0 -81
- package/cypress/pages/components/imageCanvasComponent.js +10 -8
- package/cypress/pages/components/listSortingAndOrderingBase.js +1 -1
- package/cypress/pages/components/questionInputFieldComponent.js +1 -1
- package/cypress/pages/components/questionInstructionsComponent.js +1 -1
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +1 -1
- package/cypress/pages/essayResponsePage.js +4 -4
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +34 -23
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +0 -1
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +26 -4
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +0 -29
- package/cypress/pages/graphingPage.js +26 -16
- package/cypress/pages/gridFillPage.js +1610 -90
- package/cypress/pages/matchingPage.js +164 -20
- package/cypress/pages/multipleSelectionGridPage.js +82 -2
- package/cypress/pages/multipleSelectionPage.js +7 -2
- package/cypress/pages/rulerPage.js +3 -8
- package/cypress/pages/shortTextResponsePage.js +13 -0
- package/cypress/pages/simpleCalculatorPage.js +8 -0
- package/cypress/pages/singleSelectionGridPage.js +58 -2
- package/cypress/pages/textEntryMathPage.js +58 -11
- package/cypress/pages/uploadResponsePage.js +4 -2
- package/package.json +1 -1
- package/cypress/e2e/ILC/MultipleSelection/multipleSelectionAdditionalSettings.js +0 -835
- package/cypress/e2e/ILC/SingleSelection/singleSelectionAdditionalSettings.js +0 -469
@@ -1,835 +0,0 @@
|
|
1
|
-
import { multipleSelectionPage } from "../../../pages";
|
2
|
-
import { commonComponents } from "../../../pages/components";
|
3
|
-
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
-
const css = Cypress.env('css');
|
5
|
-
|
6
|
-
const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
|
7
|
-
const numbers = ['1', '2', '3', '4'];
|
8
|
-
const lowercase = ['a', 'b', 'c', 'd'];
|
9
|
-
const uppercase = ['A', 'B', 'C', 'D'];
|
10
|
-
|
11
|
-
describe('Create Item page - Multiple Selection: Additional Settings', () => {
|
12
|
-
before(() => {
|
13
|
-
cy.loginAs('admin');
|
14
|
-
});
|
15
|
-
|
16
|
-
describe('Additional Settings: Option Style and Layout section contents', () => {
|
17
|
-
abortEarlySetup();
|
18
|
-
before(() => {
|
19
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
20
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
21
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
22
|
-
multipleSelectionPage.steps.setCorrectAnswers(2);
|
23
|
-
multipleSelectionPage.steps.allotPoints(20);
|
24
|
-
});
|
25
|
-
|
26
|
-
multipleSelectionPage.tests.verifyAdditonalSettingsAccordionProperties();
|
27
|
-
|
28
|
-
multipleSelectionPage.tests.verifyOptionsStyleLayoutAndDropdown('checkbox');
|
29
|
-
|
30
|
-
multipleSelectionPage.tests.verifyOptionNumerationDropdownContents('checkbox');
|
31
|
-
});
|
32
|
-
|
33
|
-
describe('Additional Settings: Option Style - Block without check box - Numerical', () => {
|
34
|
-
abortEarlySetup();
|
35
|
-
before(() => {
|
36
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
37
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
38
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
39
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
40
|
-
});
|
41
|
-
|
42
|
-
it('When the user selects \'Block without check box\' option from the Option Style dropdown and \'Numerical\' option from the Option Numeration dropdown, then numbers should be displayed before Block options in the \'Set Correct Answer\' section as well as in the \'Preview\' tab', () => {
|
43
|
-
multipleSelectionPage.optionsStyleDropdown()
|
44
|
-
.click();
|
45
|
-
multipleSelectionPage.optionsStyleDropdownListOptions('Block without check box')
|
46
|
-
.click();
|
47
|
-
multipleSelectionPage.optionsStyleDropdown()
|
48
|
-
.verifyInnerText('Block without check box');
|
49
|
-
multipleSelectionPage.optionNumerationDropdown()
|
50
|
-
.click();
|
51
|
-
multipleSelectionPage.optionNumerationDropdownListOptions('Numerical')
|
52
|
-
.click();
|
53
|
-
multipleSelectionPage.optionNumerationDropdown()
|
54
|
-
.verifyInnerText('Numerical');
|
55
|
-
multipleSelectionPage.steps.verifyEditTabCorrectAnswerSectionOptionsNumeration(numbers, 'checkbox')
|
56
|
-
multipleSelectionPage.steps.verifyEditTabCorrectAnswerSectionOptionsText(options)
|
57
|
-
cy.log('Switching to Preview tab')
|
58
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
59
|
-
multipleSelectionPage.steps.verifyPreviewTabOptionsNumeration(numbers, 'checkbox')
|
60
|
-
multipleSelectionPage.steps.verifyPreviewTabOptionsText(options)
|
61
|
-
});
|
62
|
-
|
63
|
-
multipleSelectionPage.tests.verifyCSSanda11yOfSelectedNumericalInCorrectAnswerSectionAndPreviewTab();
|
64
|
-
|
65
|
-
it('When user has selected \'Shuffle option order\' checkbox then in the \'Preview\' tab, numbers should be displayed before Block options in ascending order even though options are shuffled', () => {
|
66
|
-
cy.log('Pre-step:Switching to edit tab and checking shuffle option order checkbox')
|
67
|
-
multipleSelectionPage.steps.switchToEditTab()
|
68
|
-
multipleSelectionPage.shuffleOptionCheckbox()
|
69
|
-
.click()
|
70
|
-
.should('be.checked');
|
71
|
-
multipleSelectionPage.steps.switchToPreviewTab()
|
72
|
-
multipleSelectionPage.steps.verifyPreviewTabOptionsNumeration(numbers, 'checkbox')
|
73
|
-
multipleSelectionPage.steps.verifyShuffleOptionOrder(options, 4)
|
74
|
-
});
|
75
|
-
});
|
76
|
-
|
77
|
-
describe('Additional Settings: Option Style - Block without check box - Uppercase alphabet', () => {
|
78
|
-
abortEarlySetup();
|
79
|
-
before(() => {
|
80
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
81
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
82
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
83
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
84
|
-
});
|
85
|
-
|
86
|
-
it('When the user selects \'Block without check box\' option from the Option Style dropdown and \'Uppercase alphabet\' option from the Option Numeration dropdown, then uppercase alphabets should be displayed before Block options in the \'Set Correct Answer\' section as well as in the \'Preview\' tab', () => {
|
87
|
-
multipleSelectionPage.optionsStyleDropdown()
|
88
|
-
.click();
|
89
|
-
multipleSelectionPage.optionsStyleDropdownListOptions('Block without check box')
|
90
|
-
.click();
|
91
|
-
multipleSelectionPage.optionsStyleDropdown()
|
92
|
-
.verifyInnerText('Block without check box');
|
93
|
-
multipleSelectionPage.optionNumerationDropdown()
|
94
|
-
.click();
|
95
|
-
multipleSelectionPage.optionNumerationDropdownListOptions('Uppercase alphabet')
|
96
|
-
.click();
|
97
|
-
multipleSelectionPage.optionNumerationDropdown()
|
98
|
-
.verifyInnerText('Uppercase alphabet');
|
99
|
-
|
100
|
-
multipleSelectionPage.steps.verifyEditTabCorrectAnswerSectionOptionsNumeration(uppercase, 'checkbox')
|
101
|
-
multipleSelectionPage.steps.verifyEditTabCorrectAnswerSectionOptionsText(options)
|
102
|
-
cy.log('Switching to Preview tab')
|
103
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
104
|
-
multipleSelectionPage.steps.verifyPreviewTabOptionsNumeration(uppercase, 'checkbox')
|
105
|
-
multipleSelectionPage.steps.verifyPreviewTabOptionsText(options)
|
106
|
-
cy.log('Post step: Switching to Edit tab')
|
107
|
-
multipleSelectionPage.steps.switchToEditTab();
|
108
|
-
});
|
109
|
-
|
110
|
-
it('When user has selected \'Shuffle option order\' checkbox then in the \'Preview\' tab, uppercase alphabets should be displayed before Block options in ascending order even though options are shuffled', () => {
|
111
|
-
multipleSelectionPage.shuffleOptionCheckbox()
|
112
|
-
.click()
|
113
|
-
.should('be.checked');
|
114
|
-
cy.log('Switching to Preview tab')
|
115
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
116
|
-
multipleSelectionPage.steps.verifyPreviewTabOptionsNumeration(uppercase, 'checkbox')
|
117
|
-
multipleSelectionPage.steps.verifyShuffleOptionOrder(options, 4)
|
118
|
-
});
|
119
|
-
});
|
120
|
-
|
121
|
-
describe('Additional Settings: Option Style - Block without check box - Lowercase alphabet', () => {
|
122
|
-
abortEarlySetup();
|
123
|
-
before(() => {
|
124
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
125
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
126
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
127
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
128
|
-
});
|
129
|
-
|
130
|
-
it('When the user selects \'Block without check box\' option from the Option Style dropdown and \'Lowercase alphabet\' option from the Option Numeration dropdown, then lowercase alphabets should be displayed before Block options in the \'Set Correct Answer\' section as well as in the \'Preview\' tab', () => {
|
131
|
-
multipleSelectionPage.optionsStyleDropdown()
|
132
|
-
.click();
|
133
|
-
multipleSelectionPage.optionsStyleDropdownListOptions('Block without check box')
|
134
|
-
.click();
|
135
|
-
multipleSelectionPage.optionNumerationDropdown()
|
136
|
-
.click();
|
137
|
-
multipleSelectionPage.optionNumerationDropdownListOptions('Lowercase alphabet')
|
138
|
-
.click();
|
139
|
-
multipleSelectionPage.optionNumerationDropdown()
|
140
|
-
.verifyInnerText('Lowercase alphabet');
|
141
|
-
multipleSelectionPage.steps.verifyEditTabCorrectAnswerSectionOptionsNumeration(lowercase, 'checkbox')
|
142
|
-
multipleSelectionPage.steps.verifyEditTabCorrectAnswerSectionOptionsText(options)
|
143
|
-
cy.log('Switching to Preview tab')
|
144
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
145
|
-
multipleSelectionPage.steps.verifyPreviewTabOptionsNumeration(lowercase, 'checkbox')
|
146
|
-
multipleSelectionPage.steps.verifyPreviewTabOptionsText(options)
|
147
|
-
cy.log('Post step: Switching to Edit tab')
|
148
|
-
multipleSelectionPage.steps.switchToEditTab();
|
149
|
-
});
|
150
|
-
|
151
|
-
it('When user has selected \'Shuffle option order\' checkbox then in the \'Preview\' tab, lowercase alphabets should be displayed before Block options in ascending order even though options are shuffled', () => {
|
152
|
-
multipleSelectionPage.shuffleOptionCheckbox()
|
153
|
-
.click()
|
154
|
-
.should('be.checked');
|
155
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
156
|
-
multipleSelectionPage.steps.verifyPreviewTabOptionsNumeration(lowercase, 'checkbox')
|
157
|
-
multipleSelectionPage.steps.verifyShuffleOptionOrder(options, 4)
|
158
|
-
});
|
159
|
-
});
|
160
|
-
|
161
|
-
//Failing due to https://redmine.zeuslearning.com/issues/547726
|
162
|
-
describe('Additional Settings: Option Style - Check box below option and switching back to Default option style', () => {
|
163
|
-
abortEarlySetup();
|
164
|
-
before(() => {
|
165
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
166
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
167
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
168
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
169
|
-
});
|
170
|
-
|
171
|
-
it('When the user selects \'Check box below option\' option from the Option Style dropdown, \'Option Numeration\' dropdown should not be displayed', () => {
|
172
|
-
multipleSelectionPage.optionsStyleDropdown()
|
173
|
-
.click();
|
174
|
-
multipleSelectionPage.optionsStyleDropdownListOptions('Check box below option')
|
175
|
-
.click();
|
176
|
-
multipleSelectionPage.optionsStyleDropdown()
|
177
|
-
.verifyInnerText('Check box below option');
|
178
|
-
multipleSelectionPage.optionNumerationDropdown()
|
179
|
-
.should('not.exist');
|
180
|
-
});
|
181
|
-
|
182
|
-
it('In the \'Set Correct Answer\' section as well as in the \'Preview\' tab, checkbox for the option should be displayed below the option text and both option text as well as option checkbox should be center-aligned', () => {
|
183
|
-
multipleSelectionPage.editTabOptionsText()
|
184
|
-
.parents('[data-ngie-testid="response-option-checkbox"]')
|
185
|
-
.each(($element) => {
|
186
|
-
cy.wrap($element)
|
187
|
-
.should('have.class', 'mcq-checkbox-below-option')
|
188
|
-
.should('have.css', 'align-items', 'center');
|
189
|
-
});
|
190
|
-
cy.log('Switching to Preview tab')
|
191
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
192
|
-
multipleSelectionPage.previewTabOptionsText()
|
193
|
-
.parents('[data-ngie-testid="response-option-checkbox"]')
|
194
|
-
.each(($element) => {
|
195
|
-
cy.wrap($element)
|
196
|
-
.should('have.class', 'mcq-checkbox-below-option')
|
197
|
-
.should('have.css', 'align-items', 'center');
|
198
|
-
});
|
199
|
-
cy.log('Post-step: Switch back to edit tab')
|
200
|
-
multipleSelectionPage.steps.switchToEditTab();
|
201
|
-
});
|
202
|
-
|
203
|
-
it('When the user selects \'Default\' option from the Option Style dropdown, then checkbox for each option should be displayed besides the option text in the \'Set Correct Answer\' section as well as in the \'Preview\' tab', () => {
|
204
|
-
multipleSelectionPage.optionsStyleDropdown()
|
205
|
-
.click();
|
206
|
-
multipleSelectionPage.optionsStyleDropdownListOptions('Default')
|
207
|
-
.click();
|
208
|
-
multipleSelectionPage.optionsStyleDropdown()
|
209
|
-
.verifyInnerText('Default');
|
210
|
-
multipleSelectionPage.editTabOptionsText()
|
211
|
-
.parents('[data-ngie-testid="response-option-checkbox"]')
|
212
|
-
.each(($element) => {
|
213
|
-
cy.wrap($element)
|
214
|
-
.should('not.have.class', 'mcq-checkbox-below-option')
|
215
|
-
.should('have.css', 'align-items', 'normal');
|
216
|
-
});
|
217
|
-
cy.log('Switching to Preview tab')
|
218
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
219
|
-
multipleSelectionPage.previewTabOptionsText()
|
220
|
-
.parents('[data-ngie-testid="response-option-checkbox"]')
|
221
|
-
.each(($element) => {
|
222
|
-
cy.wrap($element)
|
223
|
-
.should('not.have.class', 'mcq-checkbox-below-option')
|
224
|
-
.should('have.css', 'align-items', 'normal');
|
225
|
-
});
|
226
|
-
});
|
227
|
-
});
|
228
|
-
|
229
|
-
describe('Additional Settings: Number of Option Columns contents', () => {
|
230
|
-
abortEarlySetup();
|
231
|
-
before(() => {
|
232
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions and options and expanding additional settings accordion')
|
233
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
234
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
235
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
236
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
237
|
-
});
|
238
|
-
|
239
|
-
multipleSelectionPage.tests.verifyNumberOfOptionColumnsAndOptionOrientationContent();
|
240
|
-
});
|
241
|
-
|
242
|
-
describe('Number of Option Columns - Option Orientation - Vertical', () => {
|
243
|
-
abortEarlySetup();
|
244
|
-
before(() => {
|
245
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions and options and expanding additional settings accordion')
|
246
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
247
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
248
|
-
multipleSelectionPage.addOptionButton()
|
249
|
-
.click();
|
250
|
-
multipleSelectionPage.addOptionButton()
|
251
|
-
.click();
|
252
|
-
multipleSelectionPage.steps.addOptionsText(6);
|
253
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
254
|
-
});
|
255
|
-
|
256
|
-
multipleSelectionPage.tests.verifyNumberOfOptionsColumns('Vertical');
|
257
|
-
});
|
258
|
-
|
259
|
-
describe('Number of Option Columns - Option Orientation - Horizontal', () => {
|
260
|
-
abortEarlySetup();
|
261
|
-
before(() => {
|
262
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions,adding 2 more options, adding options text, setting correct answers, alloting points, expanding additional settings accordion and setting option orientation as \'Horizontal\'')
|
263
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
264
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
265
|
-
multipleSelectionPage.addOptionButton()
|
266
|
-
.click();
|
267
|
-
multipleSelectionPage.addOptionButton()
|
268
|
-
.click();
|
269
|
-
multipleSelectionPage.steps.addOptionsText(6);
|
270
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
271
|
-
multipleSelectionPage.numberOfOptionColumnsDropdown()
|
272
|
-
.click();
|
273
|
-
multipleSelectionPage.numberOfOptionColumnsListOptions(1)
|
274
|
-
.click();
|
275
|
-
multipleSelectionPage.optionOrientationDropdown()
|
276
|
-
.click();
|
277
|
-
multipleSelectionPage.optionOrientationListOptions(1)
|
278
|
-
.click();
|
279
|
-
});
|
280
|
-
|
281
|
-
multipleSelectionPage.tests.verifyNumberOfOptionsColumns('Horizontal');
|
282
|
-
});
|
283
|
-
|
284
|
-
describe('Number of Option Columns - Shuffle option order, Option Numeration dropdown, Show correct answer checkbox and Check Answer button cases', () => {
|
285
|
-
abortEarlySetup();
|
286
|
-
before(() => {
|
287
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions, adding 2 more options, adding options text, setting correct answers, alloting points and expanding additional settings accordion')
|
288
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
289
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
290
|
-
multipleSelectionPage.addOptionButton()
|
291
|
-
.click();
|
292
|
-
multipleSelectionPage.addOptionButton()
|
293
|
-
.click();
|
294
|
-
multipleSelectionPage.steps.addOptionsText(6);
|
295
|
-
multipleSelectionPage.steps.setCorrectAnswers(2);
|
296
|
-
multipleSelectionPage.steps.allotPoints(4);
|
297
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
298
|
-
cy.log('Selecting shuffle order option checkbox, selecting Block without check box and Numerical options, selecting Allow student to check answer checkbox and providing max check answer attempts and selecting number of option columns as 3');
|
299
|
-
multipleSelectionPage.shuffleOptionCheckbox()
|
300
|
-
.click();
|
301
|
-
multipleSelectionPage.optionsStyleDropdown()
|
302
|
-
.click();
|
303
|
-
multipleSelectionPage.optionsStyleDropdownListOptions('Block without check box')
|
304
|
-
.click();
|
305
|
-
multipleSelectionPage.optionNumerationDropdown()
|
306
|
-
.click();
|
307
|
-
multipleSelectionPage.optionNumerationDropdownListOptions('Numerical')
|
308
|
-
.click();
|
309
|
-
multipleSelectionPage.steps.setMaximumCheckAnswerAttempts(5);
|
310
|
-
});
|
311
|
-
|
312
|
-
multipleSelectionPage.tests.verifyOptionOrientation('checkbox');
|
313
|
-
|
314
|
-
it('When the user selects \'Show correct answer\' checkbox, then green checkmark icon should be displayed besides correct answer options as per the shuffling and columns and no label should be displayed below the options', () => {
|
315
|
-
multipleSelectionPage.showCorrectAnswerCheckbox()
|
316
|
-
.click();
|
317
|
-
let correctOptions = ['Pollution caused by cement production', 'Pollution caused by treating chemical waste']
|
318
|
-
correctOptions.forEach((option) => {
|
319
|
-
multipleSelectionPage.steps.verifyCorrectOption(option);
|
320
|
-
});
|
321
|
-
multipleSelectionPage.correctIncorrectAnswerLabel()
|
322
|
-
.should('not.exist');
|
323
|
-
cy.log('Post-step: Uncheck the Show correct answer checkbox');
|
324
|
-
multipleSelectionPage.showCorrectAnswerCheckbox()
|
325
|
-
.click()
|
326
|
-
.should('not.be.checked');
|
327
|
-
});
|
328
|
-
|
329
|
-
it('When user selects all the options and clicks on \'Check Answer\' button, then green checkmark icon should be displayed besides correct answer options and red crossmark icon should be displayed besides incorrect answer options as per the shuffling and columns and a label \'Incorrect Answer\' should be displayed below the box', () => {
|
330
|
-
let correctOptions = ['Pollution caused by cement production', 'Pollution caused by treating chemical waste']
|
331
|
-
let incorrectOptions = ['Pollution caused by methane production', 'Pollution caused by cement and methane production', 'Pollution caused by electronic waste', 'Pollution caused by nuclear waste'];
|
332
|
-
for (let index = 0; index < 6; index++) {
|
333
|
-
multipleSelectionPage.previewTabOptionsWrapper(index)
|
334
|
-
.click()
|
335
|
-
.within(() => {
|
336
|
-
multipleSelectionPage.optionForBlockWithoutCheckbox()
|
337
|
-
.should('have.class', 'label-selected');
|
338
|
-
});
|
339
|
-
};
|
340
|
-
multipleSelectionPage.showCorrectAnswerCheckbox()
|
341
|
-
.click()
|
342
|
-
.should('be.checked');
|
343
|
-
correctOptions.forEach((option) => {
|
344
|
-
multipleSelectionPage.steps.verifyCorrectOption(option);
|
345
|
-
});
|
346
|
-
incorrectOptions.forEach((option) => {
|
347
|
-
multipleSelectionPage.steps.verifyIncorrectOption(option);
|
348
|
-
});
|
349
|
-
multipleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
350
|
-
});
|
351
|
-
});
|
352
|
-
|
353
|
-
describe('Additional Settings: Minimum and Maximum number of answers contents', () => {
|
354
|
-
abortEarlySetup();
|
355
|
-
before(() => {
|
356
|
-
cy.log('Navigating to multiple selection question type and expanding additional settings accordion')
|
357
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
358
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
359
|
-
});
|
360
|
-
|
361
|
-
|
362
|
-
it('CSS of \'Minimum number of answers\' and \'Maximum number of answers\' input fields', { tags: 'css' }, () => {
|
363
|
-
multipleSelectionPage.minimumNumberOfAnswersLabel()
|
364
|
-
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
365
|
-
multipleSelectionPage.maximumNumberOfAnswersLabel()
|
366
|
-
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
367
|
-
multipleSelectionPage.minimumAnswersInputField()
|
368
|
-
.should('have.css', 'background-color', css.color.transparent);
|
369
|
-
multipleSelectionPage.maximumAnswersInputField()
|
370
|
-
.should('have.css', 'background-color', css.color.transparent);
|
371
|
-
});
|
372
|
-
|
373
|
-
//Note: Note: a11y is covered for the entire additional settings section
|
374
|
-
|
375
|
-
it('\'Minimum number of answers\' label and input field should be displayed', () => {
|
376
|
-
multipleSelectionPage.minimumNumberOfAnswersLabel()
|
377
|
-
.verifyInnerText('Minimum number of answers');
|
378
|
-
multipleSelectionPage.minimumAnswersInputField()
|
379
|
-
.should('be.visible');
|
380
|
-
});
|
381
|
-
|
382
|
-
it('\'Maximum number of answers\' label and input field should be displayed', () => {
|
383
|
-
multipleSelectionPage.maximumNumberOfAnswersLabel()
|
384
|
-
.verifyInnerText('Maximum number of answers');
|
385
|
-
multipleSelectionPage.maximumAnswersInputField()
|
386
|
-
.should('be.visible');
|
387
|
-
});
|
388
|
-
});
|
389
|
-
|
390
|
-
describe('Minimum number of answers cases - Edit tab', () => {
|
391
|
-
abortEarlySetup();
|
392
|
-
before(() => {
|
393
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions, options, setting correct answers, alloting points and expanding additional settings accordion')
|
394
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
395
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
396
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
397
|
-
multipleSelectionPage.steps.setCorrectAnswers(1);
|
398
|
-
multipleSelectionPage.steps.allotPoints(20);
|
399
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
400
|
-
});
|
401
|
-
|
402
|
-
|
403
|
-
it('When user adds minimum number of answers more than the number of correct answers, then in the \'Set Correct Answer\' section a warning message should be displayed stating required number of answers along with exclamation icon at start', () => {
|
404
|
-
multipleSelectionPage.minimumAnswersInputField()
|
405
|
-
.type('2', { delay: 0 })
|
406
|
-
.should('have.value', '2');
|
407
|
-
multipleSelectionPage.minMaxErrorMessage()
|
408
|
-
.verifyInnerText('At least 2 answers are required.')
|
409
|
-
.and('be.visible');
|
410
|
-
});
|
411
|
-
|
412
|
-
it('When user changes the value of minimum number of answers same as the number of correct answers the warning message should disappear', () => {
|
413
|
-
multipleSelectionPage.minimumAnswersInputField()
|
414
|
-
.clear()
|
415
|
-
.type('1', { delay: 0 })
|
416
|
-
.should('have.value', '1');
|
417
|
-
multipleSelectionPage.minMaxErrorMessage()
|
418
|
-
.should('not.exist');
|
419
|
-
});
|
420
|
-
|
421
|
-
it('When user sets the number of correct answer same as minimum number of answers the warning message should disappear', () => {
|
422
|
-
multipleSelectionPage.minimumAnswersInputField()
|
423
|
-
.clear();
|
424
|
-
multipleSelectionPage.minimumAnswersInputField()
|
425
|
-
.type('2', { delay: 0 })
|
426
|
-
.should('have.value', '2');
|
427
|
-
multipleSelectionPage.minMaxErrorMessage()
|
428
|
-
.verifyInnerText('At least 2 answers are required.');
|
429
|
-
multipleSelectionPage.steps.checkUncheckCorrectAnswer(1, 'be.checked');
|
430
|
-
multipleSelectionPage.minMaxErrorMessage()
|
431
|
-
.should('not.exist');
|
432
|
-
});
|
433
|
-
|
434
|
-
it(`If the maximum number field is empty and the minimum number field is 0 or less than 0, it should automatically change to 1, a snackbar with the text 'Minimum number of answers can't be less than 1' and \'CLOSE\' button should be displayed, on clicking on the \'CLOSE\' button, snackbar should disappear`, () => {
|
435
|
-
multipleSelectionPage.minimumAnswersInputField()
|
436
|
-
.clear();
|
437
|
-
multipleSelectionPage.minimumAnswersInputField()
|
438
|
-
.type('0');
|
439
|
-
multipleSelectionPage.minimumAnswersInputField()
|
440
|
-
.should('have.value', '0');
|
441
|
-
multipleSelectionPage.minimumAnswersInputField()
|
442
|
-
.should('have.value', '1');
|
443
|
-
commonComponents.snackbar()
|
444
|
-
.verifyInnerText('Minimum number of answers can\'t be less than 1');
|
445
|
-
commonComponents.snackbarCloseButton()
|
446
|
-
.verifyInnerText('CLOSE')
|
447
|
-
.click();
|
448
|
-
commonComponents.snackbar()
|
449
|
-
.should('not.exist');
|
450
|
-
});
|
451
|
-
|
452
|
-
it(`If the maximum number field is empty and the minimum number field value is greater than the number of available options, it should automatically change to the number of available options, and a snackbar with the text 'Minimum number of answers can't be more than the available options' should be displayed, the snackbar should automatically disappear within few seconds`, () => {
|
453
|
-
multipleSelectionPage.minimumAnswersInputField()
|
454
|
-
.clear()
|
455
|
-
.type('5', { delay: 0 })
|
456
|
-
.should('have.value', '5')
|
457
|
-
multipleSelectionPage.minimumAnswersInputField()
|
458
|
-
.should('have.value', '4')
|
459
|
-
commonComponents.snackbar()
|
460
|
-
.verifyInnerText('Minimum number of answers can\'t be more than the available options');
|
461
|
-
commonComponents.snackbar()
|
462
|
-
.should('not.exist');
|
463
|
-
});
|
464
|
-
|
465
|
-
it(`If the maximum number field is 1 (or more) and the minimum number field is 0 or less than 0, it should automatically change to 1, and a snackbar with the text 'Minimum number of answers can't be less than 1' should be displayed`, () => {
|
466
|
-
multipleSelectionPage.maximumAnswersInputField()
|
467
|
-
.type('4', { delay: 0 })
|
468
|
-
.should('have.value', '4');
|
469
|
-
multipleSelectionPage.minimumAnswersInputField()
|
470
|
-
.clear();
|
471
|
-
multipleSelectionPage.minimumAnswersInputField()
|
472
|
-
.type('0', { delay: 0 });
|
473
|
-
multipleSelectionPage.minimumAnswersInputField()
|
474
|
-
.should('have.value', '0');
|
475
|
-
multipleSelectionPage.minimumAnswersInputField()
|
476
|
-
.should('have.value', '1');
|
477
|
-
commonComponents.snackbar()
|
478
|
-
.verifyInnerText('Minimum number of answers can\'t be less than 1');
|
479
|
-
});
|
480
|
-
|
481
|
-
it(`If the minimum number field value is greater than the maximum number field value, it should automatically change to the maximum number field value, and a snackbar with the text 'Minimum number of answers can't be more than the maximum number of answers' should be displayed`, () => {
|
482
|
-
multipleSelectionPage.maximumAnswersInputField()
|
483
|
-
.clear();
|
484
|
-
multipleSelectionPage.minimumAnswersInputField()
|
485
|
-
.clear();
|
486
|
-
multipleSelectionPage.maximumAnswersInputField()
|
487
|
-
.type('2', { delay: 0 })
|
488
|
-
.should('have.value', '2')
|
489
|
-
.wait(300);
|
490
|
-
multipleSelectionPage.minimumAnswersInputField()
|
491
|
-
.type('4', { delay: 0 })
|
492
|
-
.should('have.value', '4')
|
493
|
-
multipleSelectionPage.minimumAnswersInputField()
|
494
|
-
.should('have.value', '2');
|
495
|
-
commonComponents.snackbar()
|
496
|
-
.verifyInnerText('Minimum number of answers can\'t be more than the maximum number of answers');
|
497
|
-
});
|
498
|
-
});
|
499
|
-
|
500
|
-
describe('Maximum number of answers cases - Edit tab', () => {
|
501
|
-
abortEarlySetup();
|
502
|
-
before(() => {
|
503
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions, options, setting correct answers, alloting points and expanding additional settings accordion')
|
504
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
505
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
506
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
507
|
-
multipleSelectionPage.steps.setCorrectAnswers(2);
|
508
|
-
multipleSelectionPage.steps.allotPoints(20);
|
509
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
510
|
-
});
|
511
|
-
|
512
|
-
it(`When user adds maximum number of answers less than the number of correct answers, it should automatically change to the number of set correct answers, and a snackbar with the text 'Maximum number of answers can't be less than the set correct answers' and \'CLOSE\' button should be displayed, on clicking on the \'CLOSE\' button, snackbar should disappear`, () => {
|
513
|
-
multipleSelectionPage.maximumAnswersInputField()
|
514
|
-
.type('1', { delay: 0 })
|
515
|
-
.should('have.value', '1')
|
516
|
-
multipleSelectionPage.maximumAnswersInputField()
|
517
|
-
.should('have.value', '2')
|
518
|
-
commonComponents.snackbar()
|
519
|
-
.verifyInnerText('Maximum number of answers can\'t be less than the set correct answers');
|
520
|
-
commonComponents.snackbarCloseButton()
|
521
|
-
.verifyInnerText('CLOSE')
|
522
|
-
.click();
|
523
|
-
commonComponents.snackbar()
|
524
|
-
.should('not.exist');
|
525
|
-
});
|
526
|
-
|
527
|
-
it(`If the minimum number field is empty and the maximum number field is 0 or less than 0, it should automatically change to 1, and a snackbar with the text 'Maximum number of answers can't be less than 1' should be displayed`, () => {
|
528
|
-
cy.log('To verify this case, uncheck all set correct answers')
|
529
|
-
let setAnswers = [0, 1]
|
530
|
-
setAnswers.forEach((option) => {
|
531
|
-
multipleSelectionPage.steps.checkUncheckCorrectAnswer(option, 'not.be.checked');
|
532
|
-
});
|
533
|
-
multipleSelectionPage.maximumAnswersInputField()
|
534
|
-
.clear()
|
535
|
-
.type('0', { delay: 0 })
|
536
|
-
.should('have.value', '0')
|
537
|
-
multipleSelectionPage.maximumAnswersInputField()
|
538
|
-
.should('have.value', '1');
|
539
|
-
commonComponents.snackbar()
|
540
|
-
.verifyInnerText('Maximum number of answers can\'t be less than 1');
|
541
|
-
commonComponents.snackbar()
|
542
|
-
.should('not.exist');
|
543
|
-
cy.log('Post-step : clear maxmimum number field, check all set correct answers again')
|
544
|
-
multipleSelectionPage.maximumAnswersInputField()
|
545
|
-
.clear();
|
546
|
-
multipleSelectionPage.steps.setCorrectAnswers(2);
|
547
|
-
});
|
548
|
-
|
549
|
-
it(`If the minimum number field is empty and the maximum number field value is greater than the number of available options, it should automatically change to the number of available options, and a snackbar with the text 'Maximum number of answers can't be more than the available options' should be displayed`, () => {
|
550
|
-
multipleSelectionPage.maximumAnswersInputField()
|
551
|
-
.clear()
|
552
|
-
.type('6', { delay: 0 })
|
553
|
-
.should('have.value', '6')
|
554
|
-
multipleSelectionPage.maximumAnswersInputField()
|
555
|
-
.should('have.value', '4')
|
556
|
-
commonComponents.snackbar()
|
557
|
-
.verifyInnerText('Maximum number of answers can\'t be more than the available options');
|
558
|
-
});
|
559
|
-
|
560
|
-
it(`If the minimum number field is 1 (or more) and the maximum number field is smaller than the minimum number, it should automatically change to the number in the minimum number field, and a snackbar with the text 'Maximum number of answers can't be less than the minimum number of answers' should be displayed`, () => {
|
561
|
-
cy.log('clear the maximum number field')
|
562
|
-
multipleSelectionPage.maximumAnswersInputField()
|
563
|
-
.clear();
|
564
|
-
multipleSelectionPage.minimumAnswersInputField()
|
565
|
-
.type('3', { delay: 0 })
|
566
|
-
.should('have.value', '3')
|
567
|
-
.wait(300);
|
568
|
-
multipleSelectionPage.maximumAnswersInputField()
|
569
|
-
.type('2', { delay: 0 })
|
570
|
-
.should('have.value', '2')
|
571
|
-
multipleSelectionPage.maximumAnswersInputField()
|
572
|
-
.should('have.value', '3');
|
573
|
-
commonComponents.snackbar()
|
574
|
-
.verifyInnerText('Maximum number of answers can\'t be less than the minimum number of answers');
|
575
|
-
});
|
576
|
-
|
577
|
-
it(`If the minimum number field is 1 (or more) and the maximum number field value is greater than number of available options, it should automatically change to the number of available options, and a snackbar with the text 'Maximum number of answers can't be more than the available options' should be displayed`, () => {
|
578
|
-
multipleSelectionPage.maximumAnswersInputField()
|
579
|
-
.clear();
|
580
|
-
multipleSelectionPage.maximumAnswersInputField()
|
581
|
-
.type('6', { delay: 0 })
|
582
|
-
.should('have.value', '6')
|
583
|
-
multipleSelectionPage.maximumAnswersInputField()
|
584
|
-
.should('have.value', '4')
|
585
|
-
commonComponents.snackbar()
|
586
|
-
.verifyInnerText('Maximum number of answers can\'t be more than the available options');
|
587
|
-
});
|
588
|
-
});
|
589
|
-
|
590
|
-
describe('Minimum and Maximum number of answers - Preview tab', () => {
|
591
|
-
abortEarlySetup();
|
592
|
-
before(() => {
|
593
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions, options, setting correct answers, alloting points, expanding additional settings accordion, setting minimum and maximum number of answers required')
|
594
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
595
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
596
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
597
|
-
multipleSelectionPage.steps.setCorrectAnswers(2);
|
598
|
-
multipleSelectionPage.steps.allotPoints(20);
|
599
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
600
|
-
multipleSelectionPage.minimumAnswersInputField()
|
601
|
-
.type('2', { delay: 0 })
|
602
|
-
.should('have.value', '2');
|
603
|
-
multipleSelectionPage.maximumAnswersInputField()
|
604
|
-
.type('3', { delay: 0 });
|
605
|
-
multipleSelectionPage.maximumAnswersInputField()
|
606
|
-
.should('have.value', '3');
|
607
|
-
cy.log('Post step: Switching to Preview tab')
|
608
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
609
|
-
});
|
610
|
-
|
611
|
-
|
612
|
-
it(`In Preview tab, when user selects options less than minimum number of answers, a warning message 'At least # answers are required.' should be displayed below the options in the student preview`, () => {
|
613
|
-
multipleSelectionPage.previewTabOptionsWrapper(0)
|
614
|
-
.within(() => {
|
615
|
-
multipleSelectionPage.previewTabOptionsCheckbox()
|
616
|
-
.click()
|
617
|
-
.should('be.checked')
|
618
|
-
});
|
619
|
-
multipleSelectionPage.minMaxErrorMessage()
|
620
|
-
.verifyInnerText('At least 2 answers are required.')
|
621
|
-
.and('be.visible')
|
622
|
-
});
|
623
|
-
|
624
|
-
it('CSS of warning message', { tags: 'css' }, () => {
|
625
|
-
multipleSelectionPage.minMaxErrorMessage()
|
626
|
-
.find('.min-max-answer-error-text')
|
627
|
-
.verifyCSS(css.color.warningText, css.fontSize.normal, css.fontWeight.bold);
|
628
|
-
});
|
629
|
-
|
630
|
-
it('Accessibility of warning message in Edit tab', { tags: 'a11y' }, () => {
|
631
|
-
cy.checkAccessibility(multipleSelectionPage.minMaxErrorMessage());
|
632
|
-
});
|
633
|
-
|
634
|
-
it('In Preview tab, when user selects options same as minimum number of answers, the warning message should disappear', () => {
|
635
|
-
multipleSelectionPage.previewTabOptionsWrapper(1)
|
636
|
-
.click()
|
637
|
-
.within(() => {
|
638
|
-
multipleSelectionPage.previewTabOptionsCheckbox()
|
639
|
-
.should('be.checked');
|
640
|
-
});
|
641
|
-
multipleSelectionPage.minMaxErrorMessage()
|
642
|
-
.should('not.exist');
|
643
|
-
});
|
644
|
-
|
645
|
-
it(`In Preview tab, when user tries to select options more than maximum number of answers, a warning message 'Only # answers are permitted.' should be displayed below the options in the student preview`, () => {
|
646
|
-
let incorrectOptions = [3, 4];
|
647
|
-
incorrectOptions.forEach((option, count) => {
|
648
|
-
multipleSelectionPage.previewTabOptionsWrapper(count + 2)
|
649
|
-
.click();
|
650
|
-
});
|
651
|
-
multipleSelectionPage.previewTabOptionsWrapper(3)
|
652
|
-
.within(() => {
|
653
|
-
multipleSelectionPage.previewTabOptionsCheckbox()
|
654
|
-
.should('not.be.checked');
|
655
|
-
});
|
656
|
-
multipleSelectionPage.minMaxErrorMessage()
|
657
|
-
.verifyInnerText('Only 3 answers are permitted.')
|
658
|
-
});
|
659
|
-
|
660
|
-
it('CSS of warning message in Preview tab', { tags: 'css' }, () => {
|
661
|
-
multipleSelectionPage.minMaxErrorMessage()
|
662
|
-
.find('.min-max-answer-error-text')
|
663
|
-
.verifyCSS(css.color.warningText, css.fontSize.normal, css.fontWeight.bold);
|
664
|
-
});
|
665
|
-
|
666
|
-
it('Accessibility of warning message in Preview tab', { tags: 'a11y' }, () => {
|
667
|
-
cy.checkAccessibility(multipleSelectionPage.minMaxErrorMessage());
|
668
|
-
});
|
669
|
-
|
670
|
-
it('In Preview tab, when user deselects any option, the warning message should disappear', () => {
|
671
|
-
multipleSelectionPage.previewTabOptionsWrapper(1)
|
672
|
-
.click()
|
673
|
-
.within(() => {
|
674
|
-
multipleSelectionPage.previewTabOptionsCheckbox()
|
675
|
-
.should('not.be.checked');
|
676
|
-
});
|
677
|
-
multipleSelectionPage.minMaxErrorMessage()
|
678
|
-
.should('not.exist');
|
679
|
-
});
|
680
|
-
});
|
681
|
-
|
682
|
-
describe('Additional Settings: Font Size dropdown', () => {
|
683
|
-
abortEarlySetup();
|
684
|
-
before(() => {
|
685
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions and options, alloting points and expanding additional settings accordion')
|
686
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
687
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
688
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
689
|
-
multipleSelectionPage.steps.setCorrectAnswers(2);
|
690
|
-
multipleSelectionPage.steps.allotPoints(8);
|
691
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
692
|
-
});
|
693
|
-
|
694
|
-
multipleSelectionPage.tests.verifyFontSizeSectionContents();
|
695
|
-
|
696
|
-
multipleSelectionPage.tests.verifyEditTabCorrectAnswerSectionAndPreviewTabFontSize();
|
697
|
-
});
|
698
|
-
|
699
|
-
describe('Additional Settings: Check Answer', () => {
|
700
|
-
abortEarlySetup();
|
701
|
-
before(() => {
|
702
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions and options and expanding additional settings accordion')
|
703
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
704
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
705
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
706
|
-
multipleSelectionPage.steps.setCorrectAnswers(2);
|
707
|
-
multipleSelectionPage.steps.allotPoints(20);
|
708
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
709
|
-
});
|
710
|
-
multipleSelectionPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton('multiple selection');
|
711
|
-
});
|
712
|
-
|
713
|
-
describe('Check Answer - Functionality', () => {
|
714
|
-
abortEarlySetup();
|
715
|
-
before(() => {
|
716
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions and options, expanding additional settings accordion, allowing students to check answer and switching to preview tab')
|
717
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
718
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
719
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
720
|
-
multipleSelectionPage.steps.setCorrectAnswers(2);
|
721
|
-
multipleSelectionPage.steps.allotPoints(20);
|
722
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
723
|
-
multipleSelectionPage.steps.setMaximumCheckAnswerAttempts(2);
|
724
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
725
|
-
});
|
726
|
-
|
727
|
-
multipleSelectionPage.tests.verifyCheckAnswerButtonFunctionalityWhenQuestionIsUnattempted();
|
728
|
-
|
729
|
-
it('When the user tries to click on the check answer button after entering an answer multiple times then the user should be able to do so', () => {
|
730
|
-
cy.log('Attempting the question')
|
731
|
-
for (let index = 0; index < 2; index++) {
|
732
|
-
multipleSelectionPage.previewTabOptionsWrapper(index)
|
733
|
-
.click();
|
734
|
-
multipleSelectionPage.checkAnswerButton()
|
735
|
-
.click();
|
736
|
-
}
|
737
|
-
});
|
738
|
-
|
739
|
-
multipleSelectionPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y()
|
740
|
-
|
741
|
-
it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
|
742
|
-
cy.log('Switching to Edit tab');
|
743
|
-
multipleSelectionPage.steps.switchToEditTab();
|
744
|
-
multipleSelectionPage.maximumCheckAnswerAttemptsInputField()
|
745
|
-
.clear()
|
746
|
-
.type(1)
|
747
|
-
.should('have.value', '1');
|
748
|
-
cy.log('Switching to Preview tab');
|
749
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
750
|
-
multipleSelectionPage.checkAnswerButton()
|
751
|
-
.should('be.enabled');
|
752
|
-
multipleSelectionPage.previewTabOptionsWrapper(0)
|
753
|
-
.click();
|
754
|
-
multipleSelectionPage.checkAnswerButton()
|
755
|
-
.click();
|
756
|
-
multipleSelectionPage.checkAnswerButton()
|
757
|
-
.should('be.disabled');
|
758
|
-
});
|
759
|
-
|
760
|
-
it('When the \'Maximum check answer attempts\' input field has value \'0\' and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
|
761
|
-
multipleSelectionPage.steps.switchToEditTab();
|
762
|
-
multipleSelectionPage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
763
|
-
multipleSelectionPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
|
764
|
-
cy.log('Switching to Preview tab')
|
765
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
766
|
-
multipleSelectionPage.checkAnswerButton()
|
767
|
-
.should('be.enabled');
|
768
|
-
multipleSelectionPage.previewTabOptionsWrapper(0)
|
769
|
-
.click();
|
770
|
-
multipleSelectionPage.checkAnswerButton()
|
771
|
-
.click();
|
772
|
-
multipleSelectionPage.checkAnswerButton()
|
773
|
-
.should('be.enabled');
|
774
|
-
});
|
775
|
-
|
776
|
-
it('When the \'Maximum check answer attempts\' input field is kept empty and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
|
777
|
-
cy.log('Switching to Edit tab');
|
778
|
-
multipleSelectionPage.steps.switchToEditTab();
|
779
|
-
multipleSelectionPage.maximumCheckAnswerAttemptsInputField()
|
780
|
-
.clear()
|
781
|
-
.should('have.value', '');
|
782
|
-
cy.log('Switching to Preview tab')
|
783
|
-
multipleSelectionPage.steps.switchToPreviewTab();
|
784
|
-
multipleSelectionPage.checkAnswerButton()
|
785
|
-
.should('be.enabled');
|
786
|
-
multipleSelectionPage.previewTabOptionsWrapper(0)
|
787
|
-
.click();
|
788
|
-
multipleSelectionPage.checkAnswerButton()
|
789
|
-
.click();
|
790
|
-
multipleSelectionPage.checkAnswerButton()
|
791
|
-
.should('be.enabled');
|
792
|
-
});
|
793
|
-
|
794
|
-
it('On selecting/deselecting more answer options, green checkmark icon and label \'Correct Answer\' should disappear', () => {
|
795
|
-
cy.log('Selecting another option to verify if checkmark icon and label disappear')
|
796
|
-
multipleSelectionPage.previewTabOptionsWrapper(2)
|
797
|
-
.within(() => {
|
798
|
-
multipleSelectionPage.previewTabOptionsCheckbox()
|
799
|
-
.click()
|
800
|
-
.should('be.checked')
|
801
|
-
});
|
802
|
-
multipleSelectionPage.correctIncorrectAnswerLabel()
|
803
|
-
.should('not.exist');
|
804
|
-
multipleSelectionPage.correctIcon()
|
805
|
-
.should('not.exist');
|
806
|
-
cy.log('clicking on check answer button to make the checkmark icon and label appear again')
|
807
|
-
multipleSelectionPage.checkAnswerButton()
|
808
|
-
.click();
|
809
|
-
cy.log('deselecting the selected option to verify if checkmark icon and label disappear')
|
810
|
-
multipleSelectionPage.previewTabOptionsWrapper(2)
|
811
|
-
.within(() => {
|
812
|
-
multipleSelectionPage.previewTabOptionsCheckbox()
|
813
|
-
.click()
|
814
|
-
.should('not.be.checked')
|
815
|
-
});
|
816
|
-
multipleSelectionPage.correctIncorrectAnswerLabel()
|
817
|
-
.should('not.exist');
|
818
|
-
multipleSelectionPage.correctIcon()
|
819
|
-
.should('not.exist');
|
820
|
-
});
|
821
|
-
});
|
822
|
-
|
823
|
-
describe('Additional Settings: Details section', () => {
|
824
|
-
abortEarlySetup();
|
825
|
-
before(() => {
|
826
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions and options and expanding additional settings accordion')
|
827
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
828
|
-
multipleSelectionPage.steps.addQuestionInstructions();
|
829
|
-
multipleSelectionPage.steps.addOptionsText(4);
|
830
|
-
multipleSelectionPage.steps.expandAdditonalSettings();
|
831
|
-
});
|
832
|
-
|
833
|
-
multipleSelectionPage.tests.verifyDetailsSection();
|
834
|
-
});
|
835
|
-
});
|