itemengine-cypress-automation 1.0.166-migrationScripts-b8c79a0.0 → 1.0.167-repoUpdate10April-1465c8c.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. package/cypress/e2e/ILC/BrainingCampManipulative/additionalSettings.js +83 -0
  2. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +200 -0
  3. package/cypress/e2e/ILC/BrainingCampManipulative/editTabScoringSection.js +56 -0
  4. package/cypress/e2e/ILC/BrainingCampManipulative/gradingViewAndCorrectAnswerViewContents.smoke.js +95 -0
  5. package/cypress/e2e/ILC/BrainingCampManipulative/headerSection.js +71 -0
  6. package/cypress/e2e/ILC/BrainingCampManipulative/previewTabContent.smoke.js +72 -0
  7. package/cypress/e2e/ILC/BrainingCampManipulative/toolSettings.js +71 -0
  8. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +2 -2
  9. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +22 -11
  10. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
  12. package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +161 -0
  13. package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +308 -0
  14. package/cypress/e2e/ILC/FeedbackScaleNew/previewContentsForAllViews.smoke.js +216 -0
  15. package/cypress/e2e/ILC/FeedbackScaleNew/starsHeartsFeedbackScaleStyle.js +336 -0
  16. package/cypress/e2e/ILC/FeedbackScaleNew/textFeedbackScaleStyle.js +570 -0
  17. package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +214 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +356 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +299 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +18 -7
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +11 -6
  22. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +355 -0
  23. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +0 -1
  24. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +2 -36
  25. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +22 -34
  26. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +8 -24
  27. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +5 -25
  28. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +68 -114
  29. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +67 -111
  30. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +71 -123
  31. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingScoringCellShadeCount.js +41 -63
  32. package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +21 -25
  33. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +50 -85
  34. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +68 -115
  35. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +54 -98
  36. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +72 -120
  37. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +3 -3
  38. package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +309 -0
  39. package/cypress/e2e/ILC/Matching/specifyCorrectAnswerSection.js +1 -1
  40. package/cypress/e2e/ILC/Matching/toolSettings.js +72 -0
  41. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabBasicSection.js +1033 -0
  42. package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +28 -0
  43. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +236 -0
  44. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +239 -0
  45. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +278 -0
  46. package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +178 -0
  47. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +407 -0
  48. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +273 -0
  49. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +278 -0
  50. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +228 -0
  51. package/cypress/e2e/ILC/NumberLine/additionalSettings.js +120 -0
  52. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +659 -0
  53. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +149 -0
  54. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +151 -0
  55. package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +171 -0
  56. package/cypress/e2e/ILC/NumberLine/headerSection.js +76 -0
  57. package/cypress/e2e/ILC/NumberLine/minimumScoringPenaltyPointsAndRoundingDropdown.js +54 -0
  58. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +200 -0
  59. package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +67 -0
  60. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +135 -0
  61. package/cypress/e2e/ILC/NumberLine/toolSettings.js +73 -0
  62. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +372 -0
  63. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +1014 -0
  64. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +235 -0
  65. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +235 -0
  66. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +235 -0
  67. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +457 -0
  68. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +342 -0
  69. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +342 -0
  70. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +342 -0
  71. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +155 -0
  72. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +314 -0
  73. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +275 -0
  74. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +314 -0
  75. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +290 -0
  76. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +142 -0
  77. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.js +137 -0
  78. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +4 -4
  79. package/cypress/fixtures/theme/ilc.json +14 -26
  80. package/cypress/pages/brainingCampManipulativePage.js +122 -0
  81. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -1
  82. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -0
  83. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  84. package/cypress/pages/components/colorPopupComponent.js +2 -2
  85. package/cypress/pages/components/defaultToolDropdown.js +77 -0
  86. package/cypress/pages/components/gridQuestionCommonComponent.js +629 -2
  87. package/cypress/pages/components/index.js +3 -0
  88. package/cypress/pages/components/maximumCapacityPerDropzoneComponent.js +1 -1
  89. package/cypress/pages/components/measuringToolComponent.js +2 -2
  90. package/cypress/pages/components/resetPopupComponent.js +74 -0
  91. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -1
  92. package/cypress/pages/components/setPointsPopupBase.js +6 -4
  93. package/cypress/pages/components/specifyRowsAndColumnsComponent.js +60 -3
  94. package/cypress/pages/components/toolSettingsComponent.js +80 -12
  95. package/cypress/pages/components/toolsAndControlsComponent.js +69 -0
  96. package/cypress/pages/dragAndDropIntoCategoriesPage.js +0 -8
  97. package/cypress/pages/feedbackScalePage copy.js +716 -0
  98. package/cypress/pages/feedbackScalePage.js +591 -449
  99. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +3 -1
  100. package/cypress/pages/graphingPage.js +9 -145
  101. package/cypress/pages/gridFillPage.js +135 -120
  102. package/cypress/pages/highlightPage.js +0 -394
  103. package/cypress/pages/index.js +5 -2
  104. package/cypress/pages/matchingPage.js +78 -20
  105. package/cypress/pages/multipleSelectionGridPage.js +88 -1
  106. package/cypress/pages/numberLinePage.js +723 -0
  107. package/cypress/pages/singleSelectionGridPage.js +86 -0
  108. package/cypress/pages/textSelectionPage.js +582 -0
  109. package/cypress/support/migrationHelpers/extractLrnQuestionData.js +3 -12
  110. package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +0 -1
  111. package/cypress/support/migrationHelpers/migrationScript.js +0 -10
  112. package/cypress/support/migrationHelpers/verifyIeQuestionData.js +0 -8
  113. package/package.json +1 -1
