itemengine-cypress-automation 1.0.119 → 1.0.121

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) 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/e2e/migration/migration.js +6 -5
  71. package/cypress/e2e/migration/migration2.js +4 -3
  72. package/cypress/e2e/migration/migration3.js +4 -3
  73. package/cypress/e2e/migration/migration4.js +4 -3
  74. package/cypress/e2e/migration/migration5.js +4 -3
  75. package/cypress/fixtures/theme/ilc.json +3 -1
  76. package/cypress/pages/audioResponsePage.js +2 -1
  77. package/cypress/pages/components/additionalSettingsPanel.js +27 -0
  78. package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
  79. package/cypress/pages/components/autoScoredScoringSection.js +1 -1
  80. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
  81. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  82. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
  83. package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
  84. package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
  85. package/cypress/pages/components/createQuestionBasePage.js +8 -2
  86. package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
  87. package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
  88. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
  89. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
  90. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
  91. package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
  92. package/cypress/pages/components/index.js +3 -3
  93. package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
  94. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
  95. package/cypress/pages/components/questionInputFieldComponent.js +49 -23
  96. package/cypress/pages/components/scoringSectionBase.js +1 -1
  97. package/cypress/pages/createItemPage.js +67 -2
  98. package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
  99. package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
  100. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
  101. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
  102. package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
  103. package/cypress/pages/fillInTheGapsTextPage.js +52 -199
  104. package/cypress/pages/index.js +5 -5
  105. package/cypress/pages/multipleSelectionPage.js +1 -0
  106. package/cypress/pages/shortTextResponsePage.js +575 -33
  107. package/cypress/pages/singleSelectionGridPage.js +1 -2
  108. package/cypress/pages/singleSelectionPage.js +5 -6
  109. package/cypress/pages/textEntryMathPage.js +46 -22
  110. package/cypress/pages/textEntryMathWithImagePage.js +212 -0
  111. package/cypress/pages/uploadResponsePage.js +74 -21
  112. package/cypress/support/migrationHelpers/extractLrnQuestionData.js +73 -2
  113. package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -0
  114. package/cypress/support/migrationHelpers/verifyIeQuestionData.js +49 -2
  115. package/package.json +1 -1
  116. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
  117. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
  118. package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
  119. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
  120. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
  121. package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
  122. package/cypress/pages/fillInTheGapsScoring.js +0 -5872
  123. package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -0,0 +1,190 @@
