itemengine-cypress-automation 1.0.120 → 1.0.122-updateILCRepo28Feb-2c3e0e3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +13 -1
  2. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +2 -0
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -2
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +1 -4
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +273 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js +116 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +136 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +224 -0
  12. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +120 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +158 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -1
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -4
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +246 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +332 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +409 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +80 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +213 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +2 -2
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +1 -1
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +2 -2
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +68 -68
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +3 -289
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -23
  32. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +191 -0
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +190 -0
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +284 -0
  35. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
  36. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +113 -0
  37. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +217 -0
  38. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +234 -0
  39. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +217 -0
  40. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +217 -0
  41. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsBasic.js +136 -0
  42. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +197 -0
  43. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +169 -0
  44. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +197 -0
  45. package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +219 -0
  46. package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAnswerFunctionalityForAllViews.smoke.js +115 -0
  47. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +142 -0
  48. package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +152 -0
  49. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +39 -0
  50. package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +2 -12
  51. package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +497 -0
  52. package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +503 -0
  53. package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +233 -0
  54. package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +291 -0
  55. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +332 -0
  56. package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +2 -12
  57. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +9 -8
  58. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +4 -4
  59. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -2
  60. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +5 -2
  61. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +334 -0
  62. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +419 -0
  63. package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +166 -0
  64. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +166 -0
  65. package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +51 -0
  66. package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +99 -0
  67. package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +71 -0
  68. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +155 -0
  69. package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +66 -0
  70. package/cypress/fixtures/theme/ilc.json +3 -1
  71. package/cypress/pages/audioResponsePage.js +2 -1
  72. package/cypress/pages/components/additionalSettingsPanel.js +27 -0
  73. package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
  74. package/cypress/pages/components/autoScoredScoringSection.js +1 -1
  75. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
  76. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  77. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
  78. package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
  79. package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
  80. package/cypress/pages/components/createQuestionBasePage.js +8 -2
  81. package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
  82. package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
  83. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
  84. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
  85. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
  86. package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
  87. package/cypress/pages/components/index.js +3 -3
  88. package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
  89. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
  90. package/cypress/pages/components/questionInputFieldComponent.js +49 -23
  91. package/cypress/pages/components/scoringSectionBase.js +1 -1
  92. package/cypress/pages/createItemPage.js +67 -2
  93. package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
  94. package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
  95. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
  96. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
  97. package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
  98. package/cypress/pages/fillInTheGapsTextPage.js +52 -199
  99. package/cypress/pages/index.js +5 -5
  100. package/cypress/pages/multipleSelectionPage.js +1 -0
  101. package/cypress/pages/shortTextResponsePage.js +575 -33
  102. package/cypress/pages/singleSelectionGridPage.js +1 -2
  103. package/cypress/pages/singleSelectionPage.js +5 -6
  104. package/cypress/pages/textEntryMathPage.js +46 -22
  105. package/cypress/pages/textEntryMathWithImagePage.js +212 -0
  106. package/cypress/pages/uploadResponsePage.js +74 -21
  107. package/package.json +2 -2
  108. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
  109. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
  110. package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
  111. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
  112. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
  113. package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
  114. package/cypress/pages/fillInTheGapsScoring.js +0 -5872
  115. package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -0,0 +1,197 @@