@@ -0,0 +1,355 @@
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.selectGraphToolOptionEditTab('Line');
21
+ graphingPage.steps.plotPointsOnGraphEditTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
22
+ graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
23
+ graphingPage.steps.selectGraphToolOptionEditTab('Circle');
24
+ graphingPage.steps.plotPointsOnGraphEditTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
25
+ graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
26
+ //Correct answer
27
+ graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Polygon');
28
+ 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 }]);
29
+ 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 }]);
30
+ //Common answer
31
+ graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Circle');
32
+ graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
33
+ graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
34
+ graphingPage.steps.allotPoints(20);
35
+ //Alternative answer
36
+ graphingPage.steps.addAlternativeAnswerAccordion(1);
37
+ graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Vector');
38
+ graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
39
+ graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
40
+ //Common answer
41
+ graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Circle');
42
+ graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
43
+ graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
44
+ graphingPage.steps.allotPoints(20);
45
+ graphingPage.steps.checkAllowStudentToCheckAnswerCheckbox();
46
+ graphingPage.steps.switchToPreviewTab();
47
+ });
48
+
49
+ it('When the user selects \'Grading\' view without attempting the question, the correct answer should be displayed in the correct answer section graph', () => {
50
+ graphingPage.steps.verifyPreviewScore(0, 20);
51
+ graphingPage.steps.switchToGradingView();
52
+
53
+ //Preview tab
54
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
55
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
56
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
57
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
58
+
59
+ //Correct answer section
60
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
61
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
62
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
63
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 1);
64
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
65
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
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: 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 }]);
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(20, 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: 1, yRange: 20 }, { 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: 1, yRange: 20 }, { 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 correct 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.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 }]);
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(), 1);
172
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
173
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
174
+
175
+ //Correct/incorrect icon
176
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
177
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
178
+ 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 }]);
179
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
180
+
181
+ 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')
182
+ graphingPage.steps.checkAnswer();
183
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
184
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
185
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
186
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
187
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
188
+ 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 }]);
189
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
190
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
191
+ });
192
+
193
+ 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', () => {
194
+ graphingPage.steps.resetQuestionPreview();
195
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
196
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
197
+ graphingPage.steps.verifyPreviewScore(0, 20);
198
+ graphingPage.steps.switchToGradingView();
199
+
200
+ //Preview tab
201
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
202
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
203
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
204
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
205
+ utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(), 1);
206
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
207
+
208
+ //Correct answer section
209
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
210
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
211
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
212
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 1);
213
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
214
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
215
+
216
+ //Correct/incorrect icon
217
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
218
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
219
+ 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 }]);
220
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
221
+
222
+ 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')
223
+ graphingPage.steps.checkAnswer();
224
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
225
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
226
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
227
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
228
+ utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(), 1);
229
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
230
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
231
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
232
+ });
233
+
234
+ 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', () => {
235
+ graphingPage.steps.resetQuestionPreview();
236
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
237
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
238
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
239
+ 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 }]);
240
+ graphingPage.steps.verifyPreviewScore(0, 20);
241
+ graphingPage.steps.switchToGradingView();
242
+
243
+ //Preview tab
244
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
245
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
246
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
247
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
248
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
249
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
250
+ 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 }]);
251
+
252
+ //Correct answer section
253
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
254
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
255
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 1);
256
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
257
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
258
+
259
+ //Correct/incorrect icon
260
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
261
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
262
+ 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 }]);
263
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
264
+
265
+ 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')
266
+ graphingPage.steps.checkAnswer();
267
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
268
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
269
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
270
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
271
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
272
+ utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
273
+ 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 }]);
274
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
275
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
276
+ });
277
+
278
+ 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', () => {
279
+ graphingPage.steps.resetQuestionPreview();
280
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
281
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
282
+ graphingPage.steps.verifyPreviewScore(0, 20);
283
+ graphingPage.steps.switchToGradingView();
284
+
285
+ //Preview tab
286
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
287
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
288
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
289
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
290
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
291
+
292
+ //Correct answer section
293
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
294
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
295
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 1);
296
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
297
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
298
+
299
+ //Correct/incorrect icon
300
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
301
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
302
+ 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 }]);
303
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
304
+
305
+ 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')
306
+ graphingPage.steps.checkAnswer();
307
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
308
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
309
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphPreviewTab([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
310
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
311
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
312
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
313
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
314
+ });
315
+
316
+ 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', () => {
317
+ graphingPage.steps.resetQuestionPreview();
318
+ graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
319
+ graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
320
+ graphingPage.steps.verifyPreviewScore(0, 20);
321
+ graphingPage.steps.switchToGradingView();
322
+
323
+ //Preview tab
324
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
325
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
326
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
327
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
328
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
329
+
330
+ //Correct answer section
331
+ utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 2);
332
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
333
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
334
+ utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 1);
335
+ graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
336
+ utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
337
+
338
+ //Correct/incorrect icon
339
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect')
340
+ graphingPage.steps.verifyCorrectPointsPlottedOnGraphCorrectAnswerSection([{ x: 0, xRange: 20, y: 1, yRange: 20 }, { x: 0, xRange: 20, y: 2, yRange: 20 }]);
341
+ 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 }]);
342
+ graphingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
343
+
344
+ 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')
345
+ graphingPage.steps.checkAnswer();
346
+ utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 2);
347
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
348
+ graphingPage.steps.verifyIncorrectPointsPlottedOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
349
+ utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 1);
350
+ graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
351
+ graphingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
352
+ graphingPage.steps.verifyCorrectAnswerSectionNotExist();
353
+ });
354
+ });
355
+ });
@@ -13,7 +13,6 @@ const toolOptions = [...selectedToolOption, ...unselectedToolOption];
13
13
  describe('Create item page - Graphing - Preview contents in all views', () => {
14
14
  before(() => {
15
15
  cy.loginAs('admin');
16
- graphingPage.steps.navigateToCreateQuestion('Graphing');
17
16
  });
18
17
 
19
18
  views.forEach((view) => {
@@ -54,42 +54,8 @@ describe('Graphing: Tools and controls - Edit tab and preview tab tool options',
54
54
  utilities.verifyElementVisibilityState(utilities.getNthElement(graphingPage.controlsTickIcon(), index), 'visible');
55
55
  });
56
56
  });
57
-
58
- it('\'Default tool\' label and dropdown should be displayed with \'Point\' option selected by default', () => {
59
- utilities.verifyInnerText(graphingPage.defaultToolDropdownLabel(), 'Default tool');
60
- utilities.verifyInnerText(graphingPage.defaultToolDropdown(), 'Point');
61
- });
62
-
63
- it(`${selectedToolOption} options should be displayed when the user expands the \'Default tool\' dropdown`, () => {
64
- graphingPage.steps.expandDefaultToolDropdown();
65
- selectedToolOption.forEach((dropdownOption) => {
66
- utilities.verifyElementVisibilityState(graphingPage.defaultToolDropdownOptions(dropdownOption), 'exist');
67
- });
68
- utilities.verifyElementCount(graphingPage.defaultToolDropdownOptions(), 6);
69
- graphingPage.steps.selectOptionFromDefaultToolDropdown('Point');
70
- });
71
-
72
- it('CSS of default tool dropdown', { tags: 'css' }, () => {
73
- graphingPage.steps.expandDefaultToolDropdown();
74
- utilities.verifyCSS(graphingPage.defaultToolDropdownLabel(), {
75
- 'color': css.color.labels,
76
- 'font-size': css.fontSize.normal,
77
- 'font-weight': css.fontWeight.semibold
78
- });
79
- utilities.verifyCSS(graphingPage.defaultToolDropdownOptions('Point'), {
80
- 'color': css.color.liText,
81
- 'background-color': css.color.liTextSelectedBg,
82
- 'font-size': css.fontSize.default,
83
- 'font-weight': css.fontWeight.regular
84
- });
85
- utilities.verifyCSS(graphingPage.defaultToolDropdownOptions('Line'), {
86
- 'color': css.color.liText,
87
- 'background-color': css.color.transparent,
88
- 'font-size': css.fontSize.default,
89
- 'font-weight': css.fontWeight.regular
90
- });
91
- graphingPage.steps.selectOptionFromDefaultToolDropdown('Point');
92
- });
57
+
58
+ graphingPage.tests.verifyDefaultToolDropdown(toolOptions);
93
59
 
94
60
  it(`The ${selectedToolOption} options should be displayed in the \'Specify correct answer\' section and ${toolOptions} should be displayed in the background graph section`, () => {
95
61
  selectedToolOption.forEach((toolOption) => {
@@ -101,10 +101,10 @@ describe('Create item page - Grid fill: All or nothing', () => {
101
101
  gridFillPage.steps.switchToGradingView();
102
102
  gridFillPage.steps.verifyPreviewScore(0, 20);
103
103
  }
104
- gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
105
- gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
106
- gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
107
- gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
104
+ gridFillPage.steps.verifyCorrectIncorrectResponseIconNotExistPreviewTab(0, 0);
105
+ gridFillPage.steps.verifyCorrectIncorrectResponseIconNotExistPreviewTab(0, 1);
106
+ gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 0);
107
+ gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 1);
108
108
  });
109
109
 
110
110
  it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed in the incorrect cell, incorrect answer border around incorrect cell and correct icon should be displayed in the correct cell, correct answer border around correct cell and a status message with text \'Your answer is incorrect\' in question preview', () => {
@@ -114,21 +114,15 @@ describe('Create item page - Grid fill: All or nothing', () => {
114
114
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
115
115
  studentViewPage.steps.clickOnGoToGradingViewButton()
116
116
  gradingViewPage.steps.verifyGradingViewScore(0, 20);
117
- gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
118
- gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
119
- gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
120
- gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
117
+ gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0,3);
118
+ gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 0);
119
+ gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 1);
121
120
  }
122
121
  if (view === 'Question preview' || view === 'Item preview') {
123
122
  gridFillPage.steps.switchToGradingView();
124
123
  gridFillPage.steps.verifyPreviewScore(0, 20);
125
124
  }
126
- gridFillPage.steps.verifyIncorrectResponseIcon(0, 3);
127
- gridFillPage.steps.verifyIncorrectResponseBorder(0, 3);
128
- gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
129
- gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
130
- gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
131
- gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
125
+ gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0,3);
132
126
  gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
