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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +210 -0
  2. package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +91 -0
  3. package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +392 -0
  4. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -1
  5. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
  6. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +2 -1
  7. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -1
  8. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +152 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +196 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +195 -0
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +288 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/manuallyAndNonScored.js +141 -0
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +245 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +413 -0
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +218 -0
  17. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +245 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +163 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +224 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +196 -0
  21. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +224 -0
  22. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +83 -0
  23. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +653 -0
  24. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +180 -0
  25. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabScoringSection.js +229 -0
  26. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +90 -0
  27. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/switchingCasesBetweenOptionsLayout.js +50 -0
  28. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +204 -0
  29. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +204 -0
  30. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +298 -0
  31. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingPenaltyScoring.js +63 -0
  32. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +111 -0
  33. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +231 -0
  34. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsBasic.js +90 -0
  35. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  36. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +232 -0
  37. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +231 -0
  38. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsBasic.js +138 -0
  39. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +213 -0
  40. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +186 -0
  41. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
  42. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +161 -0
  43. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +328 -0
  44. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +144 -0
  45. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabScoringSection.js +250 -0
  46. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +75 -0
  47. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  48. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +74 -0
  49. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +188 -0
  50. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +8 -8
  51. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
  52. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +4 -2
  53. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +1 -52
  54. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +3 -211
  55. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +39 -3
  56. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -8
  57. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
  58. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -50
  59. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +325 -0
  60. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +1 -146
  61. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  62. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +78 -0
  63. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +265 -0
  64. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +75 -0
  65. package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  66. package/cypress/e2e/ILC/FillInTheGapsTextNew/responseAnswersAndAcceptedStudentInput.js +56 -0
  67. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +40 -2
  68. package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +249 -0
  69. package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +64 -0
  70. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +128 -0
  71. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +889 -0
  72. package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +168 -0
  73. package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +203 -0
  74. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +222 -0
  75. package/cypress/e2e/ILC/SimpleCalculator/calculatorFunctionality.js +349 -0
  76. package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +132 -0
  77. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +35 -7
  78. package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +213 -0
  79. package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +41 -0
  80. package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +377 -0
  81. package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +161 -0
  82. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +250 -0
  83. package/cypress/e2e/migration/migration.js +4 -41
  84. package/cypress/e2e/migration/migration10.js +6 -43
  85. package/cypress/e2e/migration/migration2.js +6 -43
  86. package/cypress/e2e/migration/migration3.js +6 -43
  87. package/cypress/e2e/migration/migration4.js +6 -43
  88. package/cypress/e2e/migration/migration5.js +6 -43
  89. package/cypress/e2e/migration/migration6.js +6 -43
  90. package/cypress/e2e/migration/migration7.js +6 -43
  91. package/cypress/e2e/migration/migration8.js +6 -43
  92. package/cypress/e2e/migration/migration9.js +6 -43
  93. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  94. package/cypress/fixtures/theme/ilc.json +6 -1
  95. package/cypress/fixtures/uploadResponseFileType.js +5 -0
  96. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +13 -13
  97. package/cypress/pages/components/customizeSpecialCharacterComponent.js +24 -6
  98. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  99. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +42 -4
  100. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +149 -5
  101. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +954 -77
  102. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  103. package/cypress/pages/components/questionInstructionsComponent.js +2 -1
  104. package/cypress/pages/contentBlocksPage.js +515 -0
  105. package/cypress/pages/drawingResponsePage.js +2 -2
  106. package/cypress/pages/fillInTheGapsDragAndDropPage.js +359 -3
  107. package/cypress/pages/fillInTheGapsDropdownPage.js +21 -1
  108. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +5 -57
  109. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -24
  110. package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -435
  111. package/cypress/pages/fillInTheGapsTextPage.js +9 -2
  112. package/cypress/pages/graphingPage.js +484 -0
  113. package/cypress/pages/index.js +4 -1
  114. package/cypress/pages/simpleCalculatorPage.js +310 -0
  115. package/cypress/pages/uploadResponsePage.js +260 -92
  116. package/cypress/support/commands.js +33 -1
  117. package/package.json +2 -2
  118. package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +0 -242
  119. package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +0 -99
  120. package/cypress/e2e/ILC/Passage/passageEditTab.js +0 -241
  121. package/cypress/e2e/ILC/Passage/passageHeaderSection.js +0 -73
  122. package/cypress/e2e/ILC/Passage/passagePreviewTab.js +0 -246
