itemengine-cypress-automation 1.0.204 → 1.0.205
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioPlayerNew/audioOverviewAndTranscript.js +2 -2
- package/cypress/e2e/ILC/ChartsBar/Scoring/addAndDeleteBarAllOrNothingScoring.js +302 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/manuallyAndNonScored.js +282 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +385 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +386 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +386 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +337 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -1
- package/cypress/e2e/ILC/ChartsBar/chartFunctionalitySpecifyCorrectAnswerSection.js +258 -0
- package/cypress/e2e/ILC/ChartsBar/checkAnswerFunctionalityForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/ChartsBar/gridSettings.js +439 -0
- package/cypress/e2e/ILC/ChartsBar/headerSection.js +105 -0
- package/cypress/e2e/ILC/ChartsBar/labelOptionsSection.js +450 -0
- package/cypress/e2e/ILC/ChartsBar/specifyCorrectAnswerSection.js +91 -0
- package/cypress/e2e/ILC/ChartsBar/toolSettings.js +73 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +3 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneMinimumAndPenaltyScoring.js +6 -6
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettings.js +169 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDraggableOptionProperties.js +223 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDraggableOptionsPanel.js +119 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDropzoneBorderStyleProperties.js +113 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDropzoneProperties.js +251 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationLayoutProperties.js +277 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +0 -2
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +1 -5
- package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +4 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +14 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/styleAndLayoutCutomization.js +378 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +479 -0
- package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +3 -1
- package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsCellShadeCountBasics.js +7 -7
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingPenaltyScoring.js +1 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/manuallyAndNonScored.js +1 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -3
- package/cypress/e2e/ILC/ListOrderingDropdown/minimumScoringPenaltyPointsAndRoundingDropdown.js +7 -7
- package/cypress/e2e/ILC/ListOrderingDropdown/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +3 -4
- package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +10 -9
- package/cypress/e2e/ILC/Matching/toolSettings.js +1 -0
- package/cypress/e2e/ILC/MultipleSelection/additionalSettings.js +1 -0
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +36 -16
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +326 -176
- package/cypress/e2e/ILC/MultipleSelection/blockCreateItem.js +2 -2
- package/cypress/e2e/ILC/MultipleSelection/manuallyAndNonScoredScoring.js +37 -15
- package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsBasic.js +38 -17
- package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +441 -186
- package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsBasic.js +33 -14
- package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +330 -164
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/manuallyAndNonScored.js +1 -1
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +4 -4
- package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +20 -7
- package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +83 -66
- package/cypress/e2e/ILC/SingleSelection/blockCreateItem.js +2 -2
- package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +25 -17
- package/cypress/e2e/ILC/SingleSelection/trueOrFalseCreateItem.js +2 -2
- package/cypress/e2e/ILC/SingleSelectionGridNew/additionalSettings.js +89 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +3 -3
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +2 -2
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -2
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -2
- package/cypress/e2e/ILC/VideoResponseNew/studentViewSettingsCompactRecorderStyle.js +0 -2
- package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingPenaltyScoring.js +1 -1
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsBasic.js +15 -15
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +21 -21
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +17 -17
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +21 -21
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/toleranceThresholdScoring.js +1 -1
- package/cypress/e2e/ILC/chartsDotsPlot/selectChartTypeSection.js +8 -4
- package/cypress/e2e/ILC/chartsDotsPlot/toolSettings.js +0 -1
- package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
- package/cypress/pages/audioResponsePage.js +1 -1
- package/cypress/pages/chartsBarPage.js +785 -5
- package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -0
- package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
- package/cypress/pages/components/barAndLineChartComponent.js +180 -9
- package/cypress/pages/components/chartsCommonComponent.js +1 -0
- package/cypress/pages/components/connectorStyleStyleAndLayoutCustomizationComponent.js +77 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +2 -3
- package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +24 -7
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +8 -4
- package/cypress/pages/components/gridQuestionCommonComponent.js +1 -1
- package/cypress/pages/components/imageCanvasComponent.js +112 -2
- package/cypress/pages/components/index.js +1 -0
- package/cypress/pages/components/layoutSectionComponent.js +4 -3
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +960 -3
- package/cypress/pages/drawingResponsePage.js +2 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +4 -3
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +18 -3
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +65 -3
- package/cypress/pages/listOrderingPage.js +3 -3
- package/cypress/pages/multipleSelectionPage.js +77 -25
- package/cypress/pages/rulerPage.js +5 -0
- package/cypress/pages/singleSelectionPage.js +40 -1
- package/cypress/pages/videoResponsePage.js +1 -1
- package/package.json +1 -1
@@ -0,0 +1,337 @@
|
|
1
|
+
import { chartsBarPage } from "../../../../pages/chartsBarPage";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Create Item page - List ordering: Preview tab scoring', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Question preview: Auto scored - Partial different weights: Minimum scoring', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
chartsBarPage.steps.navigateToCreateQuestion('charts');
|
13
|
+
cy.barsPreLoaderWait();
|
14
|
+
chartsBarPage.steps.addTextInQuestionInstructionsInputField('Set the bar on the chart for the profits of the years');
|
15
|
+
chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
16
|
+
chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 2, range: 10 });
|
17
|
+
chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 1, value: 2, range: 10 });
|
18
|
+
chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 3, value: 3, range: 10 });
|
19
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 3, range: 10 });
|
20
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 1, value: 4, range: 10 });
|
21
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 6, range: 10 });
|
22
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 3, value: 5, range: 10 });
|
23
|
+
chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
24
|
+
chartsBarPage.steps.allotPartialDifferentWeightsPoints({ 0: 1, 1: 6, 2: 3, 3: 2 });
|
25
|
+
});
|
26
|
+
|
27
|
+
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', () => {
|
28
|
+
chartsBarPage.steps.expandMinimumScoringDropdown();
|
29
|
+
chartsBarPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
30
|
+
chartsBarPage.steps.allotMinimumPoints(2);
|
31
|
+
chartsBarPage.steps.switchToPreviewTab();
|
32
|
+
chartsBarPage.steps.switchToGradingView();
|
33
|
+
chartsBarPage.steps.verifyPreviewScore(2, 12);
|
34
|
+
chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
35
|
+
});
|
36
|
+
|
37
|
+
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', () => {
|
38
|
+
chartsBarPage.steps.resetQuestionPreview();
|
39
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 5, range: 10 });
|
40
|
+
chartsBarPage.steps.verifyPreviewScore(2, 12);
|
41
|
+
chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
42
|
+
});
|
43
|
+
|
44
|
+
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 user should be awarded zero points', () => {
|
45
|
+
chartsBarPage.steps.switchToEditTab();
|
46
|
+
chartsBarPage.steps.expandMinimumScoringDropdown();
|
47
|
+
chartsBarPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
48
|
+
chartsBarPage.steps.allotMinimumPoints(2);
|
49
|
+
chartsBarPage.steps.switchToPreviewTab();
|
50
|
+
chartsBarPage.steps.switchToGradingView();
|
51
|
+
chartsBarPage.steps.verifyPreviewScore(0, 12);
|
52
|
+
chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
53
|
+
});
|
54
|
+
|
55
|
+
it('When the user has selected \'Award minimum score only if attempted\' from the minimum scoring dropdown, attempts the question incorrectly, the user should be awarded with minimum points', () => {
|
56
|
+
chartsBarPage.steps.resetQuestionPreview();
|
57
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 5, range: 10 });
|
58
|
+
chartsBarPage.steps.verifyPreviewScore(2, 12);
|
59
|
+
});
|
60
|
+
|
61
|
+
it('When the user attempts the question partially correct such that points of the correctly attempted option are greater than minimum points, then the user should be awarded with points as per the correctly attempted response', () => {
|
62
|
+
chartsBarPage.steps.resetQuestionPreview();
|
63
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 5, range: 10 });
|
64
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 4, range: 10 });
|
65
|
+
chartsBarPage.steps.verifyPreviewScore(6, 12);
|
66
|
+
});
|
67
|
+
|
68
|
+
it('When the user attempts the question partially correct such that minimum points are greater than points of the correctly attempted option, then the user should be awarded with minimum points', () => {
|
69
|
+
chartsBarPage.steps.resetQuestionPreview();
|
70
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
71
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
72
|
+
chartsBarPage.steps.verifyPreviewScore(2, 12);
|
73
|
+
});
|
74
|
+
});
|
75
|
+
|
76
|
+
describe('Question preview: Auto scored - Partial different weights: Rounding', () => {
|
77
|
+
abortEarlySetup();
|
78
|
+
before(() => {
|
79
|
+
chartsBarPage.steps.navigateToCreateQuestion('charts');
|
80
|
+
cy.barsPreLoaderWait();
|
81
|
+
chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
82
|
+
chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 2, range: 10 });
|
83
|
+
chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 1, value: 2, range: 10 });
|
84
|
+
chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 3, value: 3, range: 10 });
|
85
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 3, range: 10 });
|
86
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 1, value: 4, range: 10 });
|
87
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 6, range: 10 });
|
88
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 3, value: 5, range: 10 });
|
89
|
+
chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
90
|
+
chartsBarPage.steps.allotPartialDifferentWeightsPoints({ 0: 2.67, 1: 1.99, 2: 1.34, 3: 4.5 });
|
91
|
+
});
|
92
|
+
|
93
|
+
it('When the user sets \'Rounding\' to \'Round down if <=0.99\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value greater than 0.5 and less than 0.99, then the points awarded should be rounded down to the nearest integer value', () => {
|
94
|
+
chartsBarPage.steps.expandRoundingDropdown();
|
95
|
+
chartsBarPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.99');
|
96
|
+
chartsBarPage.steps.switchToPreviewTab();
|
97
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
98
|
+
chartsBarPage.steps.verifyPreviewScore(2, 10.5);
|
99
|
+
});
|
100
|
+
|
101
|
+
it('When the user has set \'Rounding\' to \'Round down if <=0.99\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.99, then the points awarded should be rounded down to the nearest integer value', () => {
|
102
|
+
chartsBarPage.steps.resetQuestionPreview();
|
103
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 4, range: 10 });
|
104
|
+
chartsBarPage.steps.verifyPreviewScore(1, 10.5);
|
105
|
+
});
|
106
|
+
|
107
|
+
it('When the user sets \'Rounding\' to \'Round down if <=0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value less than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
|
108
|
+
chartsBarPage.steps.switchToEditTab();
|
109
|
+
chartsBarPage.steps.expandRoundingDropdown();
|
110
|
+
chartsBarPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50');
|
111
|
+
chartsBarPage.steps.switchToPreviewTab();
|
112
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 6, range: 10 });
|
113
|
+
chartsBarPage.steps.verifyPreviewScore(1, 10.5);
|
114
|
+
});
|
115
|
+
|
116
|
+
it('When the user has set \'Rounding\' to \'Round down if <=0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
|
117
|
+
chartsBarPage.steps.resetQuestionPreview();
|
118
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 5, range: 10 });
|
119
|
+
chartsBarPage.steps.verifyPreviewScore(4, 10.5);
|
120
|
+
});
|
121
|
+
|
122
|
+
it('When the user sets \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value less than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
|
123
|
+
chartsBarPage.steps.switchToEditTab();
|
124
|
+
chartsBarPage.steps.expandRoundingDropdown();
|
125
|
+
chartsBarPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50; Round up if > 0.50');
|
126
|
+
chartsBarPage.steps.switchToPreviewTab();
|
127
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 6, range: 10 });
|
128
|
+
chartsBarPage.steps.verifyPreviewScore(1, 10.5);
|
129
|
+
});
|
130
|
+
|
131
|
+
it('When the user has set \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
|
132
|
+
chartsBarPage.steps.resetQuestionPreview();
|
133
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 5, range: 10 });
|
134
|
+
chartsBarPage.steps.verifyPreviewScore(4, 10.5);
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When the user has set \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value greater than 0.50, then the points awarded should be rounded up to the nearest integer value', () => {
|
138
|
+
chartsBarPage.steps.resetQuestionPreview();
|
139
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
140
|
+
chartsBarPage.steps.verifyPreviewScore(3, 10.5);
|
141
|
+
});
|
142
|
+
|
143
|
+
it('When \'Round negative score to zero\' is in checked state and the user attempts the question incorrectly, then the user should be awarded with 0 points', () => {
|
144
|
+
cy.log('Pre-step: Setting penalty scoring to \'Penalty points for the entire question\', allotting penalty points')
|
145
|
+
chartsBarPage.steps.switchToEditTab();
|
146
|
+
chartsBarPage.steps.expandPenaltyScoringDropdown();
|
147
|
+
chartsBarPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
|
148
|
+
chartsBarPage.steps.allotPenaltyPoints(4);
|
149
|
+
chartsBarPage.steps.switchToPreviewTab();
|
150
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 1, range: 10 });
|
151
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
152
|
+
chartsBarPage.steps.verifyPreviewScore(0, 10.5);
|
153
|
+
});
|
154
|
+
|
155
|
+
it('When the user unchecks \'Round negative score to zero\' checkbox and the user attempts the question incorrectly, then the user should be awarded with negative points', () => {
|
156
|
+
chartsBarPage.steps.switchToEditTab();
|
157
|
+
chartsBarPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
|
158
|
+
chartsBarPage.steps.switchToPreviewTab();
|
159
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 1, range: 10 });
|
160
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
161
|
+
chartsBarPage.steps.verifyPreviewScore(-4, 10.5);
|
162
|
+
});
|
163
|
+
});
|
164
|
+
|
165
|
+
describe('Question preview: Auto scored - Partial different weights: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
|
166
|
+
abortEarlySetup();
|
167
|
+
before(() => {
|
168
|
+
chartsBarPage.steps.navigateToCreateQuestion('charts');
|
169
|
+
cy.barsPreLoaderWait();
|
170
|
+
chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
171
|
+
chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 2, range: 10 });
|
172
|
+
chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 1, value: 2, range: 10 });
|
173
|
+
chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 3, value: 3, range: 10 });
|
174
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 3, range: 10 });
|
175
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 1, value: 4, range: 10 });
|
176
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 6, range: 10 });
|
177
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 3, value: 5, range: 10 });
|
178
|
+
chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
179
|
+
chartsBarPage.steps.allotPartialDifferentWeightsPoints({ 0: 9, 1: 6, 2: 3, 3: 2 });
|
180
|
+
//chartsBarPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
181
|
+
});
|
182
|
+
|
183
|
+
//Penalty points for the entire question
|
184
|
+
it('When the user sets penalty scoring to \'Penalty points for the entire question\', allots penalty points and attempts the question incorrectly, then the user should be awarded with negative points', () => {
|
185
|
+
chartsBarPage.steps.expandPenaltyScoringDropdown();
|
186
|
+
chartsBarPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
|
187
|
+
chartsBarPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
|
188
|
+
chartsBarPage.steps.allotPenaltyPoints(4);
|
189
|
+
chartsBarPage.steps.switchToPreviewTab();
|
190
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 1, range: 10 });
|
191
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
192
|
+
chartsBarPage.steps.verifyPreviewScore(-4, 20);
|
193
|
+
});
|
194
|
+
|
195
|
+
it('When the user attempts the question correctly along with an incorrect response, then penalty points should get deducted from the awarded points', () => {
|
196
|
+
chartsBarPage.steps.resetQuestionPreview();
|
197
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
198
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
199
|
+
chartsBarPage.steps.verifyPreviewScore(5, 20);
|
200
|
+
});
|
201
|
+
|
202
|
+
it('When the user attempts the question correctly along with multiple incorrect responses, then penalty points should get deducted from the awarded points only once, the deducted penalty points should not increase as per number of attempted incorrect responses', () => {
|
203
|
+
chartsBarPage.steps.resetQuestionPreview();
|
204
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
205
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
206
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 1, range: 10 });
|
207
|
+
chartsBarPage.steps.verifyPreviewScore(5, 20);
|
208
|
+
});
|
209
|
+
|
210
|
+
it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
|
211
|
+
chartsBarPage.steps.switchToEditTab();
|
212
|
+
chartsBarPage.steps.expandMinimumScoringDropdown();
|
213
|
+
chartsBarPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
214
|
+
chartsBarPage.steps.allotMinimumPoints(3);
|
215
|
+
chartsBarPage.steps.switchToPreviewTab();
|
216
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
217
|
+
chartsBarPage.steps.verifyPreviewScore(3, 20);
|
218
|
+
cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
|
219
|
+
chartsBarPage.steps.switchToEditTab();
|
220
|
+
chartsBarPage.steps.expandMinimumScoringDropdown();
|
221
|
+
chartsBarPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
|
222
|
+
});
|
223
|
+
|
224
|
+
//Penalty points for each incorrect option - Specify total penalty points
|
225
|
+
it('When the user sets penalty scoring to \'Penalty points for each incorrect bar\', and \'Specify total penalty points\' radio button in checked state, allots total penalty points and attempts the question incorrectly, then the user should be awarded with negative points of all the empty and incorrect option', () => {
|
226
|
+
chartsBarPage.steps.expandPenaltyScoringDropdown();
|
227
|
+
chartsBarPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect bar');
|
228
|
+
chartsBarPage.steps.allotTotalPenaltyPoints(4);
|
229
|
+
chartsBarPage.steps.switchToPreviewTab();
|
230
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
231
|
+
chartsBarPage.steps.verifyPreviewScore(-4, 20);
|
232
|
+
});
|
233
|
+
|
234
|
+
it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
|
235
|
+
chartsBarPage.steps.resetQuestionPreview();
|
236
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
237
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
238
|
+
chartsBarPage.steps.verifyPreviewScore(6, 20);
|
239
|
+
});
|
240
|
+
|
241
|
+
it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect option should get deducted from the awarded points', () => {
|
242
|
+
chartsBarPage.steps.resetQuestionPreview();
|
243
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
244
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
245
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 1, range: 10 });
|
246
|
+
chartsBarPage.steps.verifyPreviewScore(6, 20);
|
247
|
+
});
|
248
|
+
|
249
|
+
it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
|
250
|
+
chartsBarPage.steps.switchToEditTab();
|
251
|
+
chartsBarPage.steps.expandMinimumScoringDropdown();
|
252
|
+
chartsBarPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
253
|
+
chartsBarPage.steps.allotMinimumPoints(3);
|
254
|
+
chartsBarPage.steps.switchToPreviewTab();
|
255
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
256
|
+
chartsBarPage.steps.verifyPreviewScore(3, 20);
|
257
|
+
cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
|
258
|
+
chartsBarPage.steps.switchToEditTab();
|
259
|
+
chartsBarPage.steps.expandMinimumScoringDropdown();
|
260
|
+
chartsBarPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
|
261
|
+
});
|
262
|
+
|
263
|
+
//Penalty points for each incorrect option - Specify points for each incorrect option
|
264
|
+
it('When the user has set penalty scoring to \'Penalty points for each incorrect bar\', and \'Specify total penalty points\' radio button in checked state, allots total penalty points and attempts the question incorrectly, then the user should be awarded with negative points for the incorrect options', () => {
|
265
|
+
chartsBarPage.steps.selectPenaltyPointsForEachIncorrectOptionType('specify points for each incorrect bar');
|
266
|
+
chartsBarPage.steps.allotPenaltyPointsForEachIncorrectOption(4);
|
267
|
+
chartsBarPage.steps.switchToPreviewTab();
|
268
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
269
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 1, range: 10 });
|
270
|
+
chartsBarPage.steps.verifyPreviewScore(-16, 20);
|
271
|
+
});
|
272
|
+
|
273
|
+
it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
|
274
|
+
chartsBarPage.steps.resetQuestionPreview();
|
275
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
276
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
277
|
+
chartsBarPage.steps.verifyPreviewScore(5, 20);
|
278
|
+
});
|
279
|
+
|
280
|
+
it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect option should get deducted from the awarded points', () => {
|
281
|
+
chartsBarPage.steps.resetQuestionPreview();
|
282
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
283
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
284
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 1, range: 10 });
|
285
|
+
chartsBarPage.steps.verifyPreviewScore(1, 20);
|
286
|
+
});
|
287
|
+
|
288
|
+
it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
|
289
|
+
chartsBarPage.steps.switchToEditTab();
|
290
|
+
chartsBarPage.steps.expandMinimumScoringDropdown();
|
291
|
+
chartsBarPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
292
|
+
chartsBarPage.steps.allotMinimumPoints(3);
|
293
|
+
chartsBarPage.steps.switchToPreviewTab();
|
294
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
295
|
+
chartsBarPage.steps.verifyPreviewScore(3, 20);
|
296
|
+
cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
|
297
|
+
chartsBarPage.steps.switchToEditTab();
|
298
|
+
chartsBarPage.steps.expandMinimumScoringDropdown();
|
299
|
+
chartsBarPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
|
300
|
+
});
|
301
|
+
|
302
|
+
//Penalty points for each incorrect option - Automatically set penalty for each incorrect option to total points / no. of incorrect option
|
303
|
+
it('When the user has set penalty scoring to \'Penalty points for each incorrect bar\', and checks \'Automatically set penalty for each incorrect option to total points / no. of incorrect option\' checkbox and attempts the question incorrectly, then the user should be awarded with negative points for the incorrect option', () => {
|
304
|
+
chartsBarPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
|
305
|
+
chartsBarPage.steps.switchToPreviewTab();
|
306
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
307
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 1, range: 10 });
|
308
|
+
chartsBarPage.steps.verifyPreviewScore(-20, 20);
|
309
|
+
});
|
310
|
+
|
311
|
+
it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
|
312
|
+
chartsBarPage.steps.resetQuestionPreview();
|
313
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
314
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 1, range: 10 });
|
315
|
+
chartsBarPage.steps.verifyPreviewScore(-6, 20);
|
316
|
+
});
|
317
|
+
|
318
|
+
it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect option should get deducted from the awarded points', () => {
|
319
|
+
chartsBarPage.steps.resetQuestionPreview();
|
320
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
|
321
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 1, range: 10 });
|
322
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 1, range: 10 });
|
323
|
+
chartsBarPage.steps.verifyPreviewScore(-6, 20);
|
324
|
+
});
|
325
|
+
|
326
|
+
it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
|
327
|
+
chartsBarPage.steps.switchToEditTab();
|
328
|
+
chartsBarPage.steps.expandMinimumScoringDropdown();
|
329
|
+
chartsBarPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
330
|
+
chartsBarPage.steps.allotMinimumPoints(3);
|
331
|
+
chartsBarPage.steps.switchToPreviewTab();
|
332
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 1, value: 1, range: 10 });
|
333
|
+
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 1, range: 10 });
|
334
|
+
chartsBarPage.steps.verifyPreviewScore(3, 20);
|
335
|
+
});
|
336
|
+
});
|
337
|
+
});
|
@@ -139,7 +139,6 @@ describe('Create item page - Charts - Bar: Partial equal weights scoring with al
|
|
139
139
|
chartsBarPage.steps.verifyCorrectAnswerSectionNotExist(); */
|
140
140
|
});
|
141
141
|
|
142
|
-
|
143
142
|
it('When the user attempts the question with partially correct exclusively from the correct accordion, then the user should be awarded with points for the correctly set bars and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icons should be displayed on the incorrect bars, correct/incorrect status message should not be displayed and correct answer section should be displayed with the correct answers from the correct accordion', () => {
|
144
143
|
chartsBarPage.steps.resetQuestionPreview();
|
145
144
|
chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 1, range: 10 });
|
@@ -0,0 +1,258 @@
|
|
1
|
+
import { chartsBarPage } from "../../../pages";
|
2
|
+
import utilities from "../../../support/helpers/utilities";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
const barBackgroundColor = ['rgb(46, 169, 89)', 'rgb(6, 117, 244)', 'rgb(219, 124, 0)'];
|
6
|
+
const barLabels = ['Bar 1', 'Bar 2', 'Bar 3']
|
7
|
+
|
8
|
+
describe('Specify correct answer - Chart', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Control buttons functionality', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
chartsBarPage.steps.navigateToCreateQuestion('charts');
|
17
|
+
cy.barsPreLoaderWait();
|
18
|
+
chartsBarPage.steps.selectAddBarOrPointToolbarOption();
|
19
|
+
});
|
20
|
+
|
21
|
+
it('By default, all the control options should be in disabled state', () => {
|
22
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
23
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Reset'));
|
24
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
25
|
+
});
|
26
|
+
|
27
|
+
it('When user updates a bar label, then the undo and reset button should be displayed in enabled state and redo button should be in disabled state', () => {
|
28
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 1, range: 10 });
|
29
|
+
utilities.verifyElementNotDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
30
|
+
utilities.verifyElementNotDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Reset'));
|
31
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
32
|
+
});
|
33
|
+
|
34
|
+
it('When user hovers on the enabled undo and reset button, then tooltips \'Undo\' and \'Reset\' should be displayed', () => {
|
35
|
+
chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo')
|
36
|
+
.verifyTooltip('Undo');
|
37
|
+
chartsBarPage.controlOptionsSpecifyCorrectAnswer('Reset')
|
38
|
+
.verifyTooltip('Reset');
|
39
|
+
});
|
40
|
+
|
41
|
+
it('CSS of the tooltip text', { tags: 'css' }, () => {
|
42
|
+
utilities.triggerMouseover(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
43
|
+
utilities.verifyCSS(chartsBarPage.tooltipText(), {
|
44
|
+
'color': css.color.whiteText,
|
45
|
+
'font-size': css.fontSize.small,
|
46
|
+
'font-weight': css.fontWeight.regular,
|
47
|
+
'background-color': css.color.tooltipBg
|
48
|
+
});
|
49
|
+
utilities.triggerMouseout(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
50
|
+
utilities.triggerMouseover(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Reset'));
|
51
|
+
utilities.verifyCSS(chartsBarPage.tooltipText(), {
|
52
|
+
'color': css.color.whiteText,
|
53
|
+
'font-size': css.fontSize.small,
|
54
|
+
'font-weight': css.fontWeight.regular,
|
55
|
+
'background-color': css.color.tooltipBg
|
56
|
+
});
|
57
|
+
utilities.triggerMouseout(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Reset'));
|
58
|
+
});
|
59
|
+
|
60
|
+
it('Accessibility of the tooltip text', { tags: 'a11y' }, () => {
|
61
|
+
utilities.triggerMouseover(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
62
|
+
utilities.verifyElementVisibilityState(chartsBarPage.tooltipText(), 'visible');
|
63
|
+
cy.checkAccessibility(chartsBarPage.tooltipText().parents('[role="tooltip"]'));
|
64
|
+
utilities.triggerMouseout(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
65
|
+
utilities.verifyElementVisibilityState(chartsBarPage.tooltipText(), 'notExist');
|
66
|
+
utilities.triggerMouseover(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Reset'));
|
67
|
+
utilities.verifyElementVisibilityState(chartsBarPage.tooltipText(), 'visible');
|
68
|
+
cy.checkAccessibility(chartsBarPage.tooltipText().parents('[role="tooltip"]'));
|
69
|
+
utilities.triggerMouseout(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Reset'));
|
70
|
+
utilities.verifyElementVisibilityState(chartsBarPage.tooltipText(), 'notExist');
|
71
|
+
});
|
72
|
+
|
73
|
+
it('When user clicks on a undo button, then the previously performed action should be reverted', () => {
|
74
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Undo');
|
75
|
+
chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex: 0, barValue: 0, range: 10 });
|
76
|
+
});
|
77
|
+
|
78
|
+
it('When user has clicked on undo button, then the redo button should be enabled', () => {
|
79
|
+
utilities.verifyElementNotDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
80
|
+
});
|
81
|
+
|
82
|
+
it('When user hovers on the enabled redo button, then tooltip \'Redo\' should be displayed', () => {
|
83
|
+
chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo')
|
84
|
+
.verifyTooltip('Redo');
|
85
|
+
});
|
86
|
+
|
87
|
+
it('CSS of the tooltip text', { tags: 'css' }, () => {
|
88
|
+
utilities.triggerMouseover(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
89
|
+
utilities.verifyCSS(chartsBarPage.tooltipText(), {
|
90
|
+
'color': css.color.whiteText,
|
91
|
+
'font-size': css.fontSize.small,
|
92
|
+
'font-weight': css.fontWeight.regular,
|
93
|
+
'background-color': css.color.tooltipBg
|
94
|
+
});
|
95
|
+
utilities.triggerMouseout(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
96
|
+
});
|
97
|
+
|
98
|
+
it('Accessibility of the tooltip text', { tags: 'a11y' }, () => {
|
99
|
+
utilities.triggerMouseover(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
100
|
+
utilities.verifyElementVisibilityState(chartsBarPage.tooltipText(), 'visible');
|
101
|
+
cy.checkAccessibility(chartsBarPage.tooltipText().parents('[role="tooltip"]'));
|
102
|
+
utilities.triggerMouseout(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
103
|
+
utilities.verifyElementVisibilityState(chartsBarPage.tooltipText(), 'notExist');
|
104
|
+
});
|
105
|
+
|
106
|
+
it('When the user clicks on redo button, then the last reverted action should be performed again and the button should be disabled and undo button should be enabled', () => {
|
107
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Redo');
|
108
|
+
chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex: 0, barValue: 1, range: 10 });
|
109
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
110
|
+
utilities.verifyElementNotDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
111
|
+
});
|
112
|
+
|
113
|
+
it('When user performs multiple actions and clicks on undo button then undo button should remain enabled', () => {
|
114
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 3, range: 10 })
|
115
|
+
chartsBarPage.steps.editBarLabelInSpecifyCorrectAnswer(0, 'Day 1');
|
116
|
+
});
|
117
|
+
|
118
|
+
it('When the user clicks on undo button until the graph reaches its initial state, then the undo button should be disabled and redo button should be enabled', () => {
|
119
|
+
for (var i = 0; i < 5; i++) {
|
120
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Undo');
|
121
|
+
}
|
122
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
123
|
+
utilities.verifyElementNotDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
124
|
+
});
|
125
|
+
|
126
|
+
it('When the user clicks on redo button until the graph reaches its latest state, then the redo button should be disabled and undo button should be enabled', () => {
|
127
|
+
for (var i = 0; i < 5; i++) {
|
128
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Redo');
|
129
|
+
}
|
130
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
131
|
+
utilities.verifyElementNotDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
132
|
+
});
|
133
|
+
|
134
|
+
//Add bar
|
135
|
+
it('When user adds a bar and and clicks on undo button, then the previously performed action should be reverted', () => {
|
136
|
+
cy.log('Pre-step: Reset the chart');
|
137
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Reset');
|
138
|
+
chartsBarPage.steps.confirmReset();
|
139
|
+
chartsBarPage.steps.addBarOrPointInChartInSpecifyCorrectAnswerSection();
|
140
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Undo');
|
141
|
+
utilities.verifyElementCount(chartsBarPage.specifyCorrectAnswerBar(), 3);
|
142
|
+
});
|
143
|
+
|
144
|
+
it('When user has clicked on undo button, then the redo button should be enabled', () => {
|
145
|
+
utilities.verifyElementNotDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
146
|
+
});
|
147
|
+
|
148
|
+
it('When the user clicks on redo button, then the last reverted action should be performed again and the button should be disabled and undo button should be enabled', () => {
|
149
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Redo');
|
150
|
+
utilities.verifyElementCount(chartsBarPage.specifyCorrectAnswerBar(), 4);
|
151
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
152
|
+
utilities.verifyElementNotDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
153
|
+
});
|
154
|
+
|
155
|
+
//Delete bar
|
156
|
+
it('When user deletes a bar and clicks on a undo button, then the previously performed action should be reverted', () => {
|
157
|
+
cy.log('Pre-step: Reset the chart');
|
158
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Reset');
|
159
|
+
chartsBarPage.steps.confirmReset();
|
160
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 2, range: 10 });
|
161
|
+
chartsBarPage.steps.deleteBarInSpecifyCorrectAnswer(0);
|
162
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Undo');
|
163
|
+
utilities.verifyElementCount(chartsBarPage.specifyCorrectAnswerBar(), 3);
|
164
|
+
});
|
165
|
+
|
166
|
+
it('When user has clicked on undo button, then the redo button should be enabled', () => {
|
167
|
+
utilities.verifyElementNotDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
168
|
+
});
|
169
|
+
|
170
|
+
it('When the user clicks on redo button, then the last reverted action should be performed again and the button should be disabled and undo button should be enabled', () => {
|
171
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Redo');
|
172
|
+
utilities.verifyElementCount(chartsBarPage.specifyCorrectAnswerBar(), 2);
|
173
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
174
|
+
utilities.verifyElementNotDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
175
|
+
});
|
176
|
+
|
177
|
+
//Reset button
|
178
|
+
it('When the user clicks on Reset button then reset popup should be displayed', () => {
|
179
|
+
cy.log('Pre-step: Editing the graph');
|
180
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 10, range: 10 });
|
181
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 1, value: 2, range: 10 });
|
182
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Reset');
|
183
|
+
utilities.verifyElementVisibilityState(chartsBarPage.dialogBox(), 'visible');
|
184
|
+
});
|
185
|
+
|
186
|
+
chartsBarPage.tests.verifyResetPopupContentWithCSSAndA11y('chart');
|
187
|
+
|
188
|
+
it('When user clicks on cancel button in reset popup, then reset popup should close and chart should not be reset', () => {
|
189
|
+
chartsBarPage.steps.cancelReset();
|
190
|
+
chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex: 0, barValue: 10, range: 10 });
|
191
|
+
chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex: 1, barValue: 2, range: 10 });
|
192
|
+
});
|
193
|
+
|
194
|
+
it('When the user clicks on Reset button and confirms reset, then all the chart actions should be reverted and chart should be reverted to default state', () => {
|
195
|
+
chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Reset');
|
196
|
+
chartsBarPage.steps.confirmReset();
|
197
|
+
utilities.verifyElementNotDisabled(chartsBarPage.specifyCorrectAnswerToolsAddBarOrPointButton());
|
198
|
+
utilities.verifyElementVisibilityState(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'), 'visible');
|
199
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo'));
|
200
|
+
utilities.verifyElementVisibilityState(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'), 'visible');
|
201
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo'));
|
202
|
+
utilities.verifyElementVisibilityState(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Reset'), 'visible');
|
203
|
+
utilities.verifyElementDisabled(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Reset'));
|
204
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBarLabel(), 0), 'Bar 1');
|
205
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBarLabel(), 1), 'Bar 2');
|
206
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBarLabel(), 2), 'Bar 3');
|
207
|
+
chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex: 0, barValue: 0, range: 10 });
|
208
|
+
chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex: 1, barValue: 0, range: 10 });
|
209
|
+
chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex: 2, barValue: 0, range: 10 });
|
210
|
+
});
|
211
|
+
|
212
|
+
it('CSS of specify correct answer section tab contents', { tags: 'css' }, () => {
|
213
|
+
utilities.verifyCSS(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo').find('svg'), {
|
214
|
+
'fill': css.color.secondaryBtnDisabled
|
215
|
+
});
|
216
|
+
utilities.verifyCSS(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Redo').find('svg'), {
|
217
|
+
'fill': css.color.secondaryBtnDisabled
|
218
|
+
});
|
219
|
+
utilities.verifyCSS(chartsBarPage.controlOptionsSpecifyCorrectAnswer('Undo').find('svg'), {
|
220
|
+
'fill': css.color.secondaryBtnDisabled
|
221
|
+
});
|
222
|
+
});
|
223
|
+
});
|
224
|
+
|
225
|
+
describe('Charts Functionality', () => {
|
226
|
+
abortEarlySetup();
|
227
|
+
before(() => {
|
228
|
+
chartsBarPage.steps.navigateToCreateQuestion('charts');
|
229
|
+
cy.barsPreLoaderWait();
|
230
|
+
});
|
231
|
+
|
232
|
+
it('Chart should be displayed in specify correct answer section', () => {
|
233
|
+
utilities.verifyElementVisibilityState(chartsBarPage.chartContainerSpecifyCorrectAnswer(), 'visible');
|
234
|
+
});
|
235
|
+
|
236
|
+
it('User should be able to set bars in specify correct answer section', () => {
|
237
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 2, range: 10 });
|
238
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 1, value: 3, range: 10 });
|
239
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 4, range: 10 });
|
240
|
+
});
|
241
|
+
|
242
|
+
it('User should be able to update the plotted bars', () => {
|
243
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 3, range: 10 });
|
244
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 1, value: 4, range: 10 });
|
245
|
+
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 1, range: 10 });
|
246
|
+
});
|
247
|
+
|
248
|
+
barBackgroundColor.forEach((color, index) => {
|
249
|
+
chartsBarPage.tests.verifyBarTooltipContentsCSSAndA11yInSpecifyCorrectAnswer(index, color, barLabels[index]);
|
250
|
+
});
|
251
|
+
|
252
|
+
it('When user deletes a bar then bar should be deleted and labels of existing bars should not change', () => {
|
253
|
+
chartsBarPage.steps.deleteBarInSpecifyCorrectAnswer(1);
|
254
|
+
chartsBarPage.steps.verifyBarLabelSpecifyCorrectAnswer(0, 'Bar 1');
|
255
|
+
chartsBarPage.steps.verifyBarLabelSpecifyCorrectAnswer(1, 'Bar 3');
|
256
|
+
});
|
257
|
+
});
|
258
|
+
});
|
@@ -44,7 +44,7 @@ describe('Create item page - Chart - Bar:Check answer functionality', () => {
|
|
44
44
|
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 3, range: 10 });
|
45
45
|
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 6, range: 10 });
|
46
46
|
chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 3, value: 5, range: 10 });
|
47
|
-
chartsBarPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
47
|
+
//chartsBarPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
48
48
|
chartsBarPage.steps.switchToPreviewTab();
|
49
49
|
break;
|
50
50
|
case 'Item preview':
|