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,186 @@
1
+ import { fillInTheGapsDropdownPage } from "../../../../pages";
2
+ import { commonComponents } from "../../../../pages/components";
3
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
4
+ import utilities from "../../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+ const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
8
+ const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
9
+ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answer
10
+ const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
11
+ const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
12
+ const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
13
+
14
+ describe('Create item page - Fill in the gaps with dropdown: Partial equal with alternative answers', () => {
15
+ before(() => {
16
+ cy.loginAs('admin');
17
+ });
18
+
19
+ describe('Question preview: Auto scored - Partial equal weights with alternative answer - When \'Correct answer\' points are equal to \'Alternative answer\' points', () => {
20
+ abortEarlySetup();
21
+ before(() => {
22
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
23
+ cy.barsPreLoaderWait();
24
+ fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
25
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
26
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
27
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(2, optionsForDropdown3);
28
+ fillInTheGapsDropdownPage.steps.allotPoints(15);
29
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
30
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
31
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, correctAnswerArray[2]);
32
+ fillInTheGapsDropdownPage.steps.addAlternativeAnswerAccordion(1);
33
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
34
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
35
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, alternateAnswerArray[2]);
36
+ fillInTheGapsDropdownPage.steps.allotPoints(15);
37
+ fillInTheGapsDropdownPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
38
+ fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
39
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
40
+ });
41
+
42
+ 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', () => {
43
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
44
+ fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
45
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
46
+ });
47
+
48
+ 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, correct/incorrect status message and correct answer section should not be displayed', () => {
49
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
50
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
51
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(15, 15);
52
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
53
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
54
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
55
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
56
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
57
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
58
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
59
+ 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 dropdowns, correct/incorrect status message and correct answer section should not be displayed')
60
+ fillInTheGapsDropdownPage.steps.checkAnswer();
61
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
62
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
63
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
64
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
65
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
66
+ });
67
+
68
+ 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, correct/incorrect status message and correct answer section should not be displayed', () => {
69
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
70
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
71
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(15, 15);
72
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
73
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
74
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
75
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
76
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
77
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
78
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
79
+ 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 dropdowns, correct/incorrect status message and correct answer section should not be displayed')
80
+ fillInTheGapsDropdownPage.steps.checkAnswer();
81
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
82
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
83
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
84
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
85
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
86
+ });
87
+
88
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded points of the correct accordion and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
89
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
90
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }]);
91
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(5, 15);
92
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
93
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
94
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
95
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
96
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
97
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
98
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
99
+ 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 dropdowns, correct/incorrect status message and correct answer section should not be displayed')
100
+ fillInTheGapsDropdownPage.steps.checkAnswer();
101
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
102
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
103
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
104
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
105
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
106
+ });
107
+
108
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
109
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
110
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }]);
111
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(5, 15);
112
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
113
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
114
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
115
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
116
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
117
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
118
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
119
+ 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 dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message and correct answer section should not be displayed')
120
+ fillInTheGapsDropdownPage.steps.checkAnswer();
121
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
122
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
123
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
124
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
125
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
126
+ });
127
+
128
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides dropdown with correct accordion response, incorrect icon should be displayed beside dropdown with the alternative accordion response, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
129
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
130
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }]);
131
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(5, 15);
132
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
133
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
134
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
135
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
136
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
137
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
138
+ 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 dropdown with correct accordion response, incorrect icon should be displayed beside dropdown with the alternative accordion response, correct/incorrect status message and correct answer section should not be displayed')
139
+ fillInTheGapsDropdownPage.steps.checkAnswer();
140
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
141
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
142
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
143
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
144
+ });
145
+
146
+ it('Race condition : When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be besides the common response, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
147
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
148
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
149
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(5, 15);
150
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
151
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
152
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
153
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
154
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
155
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
156
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
157
+ cy.log('When the user has attempted the question with the common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdown, no icon should be displayed beside unattempted dropdown, correct/incorrect status message and correct answer section should not be displayed')
158
+ fillInTheGapsDropdownPage.steps.checkAnswer();
159
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
160
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
161
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
162
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
163
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
164
+ });
165
+
166
+ 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, correct/incorrect status message should not be displayed and correct answer section with all correct answers along with dropdown numeration should be displayed', () => {
167
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
168
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
169
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 15);
170
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
171
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
172
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
173
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
174
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
175
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
176
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
177
+ 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 beside unattempted dropdown, correct/incorrect status message and correct answer section should not be displayed')
178
+ fillInTheGapsDropdownPage.steps.checkAnswer();
179
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
180
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
181
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
182
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
183
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
184
+ });
185
+ });
186
+ });
@@ -0,0 +1,214 @@
1
+ import { fillInTheGapsDropdownPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import utilities from "../../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
7
+ const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
8
+ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answer
9
+ const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
10
+ const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
11
+ const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
12
+
13
+ describe('Create item page - Fill in the gaps with dropdown: Partial equal weights with alternative answers', () => {
14
+ before(() => {
15
+ cy.loginAs('admin');
16
+ });
17
+
18
+ describe('Question preview: Auto scored - Partial equal weights with alternative answer - When \'Correct answer\' points are more than \'Alternate answer\' points', () => {
19
+ abortEarlySetup();
20
+ before(() => {
21
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
22
+ cy.barsPreLoaderWait();
23
+ fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
24
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
25
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
26
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(2, optionsForDropdown3);
27
+ fillInTheGapsDropdownPage.steps.allotPoints(15);
28
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
29
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
30
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, correctAnswerArray[2]);
31
+ fillInTheGapsDropdownPage.steps.addAlternativeAnswerAccordion(1);
32
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
33
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
34
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, alternateAnswerArray[2]);
35
+ fillInTheGapsDropdownPage.steps.allotPoints(9);
36
+ fillInTheGapsDropdownPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
37
+ fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
38
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
39
+ });
40
+
41
+ it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers from the correct accordion and respective dropdown numeration', () => {
42
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
43
+ fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
44
+ utilities.verifyInnerText(fillInTheGapsDropdownPage.correctAnswersLabel(), 'Correct answers');
45
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
46
+ });
47
+
48
+ 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, correct/incorrect status message should not be displayed and correct answer section should not be displayed', () => {
49
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
50
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
51
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(15, 15);
52
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
53
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
54
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
55
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
56
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
57
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
58
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
59
+ 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 dropdowns, correct/incorrect status message should not be displayed and correct answer section should not be displayed');
60
+ fillInTheGapsDropdownPage.steps.checkAnswer();
61
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
62
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
63
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
64
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
65
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
66
+ });
67
+
68
+ it('When the user attempts the question with alternative accordion responses, 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, correct/incorrect status message should not be displayed and correct answer section should not be displayed', () => {
69
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
70
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
71
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(9, 15);
72
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
73
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
74
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
75
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
76
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
77
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
78
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
79
+ 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 dropdowns, correct/incorrect status message should not be displayed and correct answer section should not be displayed');
80
+ fillInTheGapsDropdownPage.steps.checkAnswer();
81
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
82
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
83
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
84
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
85
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
86
+ });
87
+
88
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
89
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
90
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }]);
91
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(5, 15);
92
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
93
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
94
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
95
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
96
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
97
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
98
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
99
+ 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 dropdowns, correct/incorrect status message should not be displayed and correct answer section should not be displayed');
100
+ fillInTheGapsDropdownPage.steps.checkAnswer();
101
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
102
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
103
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
104
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
105
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
106
+ });
107
+
108
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
109
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
110
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }]);
111
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(3, 15);
112
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
113
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
114
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
115
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
116
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
117
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
118
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
119
+ 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 dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section should not be displayed');
120
+ fillInTheGapsDropdownPage.steps.checkAnswer();
121
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
122
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
123
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
124
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
125
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
126
+ });
127
+
128
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed beside alternative accordion responses, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
129
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
130
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }]);
131
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(5, 15);
132
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
133
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
134
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
135
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
136
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
137
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
138
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
139
+ 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, correct icon should be displayed besides the correctly answered dropdowns, incorrect icon should be displayed beside alternative accordion responses, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
140
+ fillInTheGapsDropdownPage.steps.checkAnswer();
141
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
142
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
143
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
144
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
145
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
146
+ });
147
+
148
+ it('Race condition : When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be besides the common response, no icon should be displayed beside unattempted response, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
149
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
150
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
151
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(5, 15);
152
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
153
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
154
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
155
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
156
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
157
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
158
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
159
+ 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 dropdown, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
160
+ fillInTheGapsDropdownPage.steps.checkAnswer();
161
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
162
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
163
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
164
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
165
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
166
+ });
167
+
168
+ 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 dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
169
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
170
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
171
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 15);
172
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
173
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
174
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
175
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
176
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
177
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
178
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
179
+ 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 beside unattempted dropdowns, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
180
+ fillInTheGapsDropdownPage.steps.checkAnswer();
181
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
182
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
183
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
184
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
185
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
186
+ });
187
+
188
+ it('Overachiever case: When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response from the correct accordion overpowers the combined score of the alternative accordion answers then on switching to the \'Grading view\', then points awarded should be of the correct accordion, correct icons should be displayed for the correct accordion response, incorrect icon should be displayed for the alternative accordion responses, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
189
+ cy.log('Pre-step: Switching to Edit tab and allotting points to alternative accordion such that the difference between the points is substantial and there are no common responses between the two accordions')
190
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
191
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, optionsForDropdown3[3]);
192
+ fillInTheGapsDropdownPage.steps.allotPoints(5);
193
+ fillInTheGapsDropdownPage.steps.expandCorrectAnswerAccordion();
194
+ fillInTheGapsDropdownPage.steps.allotPoints(23);
195
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
196
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
197
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(7.67, 23);
198
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
199
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
200
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
201
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
202
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
203
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
204
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
205
+ cy.log('When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response from the correct accordion overpowers the combined score of the alternative accordion answers and clicks on the \'Check answer\' button, correct icons should be displayed beside correct accordion responses, incorrect icons should be displayed beside alternative accordion responses, correct/incorrect answer label, correct answer container should not be displayed')
206
+ fillInTheGapsDropdownPage.steps.checkAnswer();
207
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
208
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
209
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
210
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
211
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
212
+ });
213
+ });
214
+ });
@@ -0,0 +1,161 @@
1
+ import { fillInTheGapsDropdownPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const optionsForDropdown = ['Image of a flower', 'Petals are displayed', 'Stem is the largest', 'Branches of a plane contain both leaves and flowers'];
7
+
8
+ describe('Create item page - Fill in the gaps with dropdown: Dropdown and Dropdown menu section', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Dropdown and Dropdown menu section contents', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
17
+ cy.barsPreLoaderWait();
18
+ });
19
+
20
+ fillInTheGapsDropdownPage.tests.verifyDropdownAndDropdownMenuSectionContents();
21
+ });
22
+
23
+ describe('Dropdown section - Specify correct answer section dropdown', () => {
24
+ abortEarlySetup();
25
+ before(() => {
26
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
27
+ cy.barsPreLoaderWait();
28
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown);
29
+ fillInTheGapsDropdownPage.steps.uncheckWordWrapForDropdownMenuCheckbox();
30
+ });
31
+
32
+ it('When \'User specified width\' toggle button is selected, then dropdown menu width should be the same as collapsed dropdown in specify correct answer section', () => {
33
+ fillInTheGapsDropdownPage.steps.compareDropdownMenuAndDropdownWidthForUserSpecifiedWidth();
34
+ cy.log('Choosing an option from dropdown to collapse it')
35
+ fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(optionsForDropdown[0]);
36
+ });
37
+
38
+ it('When \'Auto scale\' toggle button is selected, then width of the collapsed dropdown and the dropdown menu should be auto scaled(increased) to accommodate the longest option in the dropdown menu in specify correct answer section', () => {
39
+ fillInTheGapsDropdownPage.steps.compareDropdownMenuAndDropdownWidthForAutoScaled();
40
+ cy.log('Choosing an option from dropdown to collapse it')
41
+ fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(optionsForDropdown[0]);
42
+ });
43
+
44
+ it('When user selects the \'User specified width\' toggle button, then the collapsed dropdown and the dropdown menu should return to its default width', () => {
45
+ fillInTheGapsDropdownPage.steps.selectUserSpecifiedWidthToggleButton();
46
+ fillInTheGapsDropdownPage.steps.verifyUserSpecifiedToggleButtonIsSelected();
47
+ fillInTheGapsDropdownPage.steps.verifyDropdownDefaultWidthInSpecifyCorrectAnswer();
48
+ cy.log('Choosing an option from dropdown to collapse it')
49
+ fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(optionsForDropdown[3]);
50
+ });
51
+
52
+ it('When \'Display multiline text in dropdown\' checkbox is unchecked and user selects and long text option in dropdown, then the selected long text option should be incompletely displayed in the dropdown with an ellipses at the end and a tooltip which displays the entire option', () => {
53
+ fillInTheGapsDropdownPage.steps.verifyMultilineTextNotDisplayedInDropdownSpecifyCorrectAnswerSection(0);
54
+ utilities.getNthElement(fillInTheGapsDropdownPage.dropdownSpecifyCorrectAnswerSection(), 0)
55
+ .verifyTooltip(`${optionsForDropdown[3]}`);
56
+ });
57
+
58
+ it('User should be able to check the \'Display multiline text in dropdown\' checkbox', () => {
59
+ fillInTheGapsDropdownPage.steps.checkDisplayMultilineCheckbox();
60
+ });
61
+
62
+ it('When \'Display multiline text in dropdown\' checkbox is checked, then the added long text option should be word wrapped and displayed in a multi-line format', () => {
63
+ fillInTheGapsDropdownPage.steps.verifyMultilineTextIsDisplayedInDropdownSpecifyCorrectAnswerSection(0);
64
+ });
65
+ });
66
+
67
+ describe('Dropdown menu section - Specify correct answer section dropdown', () => {
68
+ abortEarlySetup();
69
+ before(() => {
70
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
71
+ cy.barsPreLoaderWait();
72
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown);
73
+ });
74
+
75
+ it('When \'Word wrap for dropdown menu\' checkbox is checked, then all the dropdown menu options should be word wrapped and displayed in a multi-line format', () => {
76
+ fillInTheGapsDropdownPage.steps.expandDropdownInSpecifyCorrectAnswerSection(0);
77
+ fillInTheGapsDropdownPage.steps.verifyDropdownMenuOptionsWordWrappedSpecifyCorrectAnswerSection();
78
+ cy.log('Selecting an option to collapse the dropdown');
79
+ fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(optionsForDropdown[0]);
80
+ });
81
+
82
+ it('User should be able to uncheck the \'Word wrap for dropdown menu\' checkbox', () => {
83
+ fillInTheGapsDropdownPage.steps.uncheckWordWrapForDropdownMenuCheckbox();
84
+ });
85
+
86
+ it('When \'Word wrap for dropdown menu\' checkbox is unchecked, then all the dropdown menu options should be displayed in a single line', () => {
87
+ fillInTheGapsDropdownPage.steps.expandDropdownInSpecifyCorrectAnswerSection(0);
88
+ fillInTheGapsDropdownPage.steps.verifyDropdownMenuOptionsNotWordWrappedSpecifyCorrectAnswerSection();
89
+ });
90
+ });
91
+
92
+ describe('Dropdown section - Preview tab', () => {
93
+ abortEarlySetup();
94
+ before(() => {
95
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
96
+ cy.barsPreLoaderWait();
97
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown);
98
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
99
+ });
100
+
101
+ it('When \'User specified width\' toggle button is selected, then dropdown menu width should be the same as collapsed dropdown in preview tab', () => {
102
+ fillInTheGapsDropdownPage.steps.compareDropdownMenuAndDropdownWidthForUserSpecifiedWidthInPreviewTab();
103
+ cy.log('Choosing an option from dropdown to collapse it')
104
+ fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(optionsForDropdown[0]);
105
+ });
106
+
107
+ it('When \'Auto scale\' toggle button is selected, then width of the collapsed dropdown and the dropdown menu should be auto scaled(increased) to accommodate the longest option in the dropdown menu in specify correct answer section', () => {
108
+ fillInTheGapsDropdownPage.steps.compareDropdownMenuAndDropdownWidthForAutoScaledInPreviewTab();
109
+ cy.log('Choosing an option from dropdown to collapse it')
110
+ fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(optionsForDropdown[3]);
111
+ });
112
+
113
+ it('When user selects the \'User specified width\' toggle button, then the collapsed dropdown and the dropdown menu should return to its default width', () => {
114
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
115
+ fillInTheGapsDropdownPage.steps.selectUserSpecifiedWidthToggleButton();
116
+ fillInTheGapsDropdownPage.steps.verifyUserSpecifiedToggleButtonIsSelected();
117
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
118
+ fillInTheGapsDropdownPage.steps.verifyDropdownDefaultWidthInPreviewTab();
119
+ cy.log('Choosing an option from dropdown to collapse it')
120
+ fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(optionsForDropdown[3]);
121
+ });
122
+
123
+ it('When \'Display multiline text in dropdown\' checkbox is unchecked and user selects and long text option in dropdown, then the selected long text option should be incompletely displayed in the dropdown with an ellipses at the end and a tooltip which displays the entire option', () => {
124
+ fillInTheGapsDropdownPage.steps.verifyMultilineTextNotDisplayedInDropdownPreviewTab(0);
125
+ utilities.getNthElement(fillInTheGapsDropdownPage.dropdownPreviewTab(), 0)
126
+ .verifyTooltip(`${optionsForDropdown[3]}`);
127
+ });
128
+
129
+ it('When \'Display multiline text in dropdown\' checkbox is checked, then the added long text option should be word wrapped and displayed in a multi-line format', () => {
130
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
131
+ fillInTheGapsDropdownPage.steps.checkDisplayMultilineCheckbox();
132
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
133
+ fillInTheGapsDropdownPage.steps.verifyMultilineTextIsDisplayedInDropdownPreviewTab(0);
134
+ });
135
+ });
136
+
137
+ describe('Dropdown menu section- Preview tab', () => {
138
+ abortEarlySetup();
139
+ before(() => {
140
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
141
+ cy.barsPreLoaderWait();
142
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown);
143
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
144
+ });
145
+
146
+ it('When \'Word wrap for dropdown menu\' checkbox is checked, then all the dropdown menu options should be word wrapped and displayed in a multi-line format', () => {
147
+ fillInTheGapsDropdownPage.steps.expandDropdownInPreviewTab(0);
148
+ fillInTheGapsDropdownPage.steps.verifyDropdownMenuOptionsWordWrappedPreviewTab();
149
+ cy.log('Selecting an option to collapse the dropdown');
150
+ fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(optionsForDropdown[0]);
151
+ });
152
+
153
+ it('When \'Word wrap for dropdown menu\' checkbox is unchecked, then all the dropdown menu options should be displayed in a single line', () => {
154
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
155
+ fillInTheGapsDropdownPage.steps.uncheckWordWrapForDropdownMenuCheckbox();
156
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
157
+ fillInTheGapsDropdownPage.steps.expandDropdownInPreviewTab(0);
158
+ fillInTheGapsDropdownPage.steps.verifyDropdownMenuOptionsNotWordWrappedPreviewTab();
159
+ });
160
+ });
161
+ });