@@ -0,0 +1,204 @@
1
+ import { fillInTheGapsDropdownPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
5
+ const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
6
+ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answer
7
+ const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
8
+ const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
9
+ const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
10
+
11
+ describe('Create item page - Fill in the gaps with dropdown: All or nothing with alternative answers', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Alternative answer\' points are more than \'Correct answer\' points', () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
20
+ cy.barsPreLoaderWait();
21
+ fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
22
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
23
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
24
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(2, optionsForDropdown3);
25
+ fillInTheGapsDropdownPage.steps.allotPoints(10);
26
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
27
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
28
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, correctAnswerArray[2]);
29
+ fillInTheGapsDropdownPage.steps.addAlternativeAnswerAccordion(1);
30
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
31
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
32
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, alternateAnswerArray[2]);
33
+ fillInTheGapsDropdownPage.steps.allotPoints(20);
34
+ fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
35
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
36
+ });
37
+
38
+ it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section should be displayed with correct answers from the alternative accordion and respective dropdown numeration', () => {
39
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
40
+ fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
41
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
42
+ });
43
+
44
+ it('When the user attempts the question with responses from the correct accordion, then the user should be awarded with points specified for correct accordion (less than overall points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
45
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
46
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
47
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(10, 20);
48
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
49
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
50
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
51
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
52
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
53
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
54
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
55
+ 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 correctly answered dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
56
+ fillInTheGapsDropdownPage.steps.checkAnswer();
57
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
58
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
59
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
60
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
61
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
62
+ });
63
+
64
+ 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 dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
65
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
66
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
67
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(20, 20);
68
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
69
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
70
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
71
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
72
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
73
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
74
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
75
+ 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 correctly answered dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
76
+ fillInTheGapsDropdownPage.steps.checkAnswer();
77
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
78
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
79
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
80
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
81
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
82
+ });
83
+
84
+ 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 correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion along with dropdown numeration should be displayed', () => {
85
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
86
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }]);
87
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
88
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
89
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
90
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
91
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
92
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
93
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
94
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
95
+ 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 correctly answered dropdowns, no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
96
+ fillInTheGapsDropdownPage.steps.checkAnswer();
97
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
98
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
99
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
100
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
101
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
102
+ });
103
+
104
+ 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 correctly answered dropdowns, no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion along with dropdown numeration should be displayed', () => {
105
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
106
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }]);
107
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
108
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
109
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
110
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
111
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
112
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
113
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
114
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
115
+ 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 correctly answered dropdowns, no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
116
+ fillInTheGapsDropdownPage.steps.checkAnswer();
117
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
118
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
119
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
120
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
121
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
122
+ });
123
+
124
+ it('When the user attempts the question partially correct with all the responses correct as per the correct 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 correct accordion and no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion along with dropdown numeration should be displayed', () => {
125
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
126
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
127
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
128
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
129
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
130
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
131
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
132
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
133
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
134
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
135
+ cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one incomplete and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the correct accordion and no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
136
+ fillInTheGapsDropdownPage.steps.checkAnswer();
137
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
138
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
139
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
140
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
141
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
142
+ });
143
+
144
+ 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 alternative accordion responses, incorrect icon should be displayed besides correct accordion responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion along with dropdown numeration should be displayed', () => {
145
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
146
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }]);
147
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
148
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
149
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
150
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
151
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
152
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
153
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
154
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
155
+ 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 alternative accordion responses, incorrect icon should be displayed besides correct accordion responses a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
156
+ fillInTheGapsDropdownPage.steps.checkAnswer();
157
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
158
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
159
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
160
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
161
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
162
+ });
163
+
164
+ 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 for unattempted dropdown, \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion along with dropdown numeration should be displayed', () => {
165
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
166
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
167
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
168
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
169
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
170
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
171
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
172
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
173
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
174
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
175
+ 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 correctly answered dropdowns, no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
176
+ fillInTheGapsDropdownPage.steps.checkAnswer();
177
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
178
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
179
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
180
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
181
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
182
+ });
183
+
184
+ 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 dropdowns, no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion along with dropdown numeration should be displayed', () => {
185
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
186
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }]);
187
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
188
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
189
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
190
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
191
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
192
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
193
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
194
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
195
+ 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 dropdowns, no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
196
+ fillInTheGapsDropdownPage.steps.checkAnswer();
197
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
198
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
199
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
200
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
201
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
202
+ });
203
+ });
204
+ });
@@ -0,0 +1,204 @@
1
+ import { fillInTheGapsDropdownPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
5
+ const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
6
+ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answer
7
+ const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
8
+ const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
9
+ const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
10
+
11
+ describe('Create item page - Fill in the gaps with dropdown: All or nothing with alternative answers', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Correct answer\' points are equal to \'Alternative answer\' points', () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
20
+ cy.barsPreLoaderWait();
21
+ fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
22
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
23
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
24
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(2, optionsForDropdown3);
25
+ fillInTheGapsDropdownPage.steps.allotPoints(20);
26
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
27
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
28
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, correctAnswerArray[2]);
29
+ fillInTheGapsDropdownPage.steps.addAlternativeAnswerAccordion(1);
30
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
31
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
32
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, alternateAnswerArray[2]);
33
+ fillInTheGapsDropdownPage.steps.allotPoints(20);
34
+ fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
35
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
36
+ });
37
+
38
+ it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section should be displayed with correct answers from the correct accordion and respective dropdown numeration', () => {
39
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
40
+ fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
41
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
42
+ });
43
+
44
+ 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 dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
45
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
46
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
47
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(20, 20);
48
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
49
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
50
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
51
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
52
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
53
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
54
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
55
+ 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 correctly answered dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed');
56
+ fillInTheGapsDropdownPage.steps.checkAnswer();
57
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
58
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
59
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
60
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
61
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
62
+ });
63
+
64
+ 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 dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
65
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
66
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
67
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(20, 20);
68
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
69
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
70
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
71
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
72
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
73
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
74
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
75
+ 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 correctly answered dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed');
76
+ fillInTheGapsDropdownPage.steps.checkAnswer();
77
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
78
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
79
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
80
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
81
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
82
+ });
83
+
84
+ 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 correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
85
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
86
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }]);
87
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
88
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
89
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
90
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
91
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
92
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
93
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
94
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
95
+ 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 correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
96
+ fillInTheGapsDropdownPage.steps.checkAnswer();
97
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
98
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
99
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
100
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
101
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
102
+ });
103
+
104
+ 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 correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
105
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
106
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }]);
107
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
108
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
109
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
110
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
111
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
112
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
113
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
114
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
115
+ 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 correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
116
+ fillInTheGapsDropdownPage.steps.checkAnswer();
117
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
118
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
119
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
120
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
121
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
122
+ });
123
+
124
+ 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 dropdown numeration should be displayed', () => {
125
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
126
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }]);
127
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
128
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
129
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
130
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
131
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
132
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
133
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
134
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
135
+ 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');
136
+ fillInTheGapsDropdownPage.steps.checkAnswer();
137
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
138
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
139
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
140
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
141
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
142
+ });
143
+
144
+ it('When the user has attempted the question with equal number of correct dropdowns 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 dropdown numeration should be displayed', () => {
145
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
146
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }]);
147
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
148
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
149
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
150
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
151
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
152
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
153
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
154
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
155
+ cy.log('When the user has attempted the question with equal number of correct dropdowns from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correctly answered dropdowns, 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');
156
+ fillInTheGapsDropdownPage.steps.checkAnswer();
157
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
158
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
159
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
160
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
161
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
162
+ });
163
+
164
+ 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 dropdown numeration should be displayed', () => {
165
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
166
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
167
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
168
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
169
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
170
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
171
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
172
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
173
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
174
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
175
+ cy.log('When the user has attempted the question with equal number of correct dropdowns from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
176
+ fillInTheGapsDropdownPage.steps.checkAnswer();
177
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
178
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
179
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
180
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
181
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
182
+ });
183
+
184
+ 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 dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with dropdown numeration should be displayed', () => {
185
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
186
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }]);
187
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
188
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
189
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
190
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
191
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
192
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
193
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
194
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
195
+ 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 dropdowns, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
196
+ fillInTheGapsDropdownPage.steps.checkAnswer();
197
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
198
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
199
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
200
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
201
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
202
+ });
203
+ });
204
+ });