itemengine-cypress-automation 1.0.131 → 1.0.133-7thMarchFixes-0e78080.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -2
  2. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettings.js +154 -0
  3. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneAlternateAnswerPopup.js +170 -0
  4. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneSettings.js +335 -0
  5. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +142 -0
  6. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +76 -0
  7. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +8 -8
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +341 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettingsForGroupedLayout.js +241 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +1 -1
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettingsForGroupedLayout.js +3 -3
  13. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +350 -0
  14. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToCorrectPoints.js +356 -0
  15. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +402 -0
  16. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +4 -4
  17. package/cypress/e2e/ILC/SimpleCalculator/editTabFunctionality.js +242 -0
  18. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +11 -16
  19. package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +4 -6
  20. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +3 -4
  21. package/cypress/fixtures/theme/ilc.json +2 -0
  22. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
  23. package/cypress/pages/components/correctIncorrectAnswerLabelComponent.js +1 -1
  24. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +35 -5
  25. package/cypress/pages/components/imageCanvasComponent.js +1 -1
  26. package/cypress/pages/components/index.js +2 -1
  27. package/cypress/pages/components/questionInputFieldComponent.js +31 -0
  28. package/cypress/pages/components/responseAreaSettingsPopupComponent.js +74 -0
  29. package/cypress/pages/drawingResponsePage.js +1 -1
  30. package/cypress/pages/fillInTheGapsDragAndDropPage.js +318 -62
  31. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +2 -26
  32. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +24 -1
  33. package/cypress/pages/simpleCalculatorPage.js +140 -10
  34. package/cypress/pages/textEntryMathPage.js +3 -2
  35. package/package.json +2 -2