1
+ import { fillInTheGapsTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill in the gaps with text: Partial equal weights with alternative answers', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - Partial equal weights - When \'Alternative\' points are more than \'Correct\' points', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsTextPage.steps.addResponseAreaInQuestionField();
15
+ fillInTheGapsTextPage.steps.allotPoints(9);
16
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
17
+ fillInTheGapsTextPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
18
+ fillInTheGapsTextPage.steps.addAlternativeAnswerAccordion(1);
19
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
20
+ fillInTheGapsTextPage.steps.allotPoints(15);
21
+ fillInTheGapsTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
22
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
23
+ });
24
+
25
+ it('When the user selects \'Grading\' view without attempting the question, response area numeration should be displayed, correct answers section should be displayed with correct answers from the alternative accordion and respective response area numeration', () => {
26
+ fillInTheGapsTextPage.steps.switchToGradingView();
27
+ fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
28
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
29
+ });
30
+
31
+ it('When the user attempts the question with responses from the correct accordion, then the user should be awarded points of the correct accordion (less than full points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, correct/incorrect status message and correct answer section should not be displayed', () => {
32
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
33
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
34
+ fillInTheGapsTextPage.steps.verifyPreviewScore(9, 15);
35
+ fillInTheGapsTextPage.steps.switchToGradingView();
36
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
37
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
38
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
39
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
40
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
41
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
42
+ cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message and correct answer section should not be displayed')
43
+ fillInTheGapsTextPage.steps.checkAnswer();
44
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
45
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
46
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
47
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
48
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
49
+ });
50
+
51
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, correct/incorrect status message and correct answer section should not be displayed', () => {
52
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
53
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
54
+ fillInTheGapsTextPage.steps.verifyPreviewScore(15, 15);
55
+ fillInTheGapsTextPage.steps.switchToGradingView();
56
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
57
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
58
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
59
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
60
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
61
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
62
+ cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message and correct answer section should not be displayed')
63
+ fillInTheGapsTextPage.steps.checkAnswer();
64
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
65
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
66
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
67
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
68
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
69
+ });
70
+
71
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the alternative accordion along with response area numeration should be displayed', () => {
72
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
73
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
74
+ fillInTheGapsTextPage.steps.verifyPreviewScore(6, 15);
75
+ fillInTheGapsTextPage.steps.switchToGradingView();
76
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
77
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
78
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
79
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
80
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
81
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
82
+ cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
83
+ fillInTheGapsTextPage.steps.checkAnswer();
84
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
85
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
86
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
87
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
88
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
89
+ });
90
+
91
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, correct icon should be displayed besides the alternative answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the alternative accordion along with response area numeration should be displayed', () => {
92
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
93
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }]);
94
+ fillInTheGapsTextPage.steps.verifyPreviewScore(5, 15);
95
+ fillInTheGapsTextPage.steps.switchToGradingView();
96
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
97
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
98
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
99
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
100
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
101
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
102
+ cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
103
+ fillInTheGapsTextPage.steps.checkAnswer();
104
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
105
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
106
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
107
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
108
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
109
+ });
110
+
111
+ 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 points of the correctly attempted responses and on switching to \'Grading\' view, correct icon should be displayed besides response field with correct answer responses, incorrect icon should be displayed beside responses from the alternative accordion, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the alternative accordion along with response area numeration should be displayed', () => {
112
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
113
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaf' }]);
114
+ fillInTheGapsTextPage.steps.verifyPreviewScore(5, 15);
115
+ fillInTheGapsTextPage.steps.switchToGradingView();
116
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
117
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
118
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
119
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
120
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
121
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
122
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses correct/incorrect status message should not be displayed and correct answer section should not be displayed')
123
+ fillInTheGapsTextPage.steps.checkAnswer();
124
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
125
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
126
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
127
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
128
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
129
+ });
130
+
131
+ 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 points of the correctly attempted responses and on switching to \'Grading\' view, correct icon should be besides the common response, no icon should be displayed beside unattempted response, \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion along with response area numeration should be displayed', () => {
132
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
133
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
134
+ fillInTheGapsTextPage.steps.verifyPreviewScore(5, 15);
135
+ fillInTheGapsTextPage.steps.switchToGradingView();
136
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
137
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
138
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
139
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
140
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
141
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
142
+ cy.log('When the user has attempted the question with common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
143
+ fillInTheGapsTextPage.steps.checkAnswer();
144
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
145
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
146
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
147
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
148
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
149
+ });
150
+
151
+ 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, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section with all correct answers along with response area numeration should be displayed', () => {
152
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
153
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
154
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 15);
155
+ fillInTheGapsTextPage.steps.switchToGradingView();
156
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
157
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
158
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
159
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
160
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
161
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
162
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
163
+ fillInTheGapsTextPage.steps.checkAnswer();
164
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
165
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
166
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
167
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
168
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
169
+ });
170
+
171
+ it('Overachiever case: When the user attempts the question with more number of correct responses from the correct accordion than the alternative accordion but the score of the individual response selected from the alternative accordion overpowers the combined score of the correct accordion answers then on switching to the \'Grading view\', then points awarded should be of the alternative accordion, correct icons should be displayed for the alternative accordion response, incorrect icon should be displayed for the correct accordion responses, correct/incorrect answer status message should not be displayed and correct answer section with all correct answers from the alternative accordion along with response area numeration should be displayed', () => {
172
+ cy.log('Pre-step: Switching to Edit tab and allotting points to alternative accordion such that the difference between the points is substantial and the points per response are in decimal')
173
+ fillInTheGapsTextPage.steps.switchToEditTab();
174
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 2, responseText: 'Branch' }]);
175
+ fillInTheGapsTextPage.steps.allotPoints(23);
176
+ fillInTheGapsTextPage.steps.expandCorrectAnswerAccordion();
177
+ fillInTheGapsTextPage.steps.allotPoints(5);
178
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
179
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Branch' }]);
180
+ fillInTheGapsTextPage.steps.verifyPreviewScore(7.67, 23);
181
+ fillInTheGapsTextPage.steps.switchToGradingView();
182
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
183
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
184
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
185
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
186
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Roots']);
187
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
188
+ cy.log('When the user has attempted the question with more number of correct responses from the correct accordion than the alternative accordion but the score of the individual response selected from the alternative accordion overpowers the combined score of the correct accordion answers and clicks on the \'Check answer\' button, correct icons should be displayed for the alternative accordion response, incorrect icon should be displayed for the correct accordion responses, correct/incorrect answer status message and correct answer section should not be displayed')
189
+ fillInTheGapsTextPage.steps.checkAnswer();
190
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
191
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
192
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
193
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
194
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
195
+ });
196
+ });
197
+ });
@@ -0,0 +1,169 @@
1
+ import { fillInTheGapsTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill in the gaps with text: Partial equal with alternative answers', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - Partial equal weights with alternative answer - When \'Correct answer\' points are equal to \'Alternative answer\' points', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsTextPage.steps.addResponseAreaInQuestionField();
15
+ fillInTheGapsTextPage.steps.allotPoints(15);
16
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
17
+ fillInTheGapsTextPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
18
+ fillInTheGapsTextPage.steps.addAlternativeAnswerAccordion(1);
19
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
20
+ fillInTheGapsTextPage.steps.allotPoints(15);
21
+ fillInTheGapsTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
22
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
23
+ });
24
+
25
+ it('When the user selects \'Grading\' view without attempting the question, response area numeration should be displayed, correct answers section should be displayed with correct answers from the correct accordion and respective response area numeration', () => {
26
+ fillInTheGapsTextPage.steps.switchToGradingView();
27
+ fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
28
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
29
+ });
30
+
31
+ 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, correct icons should be displayed beside all the correct responses, correct/incorrect status message and correct answer section should not be displayed', () => {
32
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
33
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
34
+ fillInTheGapsTextPage.steps.verifyPreviewScore(15, 15);
35
+ fillInTheGapsTextPage.steps.switchToGradingView();
36
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
37
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
38
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
39
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
40
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
41
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
42
+ cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message and correct answer section should not be displayed')
43
+ fillInTheGapsTextPage.steps.checkAnswer();
44
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
45
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
46
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
47
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
48
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
49
+ });
50
+
51
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, correct/incorrect status message and correct answer section should not be displayed', () => {
52
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
53
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
54
+ fillInTheGapsTextPage.steps.verifyPreviewScore(15, 15);
55
+ fillInTheGapsTextPage.steps.switchToGradingView();
56
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
57
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
58
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
59
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
60
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
61
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
62
+ cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message and correct answer section should not be displayed')
63
+ fillInTheGapsTextPage.steps.checkAnswer();
64
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
65
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
66
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
67
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
68
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
69
+ });
70
+
71
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded points of the correct accordion and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
72
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
73
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
74
+ fillInTheGapsTextPage.steps.verifyPreviewScore(10, 15);
75
+ fillInTheGapsTextPage.steps.switchToGradingView();
76
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
77
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
78
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
79
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
80
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
81
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
82
+ cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message and correct answer section should not be displayed')
83
+ fillInTheGapsTextPage.steps.checkAnswer();
84
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
85
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
86
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
87
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
88
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
89
+ });
90
+
91
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
92
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
93
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }]);
94
+ fillInTheGapsTextPage.steps.verifyPreviewScore(5, 15);
95
+ fillInTheGapsTextPage.steps.switchToGradingView();
96
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
97
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
98
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
99
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
100
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
101
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
102
+ cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section should not be displayed')
103
+ fillInTheGapsTextPage.steps.checkAnswer();
104
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
105
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
106
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
107
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
108
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
109
+ });
110
+
111
+ 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 points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides response field with correct answer responses, incorrect icon should be displayed beside responses from the alternative accordion, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
112
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
113
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaf' }]);
114
+ fillInTheGapsTextPage.steps.verifyPreviewScore(5, 15);
115
+ fillInTheGapsTextPage.steps.switchToGradingView();
116
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
117
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
118
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
119
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
120
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
121
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses, correct/incorrect status message and correct answer section should not be displayed')
122
+ fillInTheGapsTextPage.steps.checkAnswer();
123
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
124
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
125
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
126
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
127
+ });
128
+
129
+ 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 points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be besides the common response, no icon should be displayed beside unattempted response, \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
130
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
131
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
132
+ fillInTheGapsTextPage.steps.verifyPreviewScore(5, 15);
133
+ fillInTheGapsTextPage.steps.switchToGradingView();
134
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
135
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
136
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
137
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
138
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
139
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
140
+ cy.log('When the user has attempted the question with the common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section should not be displayed')
141
+ fillInTheGapsTextPage.steps.checkAnswer();
142
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
143
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
144
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
145
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
146
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
147
+ });
148
+
149
+ 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, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section with all correct answers along with response area numeration should be displayed', () => {
150
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
151
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
152
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 15);
153
+ fillInTheGapsTextPage.steps.switchToGradingView();
154
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
155
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
156
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
157
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
158
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
159
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
160
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section should not be displayed')
161
+ fillInTheGapsTextPage.steps.checkAnswer();
162
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
163
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
164
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
165
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
166
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
167
+ });
168
+ });
169
+ });
@@ -0,0 +1,197 @@
1
+ import { fillInTheGapsTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill in the gaps with text: Partial equal weights with alternative answers', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - Partial equal weights with alternative answer - When \'Correct answer\' points are more than \'Alternative answer\' points', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsTextPage.steps.addResponseAreaInQuestionField();
15
+ fillInTheGapsTextPage.steps.allotPoints(15);
16
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
17
+ fillInTheGapsTextPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
18
+ fillInTheGapsTextPage.steps.addAlternativeAnswerAccordion(1);
19
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
20
+ fillInTheGapsTextPage.steps.allotPoints(9);
21
+ fillInTheGapsTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
22
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
23
+ });
24
+
25
+ it('When the user selects \'Grading\' view without attempting the question, correct answers section should be displayed with correct answers from the correct accordion and respective response area numeration', () => {
26
+ fillInTheGapsTextPage.steps.switchToGradingView();
27
+ fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
28
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
29
+ });
30
+
31
+ 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, correct icons should be displayed beside all the correct responses, correct/incorrect and correct answer section should not be displayed', () => {
32
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
33
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
34
+ fillInTheGapsTextPage.steps.verifyPreviewScore(15, 15);
35
+ fillInTheGapsTextPage.steps.switchToGradingView();
36
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
37
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
38
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
39
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
40
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
41
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
42
+ cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect and correct answer section should not be displayed')
43
+ fillInTheGapsTextPage.steps.checkAnswer();
44
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
45
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
46
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
47
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
48
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
49
+ });
50
+
51
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with points specified for alternative accordion (less than full points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, correct/incorrect and correct answer section should not be displayed', () => {
52
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
53
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
54
+ fillInTheGapsTextPage.steps.verifyPreviewScore(9, 15);
55
+ fillInTheGapsTextPage.steps.switchToGradingView();
56
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
57
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
58
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
59
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
60
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
61
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
62
+ cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect and correct answer section should not be displayed')
63
+ fillInTheGapsTextPage.steps.checkAnswer();
64
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
65
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
66
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
67
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
68
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
69
+ });
70
+
71
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
72
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
73
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
74
+ fillInTheGapsTextPage.steps.verifyPreviewScore(10, 15);
75
+ fillInTheGapsTextPage.steps.switchToGradingView();
76
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
77
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
78
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
79
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
80
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
81
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
82
+ cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
83
+ fillInTheGapsTextPage.steps.checkAnswer();
84
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
85
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
86
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
87
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
88
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
89
+ });
90
+
91
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
92
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
93
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }]);
94
+ fillInTheGapsTextPage.steps.verifyPreviewScore(3, 15);
95
+ fillInTheGapsTextPage.steps.switchToGradingView();
96
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
97
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
98
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
99
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
100
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
101
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
102
+ cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response correct/incorrect status message should not be displayed and correct answer section should not be displayed')
103
+ fillInTheGapsTextPage.steps.checkAnswer();
104
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
105
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
106
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
107
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
108
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
109
+ });
110
+
111
+ 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 points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides response field with correct answer responses, incorrect icon should be displayed beside responses from the alternative accordion, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
112
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
113
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaf' }]);
114
+ fillInTheGapsTextPage.steps.verifyPreviewScore(5, 15);
115
+ fillInTheGapsTextPage.steps.switchToGradingView();
116
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
117
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
118
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
119
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
120
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
121
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
122
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses correct/incorrect status message should not be displayed and correct answer section should not be displayed')
123
+ fillInTheGapsTextPage.steps.checkAnswer();
124
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
125
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
126
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
127
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
128
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
129
+ });
130
+
131
+ 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 points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be besides the common response, no icon should be displayed beside unattempted response, \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
132
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
133
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
134
+ fillInTheGapsTextPage.steps.verifyPreviewScore(5, 15);
135
+ fillInTheGapsTextPage.steps.switchToGradingView();
136
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
137
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
138
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
139
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
140
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
141
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
142
+ cy.log('When the user has attempted the question with common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response correct/incorrect status message should not be displayed and correct answer section should not be displayed')
143
+ fillInTheGapsTextPage.steps.checkAnswer();
144
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
145
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
146
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
147
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
148
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
149
+ });
150
+
151
+ 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, no icon should be displayed beside unattempted response correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
152
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
153
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
154
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 15);
155
+ fillInTheGapsTextPage.steps.switchToGradingView();
156
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
157
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
158
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
159
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
160
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
161
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
162
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response correct/incorrect status message should not be displayed and correct answer section should not be displayed')
163
+ fillInTheGapsTextPage.steps.checkAnswer();
164
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
165
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
166
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
167
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
168
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
169
+ });
170
+
171
+ it('Overachiever case: When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response from the correct accordion overpowers the combined score of the alternative accordion answers then on switching to the \'Grading view\', then points awarded should be of the correct accordion, correct icons should be displayed for the correct accordion response, incorrect icon should be displayed for the alternative accordion responses, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
172
+ cy.log('Pre-step: Switching to Edit tab and allotting points to alternative accordion such that the difference between the points is substantial and there are no common responses between the two accordions')
173
+ fillInTheGapsTextPage.steps.switchToEditTab();
174
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 2, responseText: 'Branch' }]);
175
+ fillInTheGapsTextPage.steps.allotPoints(5);
176
+ fillInTheGapsTextPage.steps.expandCorrectAnswerAccordion();
177
+ fillInTheGapsTextPage.steps.allotPoints(23);
178
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
179
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Branch' }]);
180
+ fillInTheGapsTextPage.steps.verifyPreviewScore(7.67, 23);
181
+ fillInTheGapsTextPage.steps.switchToGradingView();
182
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
183
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
184
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
185
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
186
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
187
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
188
+ cy.log('When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response from the correct accordion overpowers the combined score of the alternative accordion answers and clicks on the \'Check answer\' button, correct icons should be displayed beside correct accordion responses, incorrect icons should be displayed for the alternative accordion responses, correct/incorrect answer status message and correct answer section should not be displayed')
189
+ fillInTheGapsTextPage.steps.checkAnswer();
190
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
191
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
192
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
193
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
194
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
195
+ });
196
+ });
197
+ });