itemengine-cypress-automation 1.0.131-updateILCrepo6March-02c78d1.0 → 1.0.132

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +3 -6
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +2 -4
  3. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +3 -7
  4. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +2 -0
  5. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettings.js +154 -0
  6. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneAlternateAnswerPopup.js +170 -0
  7. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneSettings.js +335 -0
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +142 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +76 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +8 -8
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +341 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettingsForGroupedLayout.js +241 -0
  14. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +1 -1
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettingsForGroupedLayout.js +3 -3
  16. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +350 -0
  17. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToCorrectPoints.js +356 -0
  18. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +402 -0
  19. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +4 -4
  20. package/cypress/e2e/ILC/SimpleCalculator/editTabFunctionality.js +242 -0
  21. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +11 -16
  22. package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +4 -6
  23. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +3 -4
  24. package/cypress/fixtures/theme/ilc.json +2 -0
  25. package/cypress/pages/audioResponsePage.js +1 -1
  26. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
  27. package/cypress/pages/components/correctIncorrectAnswerLabelComponent.js +1 -1
  28. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +35 -5
  29. package/cypress/pages/components/imageCanvasComponent.js +1 -1
  30. package/cypress/pages/components/index.js +2 -1
  31. package/cypress/pages/components/questionInputFieldComponent.js +31 -0
  32. package/cypress/pages/components/responseAreaSettingsPopupComponent.js +74 -0
  33. package/cypress/pages/drawingResponsePage.js +1 -1
  34. package/cypress/pages/fillInTheGapsDragAndDropPage.js +318 -62
  35. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +2 -26
  36. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +24 -1
  37. package/cypress/pages/simpleCalculatorPage.js +140 -10
  38. package/cypress/pages/textEntryMathPage.js +3 -2
  39. package/package.json +2 -2
@@ -0,0 +1,356 @@
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 correct answer equal to alternative 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(20);
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(), 1);
65
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
66
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
67
+
68
+ //Correct/incorrect icon
69
+ utilities.verifyElementVisibilityState(graphingPage.correctIncorrectStatusMessageText(), 'notExist');
70
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
71
+ 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 }]);
72
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
73
+
74
+ 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')
75
+ graphingPage.steps.checkAnswer();
76
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
77
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
78
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
79
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
80
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
81
+ });
82
+
83
+ 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', () => {
84
+ graphingPage.steps.resetQuestionPreview();
85
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
86
+ 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 }]);
87
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
88
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
89
+ graphingPage.steps.verifyPreviewScore(20, 20);
90
+ graphingPage.steps.switchToGradingView();
91
+
92
+ //Preview tab
93
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
94
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
95
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
96
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
97
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
98
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
99
+ 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 }]);
100
+
101
+ //Correct/incorrect icon
102
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
103
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
104
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
105
+
106
+ 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')
107
+ graphingPage.steps.checkAnswer();
108
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
109
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
110
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
111
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
112
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
113
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
114
+ 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 }]);
115
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
116
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
117
+ });
118
+
119
+ 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', () => {
120
+ graphingPage.steps.resetQuestionPreview();
121
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
122
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
123
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
124
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
125
+ graphingPage.steps.verifyPreviewScore(20, 20);
126
+ graphingPage.steps.switchToGradingView();
127
+
128
+ //Preview tab
129
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
130
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
131
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
132
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
133
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
134
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
135
+
136
+ //Correct/incorrect icon
137
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('correct')
138
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
139
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
140
+
141
+ 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')
142
+ graphingPage.steps.checkAnswer();
143
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
144
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
145
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
146
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
147
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
148
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
149
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
150
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
151
+ });
152
+
153
+ 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 correct accordion should be displayed', () => {
154
+ graphingPage.steps.resetQuestionPreview();
155
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
156
+ 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 }]);
157
+ graphingPage.steps.verifyPreviewScore(0, 20);
158
+ graphingPage.steps.switchToGradingView();
159
+
160
+ //Preview tab
161
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
162
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
163
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
164
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
165
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
166
+ 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 }]);
167
+
168
+ //Correct answer section
169
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
170
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
171
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
172
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 1);
173
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
174
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
175
+
176
+ //Correct/incorrect icon
177
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
178
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
179
+ 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 }]);
180
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
181
+
182
+ 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')
183
+ graphingPage.steps.checkAnswer();
184
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
185
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
186
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
187
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
188
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
189
+ 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 }]);
190
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
191
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
192
+ });
193
+
194
+ 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 correct accordion should be displayed', () => {
195
+ graphingPage.steps.resetQuestionPreview();
196
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
197
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
198
+ graphingPage.steps.verifyPreviewScore(0, 20);
199
+ graphingPage.steps.switchToGradingView();
200
+
201
+ //Preview tab
202
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
203
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
204
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
205
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
206
+ utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(), 1);
207
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
208
+
209
+ //Correct answer section
210
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
211
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
212
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
213
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 1);
214
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
215
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
216
+
217
+ //Correct/incorrect icon
218
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
219
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
220
+ 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 }]);
221
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
222
+
223
+ 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')
224
+ graphingPage.steps.checkAnswer();
225
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
226
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
227
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
228
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
229
+ utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(), 1);
230
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
231
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
232
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
233
+ });
234
+
235
+ 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 correct accordion should be displayed', () => {
236
+ graphingPage.steps.resetQuestionPreview();
237
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
238
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
239
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
240
+ 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 }]);
241
+ graphingPage.steps.verifyPreviewScore(0, 20);
242
+ graphingPage.steps.switchToGradingView();
243
+
244
+ //Preview tab
245
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
246
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
247
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
248
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
249
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
250
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
251
+ 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 }]);
252
+
253
+ //Correct answer section
254
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
255
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
256
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 1);
257
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
258
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
259
+
260
+ //Correct/incorrect icon
261
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
262
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
263
+ 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 }]);
264
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
265
+
266
+ 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')
267
+ graphingPage.steps.checkAnswer();
268
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
269
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
270
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
271
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
272
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
273
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
274
+ 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 }]);
275
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
276
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
277
+ });
278
+
279
+ 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 correct accordion should be displayed', () => {
280
+ graphingPage.steps.resetQuestionPreview();
281
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
282
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
283
+ graphingPage.steps.verifyPreviewScore(0, 20);
284
+ graphingPage.steps.switchToGradingView();
285
+
286
+ //Preview tab
287
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
288
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
289
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
290
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
291
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
292
+
293
+ //Correct answer section
294
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
295
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
296
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 1);
297
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
298
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
299
+
300
+ //Correct/incorrect icon
301
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
302
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
303
+ 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 }]);
304
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
305
+
306
+ 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')
307
+ graphingPage.steps.checkAnswer();
308
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
309
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
310
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
311
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
312
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
313
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
314
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
315
+ });
316
+
317
+ 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', () => {
318
+ graphingPage.steps.resetQuestionPreview();
319
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
320
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
321
+ graphingPage.steps.verifyPreviewScore(0, 20);
322
+ graphingPage.steps.switchToGradingView();
323
+
324
+ //Preview tab
325
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
326
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
327
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
328
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
329
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
330
+
331
+ //Correct answer section
332
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
333
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
334
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
335
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 1);
336
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
337
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
338
+
339
+ //Correct/incorrect icon
340
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
341
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
342
+ 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 }]);
343
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
344
+
345
+ 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')
346
+ graphingPage.steps.checkAnswer();
347
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
348
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
349
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
350
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
351
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
352
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
353
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
354
+ });
355
+ });
356
+ });