@@ -0,0 +1,350 @@
1
+ import { 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 css = Cypress.env('css');
6
+
7
+ describe('Create Item page - Graphing: All or nothing with alternative answer', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('All or nothing scoring with alternative answer greater than correct points', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ graphingPage.steps.navigateToCreateQuestion('Graphing');
16
+ cy.barsPreLoaderWait();
17
+ graphingPage.steps.addTextInQuestionInstructionsInputField('Plot the graph');
18
+ graphingPage.steps.selectToolOptions(unselectedToolOption);
19
+ graphingPage.steps.checkPatternBackground();
20
+ graphingPage.steps.checkSnapToGridCheckbox();
21
+ graphingPage.steps.selectGraphToolOptionEditTab('Line');
22
+ graphingPage.steps.plotPointsOnGraphEditTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
23
+ graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
24
+ graphingPage.steps.selectGraphToolOptionEditTab('Circle');
25
+ graphingPage.steps.plotPointsOnGraphEditTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
26
+ graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
27
+ //Correct answer
28
+ graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Polygon');
29
+ 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 }]);
30
+ 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 }]);
31
+ //Common answer
32
+ graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Circle');
33
+ graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
34
+ graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
35
+ graphingPage.steps.allotPoints(12);
36
+ //Alternative answer
37
+ graphingPage.steps.addAlternativeAnswerAccordion(1);
38
+ graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Vector');
39
+ graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
40
+ graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
41
+ //Common answer
42
+ graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Circle');
43
+ graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
44
+ graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
45
+ graphingPage.steps.allotPoints(20);
46
+ graphingPage.steps.checkAllowStudentToCheckAnswerCheckbox();
47
+ graphingPage.steps.switchToPreviewTab();
48
+ });
49
+
50
+ it('When the user selects \'Grading\' view without attempting the question, the correct answer should be displayed in the correct answer section graph', () => {
51
+ graphingPage.steps.verifyPreviewScore(0, 20);
52
+ graphingPage.steps.switchToGradingView();
53
+
54
+ //Preview tab
55
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
56
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
57
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
58
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
59
+
60
+ //Correct answer section
61
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
62
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
63
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
64
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 2);
65
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
66
+
67
+ //Correct/incorrect icon
68
+ utilities.verifyElementVisibilityState(graphingPage.correctIncorrectStatusMessageText(), 'notExist');
69
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
70
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
71
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
72
+
73
+ cy.log('When the user switches to \'Grading view\' without attempting the question and clicks on \'Check answer\' button, status message and correct answer section should not be displayed')
74
+ graphingPage.steps.checkAnswer();
75
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
76
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
77
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
78
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
79
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
80
+ });
81
+
82
+ it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view the attempted graph should be displayed correct, a status message with text \'Your answer is correct\' should be displayed above the question preview, correct answer section should not be displayed', () => {
83
+ graphingPage.steps.resetQuestionPreview();
84
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
85
+ 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 }]);
86
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
87
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
88
+ graphingPage.steps.verifyPreviewScore(12, 20);
89
+ graphingPage.steps.switchToGradingView();
90
+
91
+ //Preview tab
92
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
93
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
94
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 2, yRange: 20 }]);
95
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
96
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
97
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
98
+ 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 }]);
99
+
100
+ //Correct/incorrect icon
101
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
102
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
103
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
104
+
105
+ cy.log('When the user attempts the question with responses from the correct accordion and clicks on \'Check answer\' button, the attempted graph should be displayed correct, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
106
+ graphingPage.steps.checkAnswer();
107
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
108
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
109
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 2, yRange: 20 }]);
110
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
111
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
112
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
113
+ 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 }]);
114
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
115
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
116
+ });
117
+
118
+ it('When the user attempts the question with alternative accordion response, then the user should be awarded with points specified for alternative accordion (less than full points) and on switching to \'Grading\' view, the attempted graph should be displayed correct, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
119
+ graphingPage.steps.resetQuestionPreview();
120
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
121
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
122
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
123
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
124
+ graphingPage.steps.verifyPreviewScore(20, 20);
125
+ graphingPage.steps.switchToGradingView();
126
+
127
+ //Preview tab
128
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
129
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
130
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
131
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
132
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
133
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
134
+
135
+ //Correct/incorrect icon
136
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('correct')
137
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
138
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
139
+
140
+ cy.log('When the user attempts the question with responses from the alternative accordion and clicks on \'Check answer\' button, the attempted graph should be displayed correct, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
141
+ graphingPage.steps.checkAnswer();
142
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
143
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
144
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
145
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
146
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
147
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
148
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
149
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
150
+ });
151
+
152
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, the attempted graph should be displayed correct, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion should be displayed', () => {
153
+ graphingPage.steps.resetQuestionPreview();
154
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
155
+ 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 }]);
156
+ graphingPage.steps.verifyPreviewScore(0, 20);
157
+ graphingPage.steps.switchToGradingView();
158
+
159
+ //Preview tab
160
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
161
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
162
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
163
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
164
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
165
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ 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 }]);
166
+
167
+ //Correct answer section
168
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
169
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
170
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
171
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 2);
172
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
173
+
174
+ //Correct/incorrect icon
175
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
176
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
177
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
178
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
179
+
180
+ cy.log('When the user attempts the question with partially correct responses exclusively from the correct accordion and clicks on \'Check answer\' button, the attempted graph should be displayed correct, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
181
+ graphingPage.steps.checkAnswer();
182
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
183
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
184
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
185
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
186
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
187
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ 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.verifyCorrectIncorrectAnswerLabel('incorrect');
189
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
190
+ });
191
+
192
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, the attempted graph should be displayed correct, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion should be displayed', () => {
193
+ graphingPage.steps.resetQuestionPreview();
194
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
195
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
196
+ graphingPage.steps.verifyPreviewScore(0, 20);
197
+ graphingPage.steps.switchToGradingView();
198
+
199
+ //Preview tab
200
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
201
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
202
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
203
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
204
+ utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(), 1);
205
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
206
+
207
+ //Correct answer section
208
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
209
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
210
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
211
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 2);
212
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
213
+
214
+ //Correct/incorrect icon
215
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
216
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
217
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
218
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
219
+
220
+ cy.log('When the user attempts the question with partially correct responses exclusively from the alternative accordion and clicks on \'Check answer\' button, the attempted graph should be displayed correct, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
221
+ graphingPage.steps.checkAnswer();
222
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
223
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
224
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
225
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
226
+ utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(), 1);
227
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
228
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
229
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
230
+ });
231
+
232
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, the correctly attempted graph should be displayed correct and incorrectly attempted should be displayed for the alternative accordion graph, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion should be displayed', () => {
233
+ graphingPage.steps.resetQuestionPreview();
234
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
235
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
236
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
237
+ 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 }]);
238
+ graphingPage.steps.verifyPreviewScore(0, 20);
239
+ graphingPage.steps.switchToGradingView();
240
+
241
+ //Preview tab
242
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
243
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
244
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
245
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
246
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
247
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
248
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ 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 }]);
249
+
250
+ //Correct answer section
251
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
252
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
253
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 2);
254
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
255
+
256
+ //Correct/incorrect icon
257
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
258
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
259
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
260
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
261
+
262
+ cy.log('When the user attempts the question with equal number responses from the correct and alternative accordion and clicks on \'Check answer\' button, the attempted graph should be displayed correct, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
263
+ graphingPage.steps.checkAnswer();
264
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
265
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
266
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
267
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
268
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
269
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
270
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ 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 }]);
271
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
272
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
273
+ });
274
+
275
+ it('Race condition : When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, the attempted response should be displayed correct, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion should be displayed', () => {
276
+ graphingPage.steps.resetQuestionPreview();
277
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
278
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
279
+ graphingPage.steps.verifyPreviewScore(0, 20);
280
+ graphingPage.steps.switchToGradingView();
281
+
282
+ //Preview tab
283
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
284
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
285
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
286
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
287
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
288
+
289
+ //Correct answer section
290
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
291
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
292
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 2);
293
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
294
+
295
+ //Correct/incorrect icon
296
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
297
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
298
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
299
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
300
+
301
+ cy.log('When the user attempts the question with common response from the alternative accordion and clicks on \'Check answer\' button, the attempted graph should be displayed correct, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
302
+ graphingPage.steps.checkAnswer();
303
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
304
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
305
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
306
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
307
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
308
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
309
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
310
+ });
311
+
312
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers should be displayed', () => {
313
+ graphingPage.steps.resetQuestionPreview();
314
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
315
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
316
+ graphingPage.steps.verifyPreviewScore(0, 20);
317
+ graphingPage.steps.switchToGradingView();
318
+
319
+ //Preview tab
320
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
321
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
322
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
323
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
324
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
325
+
326
+ //Correct answer section
327
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
328
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
329
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
330
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 2);
331
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
332
+
333
+ //Correct/incorrect icon
334
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
335
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
336
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
337
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
338
+
339
+ cy.log('When the user has attempted the question with incorrect responses and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
340
+ graphingPage.steps.checkAnswer();
341
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
342
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
343
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
344
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
345
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
346
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
347
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
348
+ });
349
+ });
350
+ });