itemengine-cypress-automation 1.0.132 → 1.0.133
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/DesmosGraphing/previewTabContent.smoke.js +1 -2
- package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +53 -54
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +0 -149
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +312 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsBasic.js +71 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/GeogebraActivity/additionalSettings.js +98 -0
- package/cypress/e2e/ILC/GeogebraActivity/editTabScoringSection.js +56 -0
- package/cypress/e2e/ILC/GeogebraActivity/gradingViewAndCorrectAnswerViewContents.smoke.js +106 -0
- package/cypress/e2e/ILC/GeogebraActivity/headerSection.js +74 -0
- package/cypress/e2e/ILC/GeogebraActivity/previewTabContent.smoke.js +91 -0
- package/cypress/e2e/ILC/GeogebraActivity/questionInstructions.js +28 -0
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingPenaltyScoring.js +79 -0
- package/cypress/e2e/ILC/Graphing/Scoring/manuallyAndNonScoredScoring.js +253 -0
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +307 -0
- package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +84 -0
- package/cypress/e2e/ILC/Graphing/editTabScoringSection.js +105 -0
- package/cypress/e2e/ILC/Graphing/headerSection.js +77 -0
- package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +916 -0
- package/cypress/e2e/ILC/Graphing/minimumScoringPenaltyPointsAndRoundingDropdown.js +57 -0
- package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/Graphing/specifyCorrectAnswerSection.js +72 -0
- package/cypress/e2e/ILC/Graphing/studentViewSettings.js +120 -0
- package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +858 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +337 -4
- package/cypress/fixtures/constants.js +1 -1
- package/cypress/fixtures/theme/ilc.json +3 -1
- package/cypress/pages/components/additionalSettingsAccessibilitySectionComponent.js +66 -0
- package/cypress/pages/components/additionalSettingsPanel.js +95 -90
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +9 -7
- package/cypress/pages/components/backgroundImageUploadComponent.js +16 -14
- package/cypress/pages/components/colorPopupComponent.js +14 -17
- package/cypress/pages/components/commonComponents.js +1 -1
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -1
- package/cypress/pages/components/imageCanvasComponent.js +3 -3
- package/cypress/pages/components/index.js +2 -2
- package/cypress/pages/components/opacityComponent.js +1 -1
- package/cypress/pages/components/scoringSectionBaseEditTab.js +18 -0
- package/cypress/pages/components/studentResponseAreaAndLayoutComponent.js +1 -1
- package/cypress/pages/dialogBoxBase.js +1 -1
- package/cypress/pages/drawingResponsePage.js +35 -4
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +2 -2
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +2 -0
- package/cypress/pages/geogebraActivityPage.js +106 -0
- package/cypress/pages/graphingPage.js +1458 -77
- package/cypress/pages/index.js +1 -0
- package/cypress/pages/multipleSelectionPage.js +0 -1
- package/cypress/pages/shortTextResponsePage.js +155 -3
- package/cypress/pages/uploadResponsePage.js +0 -2
- package/package.json +1 -1
@@ -0,0 +1,253 @@
|
|
1
|
+
import { graphingPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
describe('Create Item page - Graphing: Manually and non scored', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Question Preview: Manually Scored', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
14
|
+
cy.barsPreLoaderWait();
|
15
|
+
graphingPage.steps.addTextInQuestionInstructionsInputField('Plot the graph');
|
16
|
+
graphingPage.steps.selectToolOptions(['Circle', 'Polygon']);
|
17
|
+
graphingPage.steps.checkPatternBackground();
|
18
|
+
graphingPage.steps.checkSnapToGridCheckbox();
|
19
|
+
graphingPage.steps.selectGraphToolOptionEditTab('Line');
|
20
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
21
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
22
|
+
graphingPage.steps.selectGraphToolOptionEditTab('Circle');
|
23
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
24
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
25
|
+
graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Polygon');
|
26
|
+
graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
27
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
28
|
+
graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Vector');
|
29
|
+
graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
30
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
31
|
+
graphingPage.steps.expandScoringTypeDropdown();
|
32
|
+
graphingPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
33
|
+
graphingPage.steps.switchToPreviewTab();
|
34
|
+
});
|
35
|
+
|
36
|
+
it('Question instructions and graph along with the graph and the plotted graph in the edit tab should be displayed in the preview tab', () => {
|
37
|
+
graphingPage.steps.verifyQuestionInstructionsTextPreviewTab('Plot the graph');
|
38
|
+
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
|
39
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
40
|
+
utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
|
41
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
42
|
+
});
|
43
|
+
|
44
|
+
graphingPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored');
|
45
|
+
});
|
46
|
+
|
47
|
+
describe('Question Preview: Non Scored', () => {
|
48
|
+
abortEarlySetup();
|
49
|
+
before(() => {
|
50
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
51
|
+
cy.barsPreLoaderWait();
|
52
|
+
graphingPage.steps.addTextInQuestionInstructionsInputField('Plot the graph');
|
53
|
+
graphingPage.steps.selectToolOptions(['Circle', 'Polygon']);
|
54
|
+
graphingPage.steps.checkPatternBackground();
|
55
|
+
graphingPage.steps.checkSnapToGridCheckbox();
|
56
|
+
graphingPage.steps.selectGraphToolOptionEditTab('Line');
|
57
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
58
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
59
|
+
graphingPage.steps.selectGraphToolOptionEditTab('Circle');
|
60
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
61
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
62
|
+
graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Polygon');
|
63
|
+
graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
64
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
65
|
+
graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Vector');
|
66
|
+
graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
67
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
68
|
+
graphingPage.steps.expandScoringTypeDropdown();
|
69
|
+
graphingPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
70
|
+
graphingPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
71
|
+
graphingPage.steps.switchToPreviewTab();
|
72
|
+
});
|
73
|
+
|
74
|
+
graphingPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
|
75
|
+
|
76
|
+
it('When the user selects \'Grading\' view without attempting the question, the correct answer should be displayed in the correct answer section graph', () => {
|
77
|
+
//Preview tab
|
78
|
+
utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
|
79
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
80
|
+
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
|
81
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
82
|
+
graphingPage.steps.switchToGradingView();
|
83
|
+
|
84
|
+
//Correct answer section
|
85
|
+
utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 1);
|
86
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
87
|
+
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 2);
|
88
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
89
|
+
utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
|
90
|
+
|
91
|
+
//Correct/incorrect icon
|
92
|
+
utilities.verifyElementVisibilityState(graphingPage.correctIncorrectStatusMessageText(), 'notExist');
|
93
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
94
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
95
|
+
graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
96
|
+
cy.log('When the user selects \'Check answer\' view without attempting the question, the correct answer should be displayed in the correct answer section graph')
|
97
|
+
graphingPage.steps.checkAnswer();
|
98
|
+
utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
|
99
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
100
|
+
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
|
101
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
102
|
+
graphingPage.steps.verifyCorrectAnswerSectionNotExist();
|
103
|
+
});
|
104
|
+
|
105
|
+
it('When the user attempts the question incorrectly then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed and the attempted graph should be displayed incorrect and the the correct answers should be displayed in the correct answer section graph', () => {
|
106
|
+
graphingPage.steps.resetQuestionPreview();
|
107
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
|
108
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
109
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
110
|
+
graphingPage.steps.switchToGradingView();
|
111
|
+
|
112
|
+
//Preview tab
|
113
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
114
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
115
|
+
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
|
116
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
117
|
+
graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
118
|
+
|
119
|
+
//Correct answer section
|
120
|
+
utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 1);
|
121
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
122
|
+
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 2);
|
123
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
124
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
125
|
+
utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
|
126
|
+
|
127
|
+
//Correct/incorrect icon
|
128
|
+
graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
129
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
130
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
131
|
+
graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
132
|
+
cy.log('When the user attempts the question incorrectly then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed and the attempted graph should be displayed incorrect')
|
133
|
+
graphingPage.steps.checkAnswer();
|
134
|
+
//Preview tab
|
135
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
136
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
137
|
+
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
|
138
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
139
|
+
graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
140
|
+
graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
|
141
|
+
graphingPage.steps.verifyCorrectAnswerSectionNotExist();
|
142
|
+
});
|
143
|
+
|
144
|
+
it('When the user attempts the question partially correct then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed and the attempted graph should be displayed correct and the the correct answers should be displayed in the correct answer section graph', () => {
|
145
|
+
graphingPage.steps.resetQuestionPreview();
|
146
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
|
147
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
148
|
+
graphingPage.steps.switchToGradingView();
|
149
|
+
|
150
|
+
//Preview tab
|
151
|
+
utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
|
152
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
153
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
154
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
155
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
156
|
+
|
157
|
+
//Correct answer section
|
158
|
+
utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 1);
|
159
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
160
|
+
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 2);
|
161
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
162
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
163
|
+
utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
|
164
|
+
|
165
|
+
//Correct/incorrect icon
|
166
|
+
graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
167
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
168
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
169
|
+
graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
170
|
+
cy.log('When the user attempts the question partially correct then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed and the attempted graph should be displayed correct')
|
171
|
+
graphingPage.steps.checkAnswer();
|
172
|
+
//Preview tab
|
173
|
+
utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
|
174
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
175
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
176
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
177
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
178
|
+
graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
|
179
|
+
graphingPage.steps.verifyCorrectAnswerSectionNotExist();
|
180
|
+
});
|
181
|
+
|
182
|
+
it('When the user attempts the question partially correct with an incorrect response then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed and the attempted graph should be displayed correct for the correct response and incorrect for the incorrect response and the the correct answers should be displayed in the correct answer section graph', () => {
|
183
|
+
graphingPage.steps.resetQuestionPreview();
|
184
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
|
185
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: -4, yRange: 20 }, { x: -3, xRange: 20, y: 4, yRange: 20 }]);
|
186
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
|
187
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
188
|
+
graphingPage.steps.switchToGradingView();
|
189
|
+
|
190
|
+
//Preview tab
|
191
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
192
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
193
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: -4, yRange: 20 }, { x: -3, xRange: 20, y: 4, yRange: 20 }]);
|
194
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
195
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
196
|
+
graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: -3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: -4, yRange: 20 }, { x: -3, xRange: 20, y: 4, yRange: 20 }]);
|
197
|
+
|
198
|
+
//Correct answer section
|
199
|
+
utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 1);
|
200
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
201
|
+
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 2);
|
202
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
203
|
+
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
204
|
+
utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
|
205
|
+
|
206
|
+
//Correct/incorrect icon
|
207
|
+
graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
208
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
209
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
210
|
+
graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
211
|
+
cy.log('When the user attempts the question partially correct with an incorrect response then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed and the attempted graph should be displayed correct for the correct response',)
|
212
|
+
graphingPage.steps.checkAnswer();
|
213
|
+
//Preview tab
|
214
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
215
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
216
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: -4, yRange: 20 }, { x: -3, xRange: 20, y: 4, yRange: 20 }]);
|
217
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
218
|
+
graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: -3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: -4, yRange: 20 }, { x: -3, xRange: 20, y: 4, yRange: 20 }]);
|
219
|
+
graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
|
220
|
+
graphingPage.steps.verifyCorrectAnswerSectionNotExist();
|
221
|
+
});
|
222
|
+
|
223
|
+
it('When the user attempts the question correctly then the user should be awarded with full points and on switching to grading view \'Your answer is correct\' should be displayed and the attempted graph should be displayed correct and the correct answer section graph should not be displayed', () => {
|
224
|
+
graphingPage.steps.resetQuestionPreview();
|
225
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
|
226
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
227
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
|
228
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
229
|
+
graphingPage.steps.switchToGradingView();
|
230
|
+
|
231
|
+
//Preview tab
|
232
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
233
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
234
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
235
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
236
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
237
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
238
|
+
graphingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
239
|
+
graphingPage.steps.verifyCorrectAnswerSectionNotExist();
|
240
|
+
graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
241
|
+
cy.log('When the user attempts the question correctly then the user should be awarded with full points and on switching to grading view \'Your answer is correct\' should be displayed and the attempted graph should be displayed correct')
|
242
|
+
graphingPage.steps.checkAnswer();
|
243
|
+
//Preview tab
|
244
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
245
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
246
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
247
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
248
|
+
graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
249
|
+
graphingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
250
|
+
graphingPage.steps.verifyCorrectAnswerSectionNotExist();
|
251
|
+
});
|
252
|
+
});
|
253
|
+
});
|
@@ -0,0 +1,307 @@
|
|
1
|
+
import { dialogBoxBase, graphingPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const unselectedToolOption = ['Circle', 'Parabola', 'Sine', 'Polygon'];
|
5
|
+
const selectedToolOption = ['Point', 'Line', 'Label', 'Ray', 'Segment', 'Vector'];
|
6
|
+
const controlOptions = ['Move', 'Undo', 'Redo', 'Reset'];
|
7
|
+
const toolOptions = [...selectedToolOption, ...unselectedToolOption];
|
8
|
+
|
9
|
+
describe('Graphing: Add background shapes section', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Add background shapes section content', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
});
|
20
|
+
|
21
|
+
it('\'Add background shapes\' label should be displayed', () => {
|
22
|
+
utilities.verifyInnerText(graphingPage.addBackgroundShapesLabel(), 'Add background shapes');
|
23
|
+
utilities.verifyElementVisibilityState(graphingPage.addBackgroundShapesLabel(), 'visible');
|
24
|
+
});
|
25
|
+
|
26
|
+
it('The toolbar options should be displayed and when the user hovers over the tool options then tooltips should be displayed', () => {
|
27
|
+
toolOptions.forEach((toolOption) => {
|
28
|
+
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionEditTab(toolOption), 'exist');
|
29
|
+
graphingPage.graphToolOptionEditTab(toolOption)
|
30
|
+
.verifyTooltip(toolOption);
|
31
|
+
});
|
32
|
+
});
|
33
|
+
|
34
|
+
it('By default, the point option should be in selected state and all other options should be unselected', () => {
|
35
|
+
graphingPage.steps.verifyToolOptionSelectedEditTab('Point');
|
36
|
+
graphingPage.steps.verifyToolOptionNotSelectedEditTab(toolOptions.splice(1, toolOptions.length));
|
37
|
+
});
|
38
|
+
|
39
|
+
it('\'Graph title\' label should be displayed', () => {
|
40
|
+
utilities.verifyInnerText(graphingPage.graphTitleGraphEditTab(), 'Graph title');
|
41
|
+
});
|
42
|
+
|
43
|
+
it('\'X axis label\' and \'Y axis label\' should be displayed', () => {
|
44
|
+
utilities.verifyInnerText(graphingPage.xAxisGraphEditTab(), 'X axis label');
|
45
|
+
utilities.verifyInnerText(graphingPage.yAxisGraphEditTab(), 'Y axis label');
|
46
|
+
});
|
47
|
+
|
48
|
+
it('X max and X min labels with input fields should be displayed and by default the input fields should have value \'10\' and \'-10\' respectively', () => {
|
49
|
+
utilities.verifyInnerText(graphingPage.xMinLabel(), 'X min');
|
50
|
+
utilities.verifyInnerText(graphingPage.xMaxLabel(), 'X max');
|
51
|
+
graphingPage.steps.verifyXMinInputFieldValue('-10');
|
52
|
+
graphingPage.steps.verifyXMaxInputFieldValue('10');
|
53
|
+
});
|
54
|
+
|
55
|
+
it('Y max and Y min labels with input fields should be displayed and by default the input fields should have value \'10\' and \'-10\' respectively', () => {
|
56
|
+
utilities.verifyInnerText(graphingPage.yMinLabel(), 'Y min');
|
57
|
+
utilities.verifyInnerText(graphingPage.yMaxLabel(), 'Y max');
|
58
|
+
graphingPage.steps.verifyYMinInputFieldValue('-10');
|
59
|
+
graphingPage.steps.verifyYMaxInputFieldValue('10');
|
60
|
+
});
|
61
|
+
});
|
62
|
+
|
63
|
+
describe('Add background shapes section edit tab functionality', () => {
|
64
|
+
abortEarlySetup();
|
65
|
+
before(() => {
|
66
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
67
|
+
cy.barsPreLoaderWait();
|
68
|
+
});
|
69
|
+
|
70
|
+
//Graph title
|
71
|
+
it('When the user clicks on the \'Graph title\' a popup with title \'Graph title\' and \'Add label\' label with input field should be displayed along with \'Save\' and \'Cancel\' button', () => {
|
72
|
+
graphingPage.steps.clickOnGraphTitle();
|
73
|
+
utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'Graph title');
|
74
|
+
utilities.verifyInnerText(graphingPage.titlePopupAddLabelLabel(), 'Add label');
|
75
|
+
utilities.verifyElementVisibilityState(graphingPage.titlePopupAddLabelInputField(), 'visible');
|
76
|
+
utilities.verifyInnerText(graphingPage.titlePopupSaveButton(), 'Save');
|
77
|
+
utilities.verifyInnerText(graphingPage.titlePopupCancelButton(), 'Cancel');
|
78
|
+
});
|
79
|
+
|
80
|
+
it('The input field should be prefilled with \'Graph title\' and the user should be able to edit it', () => {
|
81
|
+
utilities.verifyTextContent(graphingPage.titlePopupAddLabelInputField(), 'Graph title');
|
82
|
+
});
|
83
|
+
|
84
|
+
it('When the user edits the graph title and clicks on \'Cancel\' button then the changes should not be displayed in the background section graph and \'Specify correct answer\' section graph', () => {
|
85
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit graph title');
|
86
|
+
graphingPage.steps.clickOnTitlePopupCancelButton();
|
87
|
+
utilities.verifyInnerText(graphingPage.graphTitleGraphEditTab(), 'Graph title');
|
88
|
+
utilities.verifyInnerText(graphingPage.graphTitleSpecifyCorrectAnswerSection(), 'Graph title');
|
89
|
+
});
|
90
|
+
|
91
|
+
it('When the user clicks on the \'Graph title\' then the original text should be displayed in the popup', () => {
|
92
|
+
graphingPage.steps.clickOnGraphTitle();
|
93
|
+
utilities.verifyTextContent(graphingPage.titlePopupAddLabelInputField(), 'Graph title');
|
94
|
+
});
|
95
|
+
|
96
|
+
it('When the user clicks on \'Save\' after updating the input field the updated label should be displayed in the background section graph and \'Specify correct answer\' section graph', () => {
|
97
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit graph title');
|
98
|
+
graphingPage.steps.clickOnTitlePopupSaveButton();
|
99
|
+
utilities.verifyInnerText(graphingPage.graphTitleGraphEditTab(), 'Edit graph title');
|
100
|
+
utilities.verifyInnerText(graphingPage.graphTitleSpecifyCorrectAnswerSection(), 'Edit graph title');
|
101
|
+
});
|
102
|
+
|
103
|
+
//X axis
|
104
|
+
it('When the user clicks on the \'X axis label\' a popup with title \'X axis label\' and \'Add label\' label with input field should be displayed', () => {
|
105
|
+
graphingPage.steps.clickOnXAxisLabel();
|
106
|
+
utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'X axis label');
|
107
|
+
utilities.verifyInnerText(graphingPage.titlePopupAddLabelLabel(), 'Add label');
|
108
|
+
utilities.verifyElementVisibilityState(graphingPage.titlePopupAddLabelInputField(), 'visible');
|
109
|
+
utilities.verifyInnerText(graphingPage.titlePopupSaveButton(), 'Save');
|
110
|
+
utilities.verifyInnerText(graphingPage.titlePopupCancelButton(), 'Cancel');
|
111
|
+
});
|
112
|
+
|
113
|
+
it('The input field should be prefilled with \'X axis label\' and the user should be able to edit it', () => {
|
114
|
+
utilities.verifyTextContent(graphingPage.titlePopupAddLabelInputField(), 'X axis label');
|
115
|
+
});
|
116
|
+
|
117
|
+
it('When the user edits the x axis label and clicks on \'Cancel\' button then the changes should not be displayed in the background section graph and \'Specify correct answer\' section graph', () => {
|
118
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit x axis title');
|
119
|
+
graphingPage.steps.clickOnTitlePopupCancelButton();
|
120
|
+
utilities.verifyInnerText(graphingPage.xAxisLabelGraphEditTab(), 'X axis label');
|
121
|
+
utilities.verifyInnerText(graphingPage.xAxisLabelGraphSpecifyCorrectAnswerSection(), 'X axis label');
|
122
|
+
});
|
123
|
+
|
124
|
+
it('When the user clicks on the \'X axis label\' then the original text should be displayed in the popup', () => {
|
125
|
+
graphingPage.steps.clickOnXAxisLabel();
|
126
|
+
utilities.verifyTextContent(graphingPage.titlePopupAddLabelInputField(), 'X axis label');
|
127
|
+
});
|
128
|
+
|
129
|
+
it('When the user clicks on \'Save\' after updating the input field the updated label should be displayed in the background section graph and \'Specify correct answer\' section graph', () => {
|
130
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit x axis label');
|
131
|
+
graphingPage.steps.clickOnTitlePopupSaveButton();
|
132
|
+
utilities.verifyInnerText(graphingPage.xAxisLabelGraphEditTab(), 'Edit x axis label');
|
133
|
+
utilities.verifyInnerText(graphingPage.xAxisLabelGraphSpecifyCorrectAnswerSection(), 'Edit x axis label');
|
134
|
+
});
|
135
|
+
|
136
|
+
//Y axis
|
137
|
+
it('When the user clicks on the \'Y axis label\' a popup with title \'Y axis label\' and \'Add label\' label with input field should be displayed', () => {
|
138
|
+
graphingPage.steps.clickOnYAxisLabel();
|
139
|
+
utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'Y axis label');
|
140
|
+
utilities.verifyInnerText(graphingPage.titlePopupAddLabelLabel(), 'Add label');
|
141
|
+
utilities.verifyElementVisibilityState(graphingPage.titlePopupAddLabelInputField(), 'visible');
|
142
|
+
utilities.verifyInnerText(graphingPage.titlePopupSaveButton(), 'Save');
|
143
|
+
utilities.verifyInnerText(graphingPage.titlePopupCancelButton(), 'Cancel');
|
144
|
+
});
|
145
|
+
|
146
|
+
it('The input field should be prefilled with \'Y axis label\' and the user should be able to edit it', () => {
|
147
|
+
utilities.verifyTextContent(graphingPage.titlePopupAddLabelInputField(), 'Y axis label');
|
148
|
+
});
|
149
|
+
|
150
|
+
it('When the user edits the Y axis label and clicks on \'Cancel\' button then the changes should not be displayed in the background section graph and \'Specify correct answer\' section graph', () => {
|
151
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit y axis title');
|
152
|
+
graphingPage.steps.clickOnTitlePopupCancelButton();
|
153
|
+
utilities.verifyInnerText(graphingPage.yAxisLabelGraphEditTab(), 'Y axis label');
|
154
|
+
utilities.verifyInnerText(graphingPage.yAxisLabelGraphSpecifyCorrectAnswerSection(), 'Y axis label');
|
155
|
+
});
|
156
|
+
|
157
|
+
it('When the user clicks on the \'Y axis label\' then the original text should be displayed in the popup', () => {
|
158
|
+
graphingPage.steps.clickOnYAxisLabel();
|
159
|
+
utilities.verifyTextContent(graphingPage.titlePopupAddLabelInputField(), 'Y axis label');
|
160
|
+
});
|
161
|
+
|
162
|
+
it('When the user clicks on \'Save\' after updating the input field the updated label should be displayed in the background section graph and \'Specify correct answer\' section graph', () => {
|
163
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit y axis label');
|
164
|
+
graphingPage.steps.clickOnTitlePopupSaveButton();
|
165
|
+
utilities.verifyInnerText(graphingPage.yAxisLabelGraphEditTab(), 'Edit y axis label');
|
166
|
+
utilities.verifyInnerText(graphingPage.yAxisLabelGraphSpecifyCorrectAnswerSection(), 'Edit y axis label');
|
167
|
+
});
|
168
|
+
|
169
|
+
//X max and X min
|
170
|
+
it('When X max and X min values are 10 and -10 respectively then on the X axis should range from (-9, 9) in the background section graph and \'Specify correct answer\' section graph', () => {
|
171
|
+
graphingPage.steps.verifyXMaxInputFieldValue('10');
|
172
|
+
graphingPage.steps.verifyXMaxInputFieldValue('-10');
|
173
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphEditTab('9'), 'exist');
|
174
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphEditTab('10'), 'notExist');
|
175
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphSpecifyCorrectAnswerSection('9'), 'exist');
|
176
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphSpecifyCorrectAnswerSection('10'), 'notExist');
|
177
|
+
});
|
178
|
+
|
179
|
+
it('When the user updates the value of X max and X min then on the X axis should range change accordingly in the background section graph and \'Specify correct answer\' section graph', () => {
|
180
|
+
graphingPage.steps.enterTextInXMaxInputField('11');
|
181
|
+
graphingPage.steps.enterTextInXMinInputField('-11');
|
182
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphEditTab('10'), 'exist');
|
183
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphEditTab('11'), 'notExist');
|
184
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphSpecifyCorrectAnswerSection('10'), 'exist');
|
185
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphSpecifyCorrectAnswerSection('11'), 'notExist');
|
186
|
+
cy.log('Post step: Resetting X axis values')
|
187
|
+
graphingPage.steps.enterTextInXMaxInputField('10');
|
188
|
+
graphingPage.steps.enterTextInXMinInputField('-10');
|
189
|
+
});
|
190
|
+
|
191
|
+
//Y max and Y min
|
192
|
+
it('When Y max and Y min values are 10 and -10 respectively then on the Y axis should range from (-9, 9) in the background section graph and \'Specify correct answer\' section graph', () => {
|
193
|
+
graphingPage.steps.verifyYMaxInputFieldValue('10');
|
194
|
+
graphingPage.steps.verifyYMaxInputFieldValue('-10');
|
195
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphEditTab('9'), 'exist');
|
196
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphEditTab('10'), 'notExist');
|
197
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphSpecifyCorrectAnswerSection('9'), 'exist');
|
198
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphSpecifyCorrectAnswerSection('10'), 'notExist');
|
199
|
+
});
|
200
|
+
|
201
|
+
it('When the user updates the value of Y max and Y min then on the Y axis should range change accordingly in the background section graph and \'Specify correct answer\' section graph', () => {
|
202
|
+
graphingPage.steps.enterTextInYMaxInputField('11');
|
203
|
+
graphingPage.steps.enterTextInYMinInputField('-11');
|
204
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphEditTab('10'), 'exist');
|
205
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphEditTab('11'), 'notExist');
|
206
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphSpecifyCorrectAnswerSection('10'), 'exist');
|
207
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphSpecifyCorrectAnswerSection('11'), 'notExist');
|
208
|
+
});
|
209
|
+
});
|
210
|
+
|
211
|
+
describe('Add background shapes section preview tab functionality', () => {
|
212
|
+
abortEarlySetup();
|
213
|
+
before(() => {
|
214
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
215
|
+
cy.barsPreLoaderWait();
|
216
|
+
});
|
217
|
+
|
218
|
+
//Graph title
|
219
|
+
it('When the user edits the graph title and clicks on \'Cancel\' button then the changes should not be displayed in the preview tab graph', () => {
|
220
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit graph title');
|
221
|
+
graphingPage.steps.clickOnTitlePopupCancelButton();
|
222
|
+
graphingPage.steps.switchToPreviewTab();
|
223
|
+
utilities.verifyInnerText(graphingPage.graphTitlePreviewTab(), 'Graph title');
|
224
|
+
});
|
225
|
+
|
226
|
+
it('When the user clicks on \'Save\' after updating the input field the updated label should be displayed in the preview tab graph', () => {
|
227
|
+
graphingPage.steps.switchToEditTab();
|
228
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit graph title');
|
229
|
+
graphingPage.steps.clickOnTitlePopupCancelButton();
|
230
|
+
graphingPage.steps.switchToPreviewTab();
|
231
|
+
utilities.verifyInnerText(graphingPage.graphTitlePreviewTab(), 'Graph title');
|
232
|
+
});
|
233
|
+
|
234
|
+
//X axis
|
235
|
+
it('When the user edits the x axis label and clicks on \'Cancel\' button then the changes should not be displayed in the preview tab graph', () => {
|
236
|
+
graphingPage.steps.switchToEditTab();
|
237
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit x axis title');
|
238
|
+
graphingPage.steps.clickOnTitlePopupCancelButton();
|
239
|
+
graphingPage.steps.switchToPreviewTab();
|
240
|
+
utilities.verifyInnerText(graphingPage.xAxisLabelGraphPreviewTab(), 'X axis label');
|
241
|
+
});
|
242
|
+
|
243
|
+
it('When the user clicks on \'Save\' after updating the input field the updated label should be displayed in the preview tab graph', () => {
|
244
|
+
graphingPage.steps.switchToEditTab();
|
245
|
+
graphingPage.steps.clickOnXAxisLabel();
|
246
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit x axis label');
|
247
|
+
graphingPage.steps.clickOnTitlePopupSaveButton();
|
248
|
+
graphingPage.steps.switchToPreviewTab();
|
249
|
+
utilities.verifyInnerText(graphingPage.xAxisLabelGraphPreviewTab(), 'Edit x axis label');
|
250
|
+
});
|
251
|
+
|
252
|
+
//Y axis
|
253
|
+
it('When the user edits the y axis label and clicks on \'Cancel\' button then the changes should not be displayed in the preview tab graph', () => {
|
254
|
+
graphingPage.steps.switchToEditTab();
|
255
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit y axis title');
|
256
|
+
graphingPage.steps.clickOnTitlePopupCancelButton();
|
257
|
+
graphingPage.steps.switchToPreviewTab();
|
258
|
+
utilities.verifyInnerText(graphingPage.yAxisLabelGraphPreviewTab(), 'Y axis label');
|
259
|
+
});
|
260
|
+
|
261
|
+
it('When the user clicks on \'Save\' after updating the input field the updated label should be displayed in the preview tab graph', () => {
|
262
|
+
graphingPage.steps.switchToEditTab();
|
263
|
+
graphingPage.steps.clickOnYAxisLabel();
|
264
|
+
graphingPage.steps.enterTextInTitlePopupAddLabelInputField('Edit y axis label');
|
265
|
+
graphingPage.steps.clickOnTitlePopupSaveButton();
|
266
|
+
graphingPage.steps.switchToPreviewTab();
|
267
|
+
utilities.verifyInnerText(graphingPage.yAxisLabelGraphPreviewTab(), 'Edit y axis label');
|
268
|
+
});
|
269
|
+
|
270
|
+
//X max and X min
|
271
|
+
it('When X max and X min values are 10 and -10 respectively then on the X axis should range from (-9, 9) in the preview tab graph', () => {
|
272
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphPreviewTab('9'), 'exist');
|
273
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphPreviewTab('10'), 'notExist');
|
274
|
+
});
|
275
|
+
|
276
|
+
it('When the user updates the value of X max and X min then on the X axis should range change accordingly in the preview tab graph', () => {
|
277
|
+
graphingPage.steps.switchToEditTab();
|
278
|
+
graphingPage.steps.enterTextInXMaxInputField('11');
|
279
|
+
graphingPage.steps.enterTextInXMinInputField('-11');
|
280
|
+
graphingPage.steps.switchToPreviewTab();
|
281
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphPreviewTab('10'), 'exist');
|
282
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphPreviewTab('11'), 'notExist');
|
283
|
+
graphingPage.steps.switchToEditTab();
|
284
|
+
cy.log('Post step: Resetting X axis values')
|
285
|
+
graphingPage.steps.enterTextInXMaxInputField('10');
|
286
|
+
graphingPage.steps.enterTextInXMinInputField('-10');
|
287
|
+
});
|
288
|
+
|
289
|
+
//Y max and Y min
|
290
|
+
it('When Y max and Y min values are 10 and -10 respectively then on the Y axis should range from (-9, 9) in the preview tab graph', () => {
|
291
|
+
graphingPage.steps.verifyYMaxInputFieldValue('10');
|
292
|
+
graphingPage.steps.verifyYMaxInputFieldValue('-10');
|
293
|
+
graphingPage.steps.switchToPreviewTab();
|
294
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphPreviewTab('9'), 'exist');
|
295
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphPreviewTab('10'), 'notExist');
|
296
|
+
});
|
297
|
+
|
298
|
+
it('When the user updates the value of Y max and Y min then on the Y axis should range change accordingly in the preview tab graph', () => {
|
299
|
+
graphingPage.steps.switchToEditTab();
|
300
|
+
graphingPage.steps.enterTextInYMaxInputField('11');
|
301
|
+
graphingPage.steps.enterTextInYMinInputField('-11');
|
302
|
+
graphingPage.steps.switchToPreviewTab();
|
303
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphPreviewTab('10'), 'exist');
|
304
|
+
utilities.verifyElementVisibilityState(graphingPage.textOnGraphPreviewTab('11'), 'notExist');
|
305
|
+
});
|
306
|
+
});
|
307
|
+
});
|