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,235 @@
1
+ import { textSelectionPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ const paragraphTextArray = ['All animals have a unique role to play in maintaining the balance of nature.', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.', 'Birds are creatures with feathers, beaks, and the ability to lay eggs.', 'Many animal species are undocumented even today.', 'Research is going on to discover new species in the far corners of the earth']
4
+
5
+ describe('Create Item page - Text selection: Preview tab Scoring Section - All or nothing scoring with alternate answer', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Question Preview: AutoScored - All or Nothing with alternate answer: When Alternate Answer points are more than Correct Answer points', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ cy.log('Navigating to Text selection question type');
14
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
15
+ cy.barsPreLoaderWait();
16
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
17
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
18
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
19
+ textSelectionPage.steps.allotPoints(12);
20
+ textSelectionPage.steps.addAlternativeAnswerAccordion(1);
21
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
22
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
23
+ textSelectionPage.steps.allotPoints(20);
24
+ textSelectionPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
25
+ textSelectionPage.steps.switchToPreviewTab();
26
+ });
27
+
28
+ it('When the user selects \'Grading view\' without attempting the question, a status message with text \'Your answer is incorrect\' and correct answer section should be displayed with correct answers of the alternate accordion should be displayed', () => {
29
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
30
+ textSelectionPage.steps.switchToGradingView();
31
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
32
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
33
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[2]);
34
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[3]);
35
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
36
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
37
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[2]);
38
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
39
+ });
40
+
41
+ it('When the user attempts the question according to the correct accordion then user should be awarded with points of the correct accordion(less than full points) and on switching to \'Grading view\' correct icons should be displayed besides the correct attempted options from the correct accordion and a status message with text \'Your answer is correct\' should be displayed and the correct answer section should not be displayed', () => {
42
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
43
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
44
+ textSelectionPage.steps.verifyPreviewScore(12, 20);
45
+ textSelectionPage.steps.switchToGradingView();
46
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
47
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
48
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
49
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
50
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
51
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
52
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
53
+
54
+ cy.log('When the user attempts the question according to the correct accordion then on selecting \'Check answer\' button correct icons should be displayed besides the correct attempted options from the correct accordion and a status message with text \'Your answer is correct\' should be displayed')
55
+ textSelectionPage.steps.checkAnswer();
56
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
57
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
58
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
59
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
60
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
61
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
62
+ });
63
+
64
+ it('When the user attempts the question according to the alternate accordion then user should be awarded with full points) and on switching to \'Grading view\' correct icons should be displayed besides the correct attempted options from the alternate accordion and a status message with text \'Your answer is correct\' should be displayed', () => {
65
+ textSelectionPage.steps.resetQuestionPreview();
66
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
67
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
68
+ textSelectionPage.steps.verifyPreviewScore(20, 20);
69
+ textSelectionPage.steps.switchToGradingView();
70
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
71
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
72
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
73
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
74
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
75
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
76
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
77
+
78
+ cy.log('When the user attempts the question according to the alternate accordion then on selecting \'Check answer\' button correct icons should be displayed besides the correct attempted options from the alternate accordion and a status message with text \'Your answer is correct\' should be displayed')
79
+ textSelectionPage.steps.checkAnswer();
80
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
81
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
82
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
83
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
84
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
85
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
86
+ });
87
+
88
+ it('When the user attempts the question partially correct exclusively according to the correct accordion then 0 points should be awarded and on switching to \'Grading view\' correct icons should be displayed beside the correct options from the correct accordion and a status message with text \'Your answer is incorrect\' and the correct answer section with alternate accordion answers should be displayed', () => {
89
+ textSelectionPage.steps.resetQuestionPreview();
90
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
91
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
92
+ textSelectionPage.steps.switchToGradingView();
93
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
94
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
95
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
96
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
97
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
98
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
99
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[2]);
100
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
101
+
102
+ cy.log('When the user attempts the question partially correct exclusively according to the correct accordion then on selecting \'Check answer\' button correct icons should be displayed beside the correctly attempted options from the correct accordion and a status message with text \'Your answer is incorrect\' should be displayed')
103
+ textSelectionPage.steps.checkAnswer()
104
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
105
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[1]);
106
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
107
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
108
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
109
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
110
+ });
111
+
112
+ it('When the user attempts the question partially correct exclusively according to the alternate accordion then 0 points should be awarded and on switching to \'Grading view\' correct icons should be displayed beside the correct options from the alternate accordion and a status message with text \'Your answer is incorrect\' and the correct answer section with alternate accordion answers should be displayed', () => {
113
+ textSelectionPage.steps.resetQuestionPreview();
114
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
115
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
116
+ textSelectionPage.steps.switchToGradingView();
117
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
118
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
119
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
120
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
121
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
122
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
123
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[2]);
124
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
125
+
126
+ cy.log('When the user attempts the question partially correct exclusively according to the alternate accordion then on selecting \'Check answer\' button correct icons should be displayed beside the correctly attempted option from the alternate accordion and a status message with text \'Your answer is incorrect\' should be displayed')
127
+ textSelectionPage.steps.checkAnswer();
128
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
129
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[1]);
130
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
131
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
132
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
133
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
134
+ });
135
+
136
+ it('When the user attempts the question partially correct with equal number of options form the correct and alternate accordion then user should be awarded with 0 points and on switching to the \'Grading view\' the correct icons should be displayed beside the correct options from the alternate accordion, incorrect icons should be displayed beside the options from the correct accordion and a status message with text \'Your answer is incorrect\' and the correct answer section with alternate accordion answers should be displayed', () => {
137
+ textSelectionPage.steps.resetQuestionPreview();
138
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
139
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
140
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
141
+ textSelectionPage.steps.switchToGradingView();
142
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[0]);
143
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
144
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
145
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
146
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
147
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
148
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[2]);
149
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
150
+
151
+ cy.log('When the user attempts the question partially correct with equal number of options form the correct and alternate accordion then on selecting the \'Check answer\' button the correct icons should be displayed beside the correctly attempted options from the alternate accordion, incorrect icons should be displayed beside the attempted options of the correct accordion and a status message with text \'Your answer is incorrect\' should be displayed')
152
+ textSelectionPage.steps.checkAnswer()
153
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[0]);
154
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
155
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
156
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
157
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
158
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
159
+ });
160
+
161
+ it('Race condition 1: When the user attempts the question with the common option between correct accordion and alternate accordion then user should be awarded with 0 points and on switching to the \'Grading view\' the correct icon should be displayed beside the common option and correct accordion options and a status message with text \'Your answer is incorrect\' and the correct answer section with alternate accordion answers should be displayed', () => {
162
+ textSelectionPage.steps.resetQuestionPreview();
163
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
164
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
165
+ textSelectionPage.steps.switchToGradingView();
166
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
167
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
168
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
169
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
170
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
171
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
172
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[2]);
173
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
174
+
175
+ cy.log('Race condition 1: When the user attempts the question with the common option between correct accordion and alternate accordion then on selecting the \'Check answer\' button the correct icon should be displayed beside the common option and a status message with text \'Your answer is incorrect\' should be displayed')
176
+ textSelectionPage.steps.checkAnswer();
177
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
178
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
179
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
180
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
181
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
182
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
183
+ });
184
+
185
+ it('Race condition 2: When the user attempts the question with the all correct option from correct accordion and alternate accordion then user should be awarded with 0 points and on switching to the \'Grading view\' the correct icon should be displayed for the options of the alternate accordion and incorrect icon should be displayed beside the correct accordion option, a status message with text \'Your answer is incorrect\' and the correct answer section with alternate accordion answers should be displayed', () => {
186
+ textSelectionPage.steps.resetQuestionPreview();
187
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
188
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
189
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
190
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
191
+ textSelectionPage.steps.switchToGradingView();
192
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[0]);
193
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
194
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
195
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
196
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
197
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
198
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[2]);
199
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
200
+
201
+ cy.log('Race condition 2: When the user attempts the question with the all correct option from correct accordion and alternate accordion then on selecting \'Check answer\' button the correct icon should be displayed for the options of the alternate accordion and incorrect icon should be displayed beside the correct accordion option, a status message with text \'Your answer is incorrect\' should be displayed')
202
+ textSelectionPage.steps.checkAnswer();
203
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[0]);
204
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
205
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
206
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
207
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
208
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
209
+ });
210
+
211
+ it('When user attempts the question incorrectly then on switching to \'Grading view\', the user should be awarded 0 points and incorrect icons should be beside incorrect attempted option a status message with text \'Your answer is incorrect\' and the correct answer section with alternate accordion answers should be displayed', () => {
212
+ textSelectionPage.steps.resetQuestionPreview();
213
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[3]);
214
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
215
+ textSelectionPage.steps.switchToGradingView();
216
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
217
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
218
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
219
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[3]);
220
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
221
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
222
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[2]);
223
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
224
+
225
+ cy.log('When user attempts the question incorrectly and clicks on the \'Check Answer\' button, then incorrect icons should be beside incorrect attempted options and a status message with text \'Your answer is incorrect\' should be displayed')
226
+ textSelectionPage.steps.checkAnswer();
227
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
228
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[1]);
229
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
230
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[3]);
231
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
232
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
233
+ });
234
+ });
235
+ });
@@ -0,0 +1,235 @@
1
+ import { textSelectionPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ const paragraphTextArray = ['All animals have a unique role to play in maintaining the balance of nature.', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.', 'Birds are creatures with feathers, beaks, and the ability to lay eggs.', 'Many animal species are undocumented even today.', 'Research is going on to discover new species in the far corners of the earth']
4
+
5
+ describe('Create Item page - Text selection: Preview tab Scoring Section - All or nothing scoring with alternate answer', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Question Preview: AutoScored - All or Nothing with alternate answer: When Correct Answer points are equal to Alternate Answer points', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ cy.log('Navigating to Text selection question type');
14
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
15
+ cy.barsPreLoaderWait();
16
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
17
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
18
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
19
+ textSelectionPage.steps.allotPoints(20);
20
+ textSelectionPage.steps.addAlternativeAnswerAccordion(1);
21
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
22
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
23
+ textSelectionPage.steps.allotPoints(20);
24
+ textSelectionPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
25
+ textSelectionPage.steps.switchToPreviewTab();
26
+ });
27
+
28
+ it('When the user selects \'Grading view\' without attempting the question, a status message with text \'Your answer is incorrect\' and correct answer section should be displayed with correct answers of the correct accordion should be displayed', () => {
29
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
30
+ textSelectionPage.steps.switchToGradingView();
31
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
32
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
33
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[2]);
34
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[3]);
35
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
36
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
37
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
38
+ cy.log('Post step: Unchecking the show correct answer checkbox')
39
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
40
+ });
41
+
42
+ it('When the user attempts the question according to the correct accordion then user should be awarded with full points and on switching to \'Grading view\' correct icons should be displayed besides the correct attempted options from the correct accordion and a status message with text \'Your answer is correct\' should be displayed', () => {
43
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
44
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
45
+ textSelectionPage.steps.verifyPreviewScore(20, 20);
46
+ textSelectionPage.steps.switchToGradingView();
47
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
48
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
49
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
50
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
51
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
52
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
53
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
54
+
55
+ cy.log('When the user attempts the question according to the correct accordion then on selecting \'Check answer\' button correct icons should be displayed besides the correct attempted options from the correct accordion and a status message with text \'Your answer is correct\' should be displayed')
56
+ textSelectionPage.steps.checkAnswer();
57
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
58
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
59
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
60
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
61
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
62
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
63
+ });
64
+
65
+ it('When the user attempts the question according to the alternate accordion then user should be awarded with full points and on switching to \'Grading view\' correct icons should be displayed besides the correct attempted options from the alternate accordion and a status message with text \'Your answer is correct\' and the correct answer section should not be displayed', () => {
66
+ textSelectionPage.steps.resetQuestionPreview();
67
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
68
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
69
+ textSelectionPage.steps.verifyPreviewScore(20, 20);
70
+ textSelectionPage.steps.switchToGradingView();
71
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
72
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
73
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
74
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
75
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
76
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
77
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
78
+
79
+ cy.log('When the user attempts the question according to the alternate accordion then on selecting \'Check answer\' button correct icons should be displayed besides the correct attempted options from the alternate accordion and a status message with text \'Your answer is correct\' should be displayed')
80
+ textSelectionPage.steps.checkAnswer();
81
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
82
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
83
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
84
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
85
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
86
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
87
+ });
88
+
89
+ it('When the user attempts the question partially correct exclusively according to the correct accordion then 0 points should be awarded and on switching to \'Grading view\' correct icons should be displayed beside the correct options from the correct accordion and a status message with text \'Your answer is incorrect\' and the correct answer section should not be displayed', () => {
90
+ textSelectionPage.steps.resetQuestionPreview();
91
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
92
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
93
+ textSelectionPage.steps.switchToGradingView();
94
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
95
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
96
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
97
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
98
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
99
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
100
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
101
+
102
+ cy.log('When the user attempts the question partially correct exclusively according to the correct accordion then on selecting \'Check answer\' button correct icons should be displayed beside the correctly attempted options from the correct accordion and a status message with text \'Your answer is incorrect\' should be displayed')
103
+ textSelectionPage.steps.checkAnswer()
104
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
105
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[1]);
106
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
107
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
108
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
109
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
110
+ });
111
+
112
+ it('When the user attempts the question partially correct exclusively according to the alternate accordion then 0 points should be awarded and on switching to \'Grading view\' correct icons should be displayed beside the attempted correct options and a status message with text \'Your answer is incorrect\' and the correct answer section with correct accordion answers should be displayed', () => {
113
+ textSelectionPage.steps.resetQuestionPreview();
114
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
115
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
116
+ textSelectionPage.steps.switchToGradingView();
117
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
118
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
119
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
120
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
121
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
122
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
123
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
124
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
125
+
126
+ cy.log('When the user attempts the question partially correct exclusively according to the alternate accordion then on selecting \'Check answer\' button correct icons should be displayed beside the correctly attempted option from the alternate accordion and a status message with text \'Your answer is incorrect\' should be displayed')
127
+ textSelectionPage.steps.checkAnswer();
128
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
129
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[1]);
130
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
131
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
132
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
133
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
134
+ });
135
+
136
+ it('When the user attempts the question partially correct with equal number of options form the correct and alternate accordion then user should be awarded with 0 points and on switching to the \'Grading view\' the correct icons should be displayed beside the correct options from the correct accordion, incorrect icons should be displayed beside the options from the alternate accordion and a status message with text \'Your answer is incorrect\' and the correct answer section with correct accordion answers should be displayed', () => {
137
+ textSelectionPage.steps.resetQuestionPreview();
138
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
139
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
140
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
141
+ textSelectionPage.steps.switchToGradingView();
142
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
143
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
144
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
145
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
146
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
147
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
148
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
149
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
150
+
151
+ cy.log('When the user attempts the question partially correct with equal number of options form the correct and alternate accordion then on selecting the \'Check answer\' button the correct icons should be displayed beside the correctly attempted options from the correct accordion, incorrect icons should be displayed beside the attempted options of the alternate accordion and a status message with text \'Your answer is incorrect\' should be displayed')
152
+ textSelectionPage.steps.checkAnswer()
153
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
154
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[1]);
155
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
156
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
157
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
158
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
159
+ });
160
+
161
+ it('Race condition 1: When the user attempts the question with the common option between correct accordion and alternate accordion then user should be awarded with 0 points and on switching to the \'Grading view\' the correct icon should be displayed beside the common option and correct accordion options and a status message with text \'Your answer is incorrect\' and the correct answer section with correct accordion answers should be displayed', () => {
162
+ textSelectionPage.steps.resetQuestionPreview();
163
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
164
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
165
+ textSelectionPage.steps.switchToGradingView();
166
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
167
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
168
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
169
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
170
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
171
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
172
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
173
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
174
+
175
+ cy.log('Race condition 1: When the user attempts the question with the common option between correct accordion and alternate accordion then on selecting the \'Check answer\' button the correct icon should be displayed beside the common option and a status message with text \'Your answer is incorrect\' should be displayed')
176
+ textSelectionPage.steps.checkAnswer();
177
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
178
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
179
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
180
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
181
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
182
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
183
+ });
184
+
185
+ it('Race condition 2: When the user attempts the question with the all correct option from correct accordion and alternate accordion then user should be awarded with 0 points and on switching to the \'Grading view\' the correct icon should be displayed for the options of the correct accordion and incorrect icon should be displayed beside the alternate accordion option, a status message with text \'Your answer is incorrect\' and the correct answer section with correct accordion answers should be displayed', () => {
186
+ textSelectionPage.steps.resetQuestionPreview();
187
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
188
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
189
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
190
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
191
+ textSelectionPage.steps.switchToGradingView();
192
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
193
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
194
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
195
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
196
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
197
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
198
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
199
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
200
+
201
+ cy.log('Race condition 2: When the user attempts the question with the all correct option from correct accordion and alternate accordion then on selecting \'Check answer\' button the correct icon should be displayed for the options of the correct accordion and incorrect icon should be displayed beside the alternate accordion option, a status message with text \'Your answer is incorrect\' should be displayed')
202
+ textSelectionPage.steps.checkAnswer();
203
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
204
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
205
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
206
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
207
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
208
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
209
+ });
210
+
211
+ it('When user attempts the question incorrectly then on switching to \'Grading view\', the user should be awarded 0 points and incorrect icons should be beside incorrect attempted option a status message with text \'Your answer is incorrect\' and the correct answer section with correct accordion answers should be displayed', () => {
212
+ textSelectionPage.steps.resetQuestionPreview();
213
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[3]);
214
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
215
+ textSelectionPage.steps.switchToGradingView();
216
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
217
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
218
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
219
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[3]);
220
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
221
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
222
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
223
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
224
+
225
+ cy.log('When user attempts the question incorrectly and clicks on the \'Check Answer\' button, then incorrect icons should be beside incorrect attempted options and a status message with text \'Your answer is incorrect\' should be displayed')
226
+ textSelectionPage.steps.checkAnswer();
227
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
228
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[1]);
229
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
230
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[3]);
231
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
232
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
233
+ });
234
+ });
235
+ });