133
127
  });
134
128
 
@@ -147,10 +141,9 @@ describe('Create item page - Grid fill: All or nothing', () => {
147
141
  gridFillPage.steps.verifyPreviewScore(0, 20);
148
142
  gridFillPage.steps.switchToGradingView();
149
143
  };
150
- gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
151
- gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
152
- gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
153
- gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
144
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 0);
145
+ gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 0);
146
+ gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 1);
154
147
  gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
155
148
  });
156
149
 
@@ -170,12 +163,10 @@ describe('Create item page - Grid fill: All or nothing', () => {
170
163
  gridFillPage.steps.verifyPreviewScore(0, 20);
171
164
  gridFillPage.steps.switchToGradingView();
172
165
  };
173
- gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
174
- gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
175
- gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
176
- gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
177
- gridFillPage.steps.verifyIncorrectResponseIcon(0, 3);
178
- gridFillPage.steps.verifyIncorrectResponseBorder(0, 3);
166
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 0);
167
+ gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0, 3);
168
+ gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 0);
169
+ gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 1);
179
170
  gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
180
171
  });
181
172
 
@@ -196,12 +187,11 @@ describe('Create item page - Grid fill: All or nothing', () => {
196
187
  gridFillPage.steps.verifyPreviewScore(0, 20);
197
188
  gridFillPage.steps.switchToGradingView();
198
189
  };
199
- gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
200
- gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
201
- gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
202
- gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
203
- gridFillPage.steps.verifyIncorrectResponseBorder(0, 3);
204
- gridFillPage.steps.verifyIncorrectResponseIcon(0, 3);
190
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 0);
191
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 1);
192
+ gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0, 3);
193
+ gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 0);
194
+ gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 1);
205
195
  gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