1
+ import { fillInTheGapsTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill in the gaps with text: All or nothing with alternative answers', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - All or nothing 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(20);
16
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
17
+ fillInTheGapsTextPage.steps.addAlternativeAnswerAccordion(1);
18
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
19
+ fillInTheGapsTextPage.steps.allotPoints(20);
20
+ fillInTheGapsTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
21
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
22
+ });
23
+
24
+ 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', () => {
25
+ fillInTheGapsTextPage.steps.switchToGradingView();
26
+ fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
27
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
28
+ });
29
+
30
+ 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, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
31
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
32
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
33
+ fillInTheGapsTextPage.steps.verifyPreviewScore(20, 20);
34
+ fillInTheGapsTextPage.steps.switchToGradingView();
35
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
36
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
37
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
38
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
39
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
40
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
41
+ 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, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
42
+ fillInTheGapsTextPage.steps.checkAnswer();
43
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
44
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
45
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
46
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
47
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
48
+ });
49
+
50
+ 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, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
51
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
52
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
53
+ fillInTheGapsTextPage.steps.verifyPreviewScore(20, 20);
54
+ fillInTheGapsTextPage.steps.switchToGradingView();
55
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
56
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
57
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
58
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
59
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
60
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
61
+ 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, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
62
+ fillInTheGapsTextPage.steps.checkAnswer();
63
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
64
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
65
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
66
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
67
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
68
+ });
69
+
70
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
71
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
72
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
73
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
74
+ fillInTheGapsTextPage.steps.switchToGradingView();
75
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
76
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
77
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
78
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
79
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
80
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
81
+ 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, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
82
+ fillInTheGapsTextPage.steps.checkAnswer();
83
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
84
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
85
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
86
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
87
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
88
+ });
89
+
90
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
91
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
92
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }]);
93
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
94
+ fillInTheGapsTextPage.steps.switchToGradingView();
95
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
96
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
97
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
98
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
99
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
100
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
101
+ 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 area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
102
+ fillInTheGapsTextPage.steps.checkAnswer();
103
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
104
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
105
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
106
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
107
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
108
+ });
109
+
110
+ it('When the user attempts the question partially correct with all the responses correct as per the alternative accordion but one response incomplete, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the response from the alternative accordion, no icon should be displayed beside unattempted response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
111
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
112
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }]);
113
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
114
+ fillInTheGapsTextPage.steps.switchToGradingView();
115
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
116
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
117
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
118
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
119
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
120
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
121
+ cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one response incomplete and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the alternative accordion, incorrect icon should be displayed besides the empty response, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
122
+ fillInTheGapsTextPage.steps.checkAnswer();
123
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
124
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
125
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
126
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
127
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
128
+ });
129
+
130
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed beside alternative accordion responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
131
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
132
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaf' }]);
133
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
134
+ fillInTheGapsTextPage.steps.switchToGradingView();
135
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
136
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
137
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
138
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
139
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
140
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
141
+ 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 option from the alternative accordion a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
142
+ fillInTheGapsTextPage.steps.checkAnswer();
143
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
144
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
145
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
146
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
147
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
148
+ });
149
+
150
+ it('Race condition : When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, 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', () => {
151
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
152
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
153
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
154
+ fillInTheGapsTextPage.steps.switchToGradingView();
155
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
156
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
157
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
158
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
159
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
160
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
161
+ 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, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
162
+ fillInTheGapsTextPage.steps.checkAnswer();
163
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
164
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
165
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
166
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
167
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
168
+ });
169
+
170
+ 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 area, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with response area numeration should be displayed', () => {
171
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
172
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
173
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
174
+ fillInTheGapsTextPage.steps.switchToGradingView();
175
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
176
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
177
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
178
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
179
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
180
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
181
+ 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, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
182
+ fillInTheGapsTextPage.steps.checkAnswer();
183
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
184
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
185
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
186
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
187
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
188
+ });
189
+ });
190
+ });
@@ -0,0 +1,284 @@
1
+ import { fillInTheGapsTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import utilities from "../../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create item page - Fill in the gaps with text: All or nothing with alternative answers', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Correct answer\' points are more than \'Alternative answer\' points', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
15
+ cy.barsPreLoaderWait();
16
+ fillInTheGapsTextPage.steps.addResponseAreaInQuestionField();
17
+ fillInTheGapsTextPage.steps.allotPoints(20);
18
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
19
+ fillInTheGapsTextPage.steps.addAlternativeAnswerAccordion(1);
20
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
21
+ fillInTheGapsTextPage.steps.allotPoints(10);
22
+ fillInTheGapsTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
23
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
24
+ });
25
+
26
+ 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', () => {
27
+ fillInTheGapsTextPage.steps.switchToGradingView();
28
+ fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
29
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
30
+ });
31
+
32
+ it('CSS of correct answer section and response area numeration', { tags: 'css' }, () => {
33
+ utilities.verifyCSS(fillInTheGapsTextPage.correctAnswersLabel(), {
34
+ 'color': css.color.sectionHeading,
35
+ 'font-size': css.fontSize.default,
36
+ 'font-weight': css.fontWeight.bold
37
+ });
38
+ utilities.verifyCSS(fillInTheGapsTextPage.responseAreaNumeration(), {
39
+ 'background-color': css.color.defaultBackground,
40
+ 'border': `1px solid ${css.color.activeComponentBorder}`
41
+ });
42
+ utilities.verifyCSS(fillInTheGapsTextPage.correctAnswerResponse(), {
43
+ 'color': css.color.text,
44
+ 'font-size': css.fontSize.default,
45
+ 'font-weight': css.fontWeight.regular,
46
+ });
47
+ utilities.verifyCSS(fillInTheGapsTextPage.correctAnswerResponse().parents('[class*="__AnswerWrapper"]'), {
48
+ 'border': `1px solid ${css.color.correctOptionBorder}`
49
+ });
50
+ });
51
+
52
+ it('Accessibility of correct answer section and response area numeration', { tags: 'a11y' }, () => {
53
+ cy.checkAccessibility(fillInTheGapsTextPage.previewTabQuestionWrapper());
54
+ });
55
+
56
+ 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, a status message with text \'Your answer is correct\' should be displayed above the question preview, correct answer section should not be displayed', () => {
57
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
58
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
59
+ fillInTheGapsTextPage.steps.verifyPreviewScore(20, 20);
60
+ fillInTheGapsTextPage.steps.switchToGradingView();
61
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
62
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
63
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
64
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
65
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
66
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
67
+ 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, a status message with text \'Your answer is correct\' should be displayed above the question preview, correct answer section should not be displayed')
68
+ fillInTheGapsTextPage.steps.checkAnswer();
69
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
70
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
71
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
72
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
73
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
74
+ });
75
+
76
+ it('CSS of Correct answer state', { tags: 'css' }, () => {
77
+ utilities.verifyCSS(fillInTheGapsTextPage.previewScoreText(), {
78
+ 'color': css.color.whiteText,
79
+ 'background-color': css.color.correctAnswer
80
+ });
81
+ fillInTheGapsTextPage.correctIcon()
82
+ .verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
83
+ utilities.verifyCSS(fillInTheGapsTextPage.correctIncorrectAnswerBlock(), {
84
+ 'background-color': css.color.correctAnswerLabelBg,
85
+ 'border': `1px solid ${css.color.correctAnswer}`
86
+ });
87
+ utilities.verifyCSS(fillInTheGapsTextPage.correctIncorrectStatusMessageText(), {
88
+ 'color': css.color.text,
89
+ 'font-size': css.fontSize.default,
90
+ 'font-weight': css.fontWeight.regular
91
+ });
92
+ utilities.verifyCSS(fillInTheGapsTextPage.correctIncorrectAnswerLabel(), {
93
+ 'color': css.color.text,
94
+ 'font-size': css.fontSize.default,
95
+ 'font-weight': css.fontWeight.bold
96
+ });
97
+ });
98
+
99
+ it('Accessibility of correct answer state', { tags: 'a11y' }, () => {
100
+ cy.checkAccessibility(fillInTheGapsTextPage.previewTabQuestionWrapper());
101
+ });
102
+
103
+ it('When the user attempts the question with alternative accordion response, then the user should be awarded with points specified for alternative accordion (less than full points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
104
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
105
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
106
+ fillInTheGapsTextPage.steps.verifyPreviewScore(10, 20);
107
+ fillInTheGapsTextPage.steps.switchToGradingView();
108
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
109
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
110
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
111
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
112
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
113
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
114
+ cy.log('When the user has attempted the question with alternative accordion response and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
115
+ fillInTheGapsTextPage.steps.checkAnswer();
116
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
117
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
118
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
119
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
120
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
121
+ });
122
+
123
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
124
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
125
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
126
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
127
+ fillInTheGapsTextPage.steps.switchToGradingView();
128
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
129
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
130
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
131
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
132
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
133
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
134
+ 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, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
135
+ fillInTheGapsTextPage.steps.checkAnswer();
136
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
137
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
138
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
139
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
140
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
141
+ });
142
+
143
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
144
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
145
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }]);
146
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
147
+ fillInTheGapsTextPage.steps.switchToGradingView();
148
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
149
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
150
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
151
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
152
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
153
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
154
+ 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 area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
155
+ fillInTheGapsTextPage.steps.checkAnswer();
156
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
157
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
158
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
159
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
160
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
161
+ });
162
+
163
+ it('When the user attempts the question partially correct with all the responses correct as per the alternative accordion but one response incomplete, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct responses and no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
164
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
165
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }]);
166
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
167
+ fillInTheGapsTextPage.steps.switchToGradingView();
168
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
169
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
170
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
171
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
172
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
173
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
174
+ cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one response incomplete and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct responses and no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
175
+ fillInTheGapsTextPage.steps.checkAnswer();
176
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
177
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
178
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
179
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
180
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
181
+ });
182
+
183
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed beside alternative accordion responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
184
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
185
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaves' }]);
186
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
187
+ fillInTheGapsTextPage.steps.switchToGradingView();
188
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
189
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
190
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
191
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
192
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
193
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
194
+ 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 a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
195
+ fillInTheGapsTextPage.steps.checkAnswer();
196
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
197
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
198
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
199
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
200
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
201
+ });
202
+
203
+ it('Race condition : When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, correct icon should be besides the common response, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
204
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
205
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
206
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
207
+ fillInTheGapsTextPage.steps.switchToGradingView();
208
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
209
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
210
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
211
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
212
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
213
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
214
+ 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, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
215
+ fillInTheGapsTextPage.steps.checkAnswer();
216
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
217
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
218
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
219
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
220
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
221
+ });
222
+
223
+ 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 area, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with response area numeration should be displayed', () => {
224
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
225
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
226
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
227
+ fillInTheGapsTextPage.steps.switchToGradingView();
228
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
229
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
230
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
231
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
232
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
233
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
234
+ 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 area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
235
+ fillInTheGapsTextPage.steps.checkAnswer();
236
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
237
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
238
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
239
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
240
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
241
+ });
242
+
243
+ it('CSS of incorrect answer state', { tags: 'css' }, () => {
244
+ fillInTheGapsTextPage.incorrectIcon()
245
+ .verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
246
+ utilities.verifyCSS(fillInTheGapsTextPage.correctIncorrectAnswerBlock(), {
247
+ 'background-color': css.color.incorrectAnswerLabelBg,
248
+ 'border': `1px solid ${css.color.incorrectAnswer}`
249
+ });
250
+ utilities.verifyCSS(fillInTheGapsTextPage.correctIncorrectStatusMessageText(), {
251
+ 'color': css.color.text,
252
+ 'font-size': css.fontSize.default,
253
+ 'font-weight': css.fontWeight.regular
254
+ });
255
+ utilities.verifyCSS(fillInTheGapsTextPage.correctIncorrectAnswerLabel(), {
256
+ 'color': css.color.text,
257
+ 'font-size': css.fontSize.default,
258
+ 'font-weight': css.fontWeight.bold
259
+ });
260
+ });
261
+
262
+ it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
263
+ cy.checkAccessibility(fillInTheGapsTextPage.previewTabQuestionWrapper());
264
+ });
265
+
266
+ it('When the user sets \'Award minimum score only if attempted\' in minimum scoring dropdown and allots minimum points such that minimum points are less than alternative answer points, then attempts the question with responses from the alternative accordion, the user should be awarded with alternative answer points', () => {
267
+ fillInTheGapsTextPage.steps.switchToEditTab();
268
+ fillInTheGapsTextPage.steps.expandMinimumScoringDropdown();
269
+ fillInTheGapsTextPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
270
+ fillInTheGapsTextPage.steps.allotMinimumPoints(3);
271
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
272
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
273
+ fillInTheGapsTextPage.steps.verifyPreviewScore(10, 20);
274
+ });
275
+
276
+ it('When the user sets minimum points such that minimum points are greater than alternative answer points, then attempts the question with responses from the alternative accordion, the user should be awarded with minimum points', () => {
277
+ fillInTheGapsTextPage.steps.switchToEditTab();
278
+ fillInTheGapsTextPage.steps.allotMinimumPoints(13);
279
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
280
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
281
+ fillInTheGapsTextPage.steps.verifyPreviewScore(13, 20);
282
+ });
283
+ });
284
+ });
@@ -0,0 +1,52 @@
1
+ import { fillInTheGapsTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page -Fill in the gaps with text: All or nothing with alternative answers', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - All or nothing: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
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(20);
16
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
17
+ });
18
+
19
+ //Penalty points for the entire question
20
+ it('When the user sets penalty scoring to \'Penalty points for the entire question\', allots penalty points and attempts the question incorrectly, then the user should be awarded with negative points', () => {
21
+ fillInTheGapsTextPage.steps.expandPenaltyScoringDropdown();
22
+ fillInTheGapsTextPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
23
+ fillInTheGapsTextPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
24
+ fillInTheGapsTextPage.steps.allotPenaltyPoints(2);
25
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
26
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
27
+ fillInTheGapsTextPage.steps.verifyPreviewScore(-2, 20);
28
+ });
29
+
30
+ it('When the user attempts the question partially correct along with an incorrect response, then penalty points should get deducted from the awarded points', () => {
31
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
32
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Sunflower' }]);
33
+ fillInTheGapsTextPage.steps.verifyPreviewScore(-2, 20);
34
+ });
35
+
36
+ it('When the user attempts the question correctly along with multiple incorrect responses, then penalty points should get deducted from the awarded points only once, the deducted penalty points should not increase as per number of attempted incorrect responses', () => {
37
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
38
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Stem' }, { responseIndex: 2, responseText: 'Roots' }]);
39
+ fillInTheGapsTextPage.steps.verifyPreviewScore(-2, 20);
40
+ });
41
+
42
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
43
+ fillInTheGapsTextPage.steps.switchToEditTab();
44
+ fillInTheGapsTextPage.steps.expandMinimumScoringDropdown();
45
+ fillInTheGapsTextPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
46
+ fillInTheGapsTextPage.steps.allotMinimumPoints(3);
47
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
48
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
49
+ fillInTheGapsTextPage.steps.verifyPreviewScore(3, 20);
50
+ });
51
+ });
52
+ });