206
196
  });
207
197
 
@@ -221,10 +211,8 @@ describe('Create item page - Grid fill: All or nothing', () => {
221
211
  gridFillPage.steps.verifyPreviewScore(20, 20);
222
212
  gridFillPage.steps.switchToGradingView();
223
213
  }
224
- gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
225
- gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
226
- gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
227
- gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
214
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 0);
215
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 1);
228
216
  gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
229
217
  });
230
218
  });
@@ -84,21 +84,15 @@ describe('Create item page - grid fill - Check answer functionality', () => {
84
84
  gridFillPage.steps.selectCellPreviewTab(0, 4);
85
85
  gridFillPage.steps.selectCellPreviewTab(0, 2);
86
86
  checkAnswer(view);
87
- gridFillPage.steps.verifyIncorrectResponseBorder(0, 4);
88
- gridFillPage.steps.verifyIncorrectResponseIcon(0, 4);
89
- gridFillPage.steps.verifyIncorrectResponseBackgroundColor(0, 4);
90
- gridFillPage.steps.verifyIncorrectResponseBorder(0, 2);
91
- gridFillPage.steps.verifyIncorrectResponseIcon(0, 2);
92
- gridFillPage.steps.verifyIncorrectResponseBackgroundColor(0, 2);
87
+ gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0, 4);
88
+ gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0, 2);
93
89
  gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
94
90
  });
95
91
 
96
92
  it('When the user attempts the question partially correct and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, correct icons should be displayed besides correct responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
97
93
  gridFillPage.steps.selectCellPreviewTab(0, 0);
98
94
  checkAnswer(view);
99
- gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
100
- gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
101
- gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 0);
95
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 0);
102
96
  gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
103
97
  });
104
98
 
@@ -107,15 +101,9 @@ describe('Create item page - grid fill - Check answer functionality', () => {
107
101
  gridFillPage.steps.selectCellPreviewTab(0, 1);
108
102
  gridFillPage.steps.selectCellPreviewTab(0, 3);
109
103
  checkAnswer(view);
110
- gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
111
- gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
112
- gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 0);
113
- gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
114
- gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
115
- gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 1);
116
- gridFillPage.steps.verifyIncorrectResponseBorder(0, 3);
117
- gridFillPage.steps.verifyIncorrectResponseIcon(0, 3);
118
- gridFillPage.steps.verifyIncorrectResponseBackgroundColor(0, 3);
104
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 0);
105
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 1);
106
+ gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0, 3);
119
107
  gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
120
108
  });
121
109
 
@@ -123,12 +111,8 @@ describe('Create item page - grid fill - Check answer functionality', () => {
123
111
  gridFillPage.steps.selectCellPreviewTab(0, 0);
124
112
  gridFillPage.steps.selectCellPreviewTab(0, 1);
125
113
  checkAnswer(view);
126
- gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
127
- gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
128
- gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 0);
129
- gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
130
- gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
131
- gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 1);
114
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 0);
115
+ gridFillPage.steps.verifyCorrectResponseIconPreviewTab(0, 1);
132
116
  gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
133
117
  });
134
118
  });