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,180 @@
1
+ import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ const options = ['option 1', 'option 2', 'option 3'];
6
+
7
+ describe('Create Item page - Fill in the gaps with drag and drop: Draggable options section', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Draggable options and Draggable options layout dropdown', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
16
+ cy.barsPreLoaderWait();
17
+ });
18
+
19
+ fillInTheGapsDragAndDropPage.tests.verifyDraggableOptionsLayoutDropdownSectionContents();
20
+ });
21
+
22
+ describe('Standard options layout - Edit tab section contents', () => {
23
+ abortEarlySetup();
24
+ before(() => {
25
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
26
+ cy.barsPreLoaderWait();
27
+ });
28
+
29
+ fillInTheGapsDragAndDropPage.tests.verifyOptionsSectionContents({ optionFieldsCount: 2, optionLabel: 'Options for drag & drop' });
30
+
31
+ fillInTheGapsDragAndDropPage.tests.verifyDragHandleTooltip();
32
+
33
+ it('When only two options are present, the delete buttons should be in disabled state', () => {
34
+ fillInTheGapsDragAndDropPage.steps.verifyDeleteOptionButtonDisabledState();
35
+ });
36
+
37
+ fillInTheGapsDragAndDropPage.tests.verifyDisabledDeleteButtonTooltip();
38
+
39
+ fillInTheGapsDragAndDropPage.tests.verifyAddOptionFunctionality();
40
+
41
+ fillInTheGapsDragAndDropPage.tests.verifyOptionInputFieldErrorState(0);
42
+
43
+ fillInTheGapsDragAndDropPage.tests.verifyEnabledDeleteButtonAndTooltip();
44
+
45
+ it('When user clicks on the \'Delete\' option button then the respective options input field should get deleted and option numeration should change accordingly', () => {
46
+ cy.log('Pre step: Adding text in all option input fields')
47
+ fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(1, 'option 2');
48
+ fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(2, 'option 3');
49
+
50
+ const optionsAfterDeleting = options.filter((el) => el !== 'option 2')
51
+ fillInTheGapsDragAndDropPage.steps.deleteOption(1);
52
+ utilities.verifyElementCount(fillInTheGapsDragAndDropPage.optionWrapper(), 2);
53
+ cy.log('Verifying the input text given to input fields after deletion of 2nd option')
54
+ optionsAfterDeleting.forEach((inputFieldText, optionIndex) => {
55
+ utilities.verifyTextContent(utilities.getNthElement(fillInTheGapsDragAndDropPage.optionsInputField(), optionIndex), inputFieldText);
56
+ });
57
+ });
58
+ });
59
+
60
+ describe('Standard options layout - Specify correct answer section contents', () => {
61
+ abortEarlySetup();
62
+ before(() => {
63
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
64
+ cy.barsPreLoaderWait();
65
+ });
66
+
67
+ fillInTheGapsDragAndDropPage.tests.verifyDraggableOptionsForStandardLayoutInSpecifyCorrectAnswerSection();
68
+
69
+ it('When the user deletes an option, then the deleted option should get removed from the options container as well as from the dropzone (if any) in the \'Specify correct answer section\' section', () => {
70
+ const optionsAfterDeleting = options.filter((el) => el !== 'option 3');
71
+ cy.log('Setting a correct answer option')
72
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'option 3': 0 });
73
+ fillInTheGapsDragAndDropPage.steps.deleteOption(2);
74
+ fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextSpecifyCorrectAnswerSection(0, '');
75
+ optionsAfterDeleting.forEach((inputFieldText, optionIndex) => {
76
+ fillInTheGapsDragAndDropPage.steps.verifyOptionContainerOptionSpecifyCorrectAnswerSection(optionIndex, inputFieldText);
77
+ });
78
+ });
79
+ });
80
+
81
+ describe('Standard options layout - Preview tab contents', () => {
82
+ abortEarlySetup();
83
+ before(() => {
84
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
85
+ cy.barsPreLoaderWait();
86
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
87
+ });
88
+
89
+ fillInTheGapsDragAndDropPage.tests.verifyDraggableOptionsForStandardLayoutInPreviewTab();
90
+ });
91
+
92
+ describe('Grouped options layout - Edit tab section contents', () => {
93
+ abortEarlySetup();
94
+ before(() => {
95
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
96
+ cy.barsPreLoaderWait();
97
+ });
98
+
99
+ fillInTheGapsDragAndDropPage.tests.verifyGroupedOptionsLayoutSectionContents();
100
+
101
+ fillInTheGapsDragAndDropPage.tests.verifyOptionsSectionContents({ optionFieldsCount: 2, optionLabel: 'Options for drag & drop' });
102
+
103
+ it('When only two options are present, the delete buttons should be in disabled state', () => {
104
+ fillInTheGapsDragAndDropPage.steps.verifyDeleteOptionButtonDisabledState();
105
+ });
106
+
107
+ it('When the user clicks on \'Add group\' button without entering text in the option input fields, error message \'Error: Option is required\' should be displayed', () => {
108
+ fillInTheGapsDragAndDropPage.steps.addGroup();
109
+ fillInTheGapsDragAndDropPage.steps.verifyOptionsInputFieldErrorMessage(0);
110
+ fillInTheGapsDragAndDropPage.steps.verifyOptionsInputFieldErrorMessage(1);
111
+ });
112
+
113
+ it('When the user enters text in the options input field, the error messages should disappear', () => {
114
+ fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(0, 'option 1');
115
+ fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(1, 'option 2');
116
+ fillInTheGapsDragAndDropPage.steps.verifyOptionsInputFieldErrorMessageDoesNotExist(0);
117
+ fillInTheGapsDragAndDropPage.steps.verifyOptionsInputFieldErrorMessageDoesNotExist(1);
118
+ });
119
+
120
+ fillInTheGapsDragAndDropPage.tests.addGroupFunctionality();
121
+
122
+ it('User should be able to add another group using \'Add group\' button and the name for this new group should be \'Group 3\'', () => {
123
+ cy.log('Pre step: Set options in group 2 tab, then add new group');
124
+ fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(0, 'option 3');
125
+ fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(1, 'option 4');
126
+ fillInTheGapsDragAndDropPage.steps.addGroup(2);
127
+ });
128
+
129
+ it('User should be able to delete a group by clicking on the \'Close\' icon button alongside group tab and the name of the group tabs should get updated accordingly', () => {
130
+ cy.log('Pre step: Set options in group 3 tab, then switch to group 2 tab and \'Close\' icon button');
131
+ fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(0, 'option 5');
132
+ fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(1, 'option 6');
133
+ fillInTheGapsDragAndDropPage.steps.switchToGroupTab(1);
134
+ fillInTheGapsDragAndDropPage.steps.deleteGroup(1);
135
+ utilities.verifyElementCount(fillInTheGapsDragAndDropPage.groupTab(), 2);
136
+ fillInTheGapsDragAndDropPage.steps.verifyGroupTabLabel(1);
137
+ });
138
+ });
139
+
140
+ describe('Grouped options layout - Specify correct answer section contents', () => {
141
+ abortEarlySetup();
142
+ before(() => {
143
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
144
+ cy.barsPreLoaderWait();
145
+ fillInTheGapsDragAndDropPage.steps.expandDraggableOptionsLayoutDropdown();
146
+ fillInTheGapsDragAndDropPage.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped');
147
+ });
148
+
149
+ fillInTheGapsDragAndDropPage.tests.verifyDraggableOptionsForGroupedLayoutInSpecifyCorrectAnswerSection();
150
+
151
+ //Need to update once https://redmine.zeuslearning.com/issues/557984 is resolved
152
+ it('When the user deletes a group, then the deleted group should get removed from the options container as well as from the response areas (if any) of the specify correct answer section', () => {
153
+ cy.log('Pre step: Entering text into the text fields of group 2 response container')
154
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['option 3', 'option 4']);
155
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle('Group title B');
156
+ cy.log('Setting a correct answer option')
157
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'option 1': 0 });
158
+ cy.log('Deleting the 2nd group')
159
+ fillInTheGapsDragAndDropPage.steps.switchToGroupTab(0);
160
+ fillInTheGapsDragAndDropPage.steps.deleteGroup(0);
161
+ utilities.verifyElementCount(fillInTheGapsDragAndDropPage.groupedOptionsContainerSpecifyCorrectAnswerSection(), 1);
162
+ fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextSpecifyCorrectAnswerSection(0, '');
163
+ cy.log('verifying the contents of group 2 after deleting group 1')
164
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, ['option 3', 'option 4']);
165
+ utilities.verifyInnerText(fillInTheGapsDragAndDropPage.groupedOptionsTitleSpecifyCorrectAnswerSection(), 'Group title B');
166
+ });
167
+ });
168
+
169
+ describe('Grouped options layout - Preview tab contents', () => {
170
+ abortEarlySetup();
171
+ before(() => {
172
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
173
+ cy.barsPreLoaderWait();
174
+ fillInTheGapsDragAndDropPage.steps.expandDraggableOptionsLayoutDropdown();
175
+ fillInTheGapsDragAndDropPage.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped');
176
+ });
177
+
178
+ fillInTheGapsDragAndDropPage.tests.verifyDraggableOptionsForGroupedLayoutInPreviewTab();
179
+ });
180
+ });
@@ -0,0 +1,229 @@
1
+ import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create item page - fill in the gaps with drag and drop: Scoring section', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Scoring section contents', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ fillInTheGapsDragAndDropPage.tests.verifyScoringTypeLabelAndDropdown('Auto scored');
19
+
20
+ fillInTheGapsDragAndDropPage.tests.verifyScoringSubtypeContentsForMultipleResponseTypeQuestion();
21
+ });
22
+
23
+ describe('Auto scored: All or nothing scoring - Scoring section', () => {
24
+ abortEarlySetup();
25
+ before(() => {
26
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
27
+ cy.barsPreLoaderWait();
28
+ fillInTheGapsDragAndDropPage.steps.allotPoints(10);
29
+ });
30
+
31
+ it('When the user has selected \'All or nothing\' scoring subtype, minimum scoring dropdown should be displayed in the scoring section', () => {
32
+ fillInTheGapsDragAndDropPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
33
+ });
34
+ });
35
+
36
+ describe('Auto scored: All or nothing scoring - Specify correct answer section', () => {
37
+ abortEarlySetup();
38
+ before(() => {
39
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
40
+ cy.barsPreLoaderWait();
41
+ fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
42
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
43
+ fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
44
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
45
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
46
+ });
47
+
48
+ fillInTheGapsDragAndDropPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
49
+
50
+ fillInTheGapsDragAndDropPage.tests.verifyPointsLabelAndInputField();
51
+ });
52
+
53
+ describe('Auto scored: Partial - equal weights scoring - Scoring section', () => {
54
+ abortEarlySetup();
55
+ before(() => {
56
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
57
+ cy.barsPreLoaderWait();
58
+ fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
59
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
60
+ fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
61
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
62
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
63
+ });
64
+
65
+ it('User should be able to select \'Partial - equal weights\' scoring type', () => {
66
+ fillInTheGapsDragAndDropPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
67
+ });
68
+
69
+ it('When the user has switched to \'Partial - equal weights\' scoring, then \'Penalty scoring\', \'Minimum scoring\' and \'Rounding\' label and dropdown should be displayed in the \'Scoring\' section, \'Round negative scores to zero\' label and checkbox should not be displayed in the \'Scoring\' section', () => {
70
+ fillInTheGapsDragAndDropPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
71
+ fillInTheGapsDragAndDropPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
72
+ fillInTheGapsDragAndDropPage.steps.verifyRoundingLabelAndDropdownDefaultState();
73
+ utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.roundNegativeScoresToZeroCheckbox(), 'notExist');
74
+ });
75
+ });
76
+
77
+ describe('Auto scored: Partial - equal weights scoring - Specify correct answer section', () => {
78
+ abortEarlySetup();
79
+ before(() => {
80
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
81
+ cy.barsPreLoaderWait();
82
+ fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
83
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
84
+ fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
85
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
86
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
87
+ fillInTheGapsDragAndDropPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
88
+ });
89
+
90
+ fillInTheGapsDragAndDropPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
91
+
92
+ it('\'Points per response\' label should be displayed and a \'-\' should be displayed besides each response in the \'Specify correct answer\' section', () => {
93
+ fillInTheGapsDragAndDropPage.steps.verifyPointsPerResponseLabel();
94
+ });
95
+
96
+ it('When the user gives a score input to \'Points\' input field, then the score should be equally divided among the dropzone \'Points per response\' label', () => {
97
+ fillInTheGapsDragAndDropPage.steps.allotPoints(6);
98
+ fillInTheGapsDragAndDropPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
99
+ });
100
+
101
+ it('When the user inserts one more dropzone, then points per response should get updated accordingly', () => {
102
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
103
+ fillInTheGapsDragAndDropPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(1.5);
104
+ });
105
+
106
+ it('When the user deletes a dropzone, then points per response should get updated accordingly', () => {
107
+ fillInTheGapsDragAndDropPage.steps.deleteAResponseArea(3);
108
+ fillInTheGapsDragAndDropPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
109
+ });
110
+
111
+ it('When the user adds another option in the dropzone, then points per response should remain the same', () => {
112
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Roots': 1 });
113
+ fillInTheGapsDragAndDropPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
114
+ });
115
+
116
+ it('When the user adds an option in the options section then the points should not change', () => {
117
+ fillInTheGapsDragAndDropPage.steps.addOption();
118
+ fillInTheGapsDragAndDropPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
119
+ });
120
+
121
+ it('When the user deletes an option in the options section then the points should not change', () => {
122
+ fillInTheGapsDragAndDropPage.steps.deleteOption(4);
123
+ fillInTheGapsDragAndDropPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
124
+ });
125
+
126
+ it('When user sets an alternate answer in specify correct answer section, then the points per response should not be updated', () => {
127
+ fillInTheGapsDragAndDropPage.steps.setResponseLevelAlternateAnswer(1, ['Petals']);
128
+ fillInTheGapsDragAndDropPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
129
+ });
130
+
131
+ it('When the user switches to \'All or nothing\' scoring, the \'Points per response\' label and the points displayed for individual responses should not be displayed and the points displayed in \'Points\' input field should remain unchanged', () => {
132
+ fillInTheGapsDragAndDropPage.steps.selectAutoScoredScoringSubtype('All or nothing');
133
+ utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.pointsPerResponseLabel(), 'notExist');
134
+ fillInTheGapsDragAndDropPage.steps.verifyPointsFieldValue(6);
135
+ });
136
+
137
+ it('When the user updates the entered points in \'All or nothing\' scoring type and switches to \'Partial equal weights\' scoring type, then the points should be equally divided and displayed besides each correct option', () => {
138
+ fillInTheGapsDragAndDropPage.steps.allotPoints(12);
139
+ fillInTheGapsDragAndDropPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
140
+ fillInTheGapsDragAndDropPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(4);
141
+ });
142
+
143
+ it('CSS of \'Points per response\' label and its displayed score', { tags: 'css' }, () => {
144
+ utilities.verifyCSS(fillInTheGapsDragAndDropPage.pointsPerResponseLabel(), {
145
+ 'color': css.color.labels,
146
+ 'font-size': css.fontSize.normal,
147
+ 'font-weight': css.fontWeight.semibold
148
+ });
149
+ });
150
+ });
151
+
152
+ describe('Auto scored: Partial - different weights scoring - Scoring section', () => {
153
+ abortEarlySetup();
154
+ before(() => {
155
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
156
+ cy.barsPreLoaderWait();
157
+ fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
158
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
159
+ fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
160
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
161
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
162
+ });
163
+
164
+ it('User should be able to select \'Partial - different weights\' scoring', () => {
165
+ fillInTheGapsDragAndDropPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
166
+ });
167
+
168
+ it('When the user has switched to \'Partial - different weights\' scoring, then \'Penalty scoring\', \'Minimum scoring\' and \'Rounding\' labels and dropdowns, \'Round negative scores to zero\' label and checkbox should not be displayed in the \'Scoring\' section', () => {
169
+ fillInTheGapsDragAndDropPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
170
+ fillInTheGapsDragAndDropPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
171
+ fillInTheGapsDragAndDropPage.steps.verifyRoundingLabelAndDropdownDefaultState();
172
+ utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.roundNegativeScoresToZeroCheckbox(), 'notExist');
173
+ });
174
+ });
175
+
176
+ describe('Auto scored: Partial - different weights scoring - Specify correct answer section', () => {
177
+ abortEarlySetup();
178
+ before(() => {
179
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
180
+ cy.barsPreLoaderWait();
181
+ fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
182
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
183
+ fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
184
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
185
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
186
+ fillInTheGapsDragAndDropPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
187
+ });
188
+
189
+ fillInTheGapsDragAndDropPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
190
+
191
+ it('When the user has switched to \'Partial - different weights\' scoring, then \'Points\' label should be displayed and a points input field should be displayed besides each option', () => {
192
+ utilities.verifyInnerText(fillInTheGapsDragAndDropPage.pointsLabel(), 'Points');
193
+ utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.pointsLabel(), 'visible');
194
+ utilities.verifyElementCount(fillInTheGapsDragAndDropPage.pointsInputField(), 3);
195
+ });
196
+
197
+ it('By default the \'Points\' input field should be empty', () => {
198
+ fillInTheGapsDragAndDropPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmpty();
199
+ });
200
+
201
+ it('User should be able to set points in the \'Points\' input fields', () => {
202
+ fillInTheGapsDragAndDropPage.steps.allotPartialDifferentWeightsPoints({ 0: 2.3, 1: 2.2, 2: 1.2 });
203
+ });
204
+
205
+ it('CSS of \'Points\' label and \'Points\' input fields', { tags: 'css' }, () => {
206
+ utilities.verifyCSS(fillInTheGapsDragAndDropPage.pointsLabel(), {
207
+ 'color': css.color.labels,
208
+ 'font-size': css.fontSize.normal,
209
+ 'font-weight': css.fontWeight.semibold
210
+ });
211
+ utilities.verifyCSS(fillInTheGapsDragAndDropPage.pointsInputField(), {
212
+ 'color': css.color.text,
213
+ 'font-size': css.fontSize.default,
214
+ 'font-weight': css.fontWeight.regular
215
+ });
216
+ });
217
+
218
+ it('When the user switches to \'All or nothing\' scoring, the points added for individual responses in Partial - different weights scoring should get summed up in the \'All or nothing scoring\' points input field', () => {
219
+ fillInTheGapsDragAndDropPage.steps.selectAutoScoredScoringSubtype('All or nothing');
220
+ fillInTheGapsDragAndDropPage.steps.verifyPointsFieldValue(5.7);
221
+ });
222
+
223
+ it('When the user updates the entered points in \'All or nothing\' scoring type and switches to \'Partial different weights\' scoring type, then the points should be equally divided and displayed besides each correct option', () => {
224
+ fillInTheGapsDragAndDropPage.steps.allotPoints(9);
225
+ fillInTheGapsDragAndDropPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
226
+ fillInTheGapsDragAndDropPage.steps.verifyPartialDifferentWeightsPointsInputFieldValue([3, 3, 3]);
227
+ });
228
+ });
229
+ });
@@ -0,0 +1,90 @@
1
+ import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ const options = ['Petals', 'Leaves', 'Roots', 'Stem'];
6
+
7
+ describe('Create Item page - Fill in the gaps with drag and drop: Specify correct answer, Alternative correct answer', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Specify correct answer section - \'Correct\' accordion', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
16
+ cy.barsPreLoaderWait();
17
+ fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
18
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
19
+ fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
20
+ });
21
+
22
+ fillInTheGapsDragAndDropPage.tests.verifyAutoScoredSpecifyCorrectAnswerHeaderSectionContents('fill in the gaps - drag and drop');
23
+
24
+ it('In the \'Correct\' accordion the dropzone should be displayed with labels, dropzone fields and two empty options in the \'Specify correct answer\' options section', () => {
25
+ utilities.verifyElementCount(fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection(), 3);
26
+ for (let index = 0; index < fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection(); index++) {
27
+ utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDragAndDropPage.dropzoneLabelSpecifyCorrectAnswerSection(), index), `Dropzone ${index}`);
28
+ }
29
+ fillInTheGapsDragAndDropPage.steps.verifyOptionContainerOptionSpecifyCorrectAnswerSection(0, '');
30
+ fillInTheGapsDragAndDropPage.steps.verifyOptionContainerOptionSpecifyCorrectAnswerSection(1, '')
31
+ });
32
+
33
+ it('When the user enters text in the options input field then the options should be displayed in the \'Specify correct answer\' options section', () => {
34
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(options);
35
+ options.forEach((option, index) => {
36
+ fillInTheGapsDragAndDropPage.steps.verifyOptionContainerOptionSpecifyCorrectAnswerSection(index, option);
37
+ });
38
+ });
39
+
40
+ fillInTheGapsDragAndDropPage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
41
+ });
42
+
43
+ describe('Specify correct answer section - \'Alternative\' accordion', () => {
44
+ abortEarlySetup();
45
+ before(() => {
46
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
47
+ cy.barsPreLoaderWait();
48
+ fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
49
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
50
+ fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
51
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(options);
52
+ });
53
+
54
+ fillInTheGapsDragAndDropPage.tests.verifyAutoScoredAddAlternativeAnswerButtonAndValidation();
55
+
56
+ it('When user has added points and set correct answers in the \'Correct\' accordion, then the user should be able to add alternative answer for the question using \'Add alternative answer\' button', () => {
57
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
58
+ fillInTheGapsDragAndDropPage.steps.allotPoints(20);
59
+ fillInTheGapsDragAndDropPage.steps.addAlternativeAnswerAccordion(1);
60
+ });
61
+
62
+ it('When the user has added options in the options sections then they should be displayed in the \'Alternative\' accordion options section', () => {
63
+ options.forEach((option, index) => {
64
+ fillInTheGapsDragAndDropPage.steps.verifyOptionContainerOptionSpecifyCorrectAnswerSection(index, option);
65
+ });
66
+ });
67
+
68
+ fillInTheGapsDragAndDropPage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Alternative');
69
+
70
+ it('User should be able to add another alternative answer for the question using \'Add alternative answer\' button and the name for this new accordion should be \'Alternative 2\'', () => {
71
+ fillInTheGapsDragAndDropPage.steps.addAlternativeAnswerAccordion(2);
72
+ });
73
+
74
+ fillInTheGapsDragAndDropPage.tests.verifyWarningPopupAndAccordionNavigationWhenNoPointsAddedInAlternativeAccordion();
75
+
76
+ it('User should be able to remove alternative correct answer by clicking on the \'Delete\' icon button alongside alternative answer accordion and the name of the alternative answer accordions should get updated accordingly', () => {
77
+ cy.log('Set correct answer and points in alternative 2 accordion, then switch to alternative 1 accordion and click delete icon button');
78
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Leaves': 0, 'Petals': 1, 'Stem': 2 });
79
+ fillInTheGapsDragAndDropPage.steps.allotPoints(5);
80
+ fillInTheGapsDragAndDropPage.steps.deleteAlternativeAnswerAccordion(1);
81
+ fillInTheGapsDragAndDropPage.steps.verifyAlternativeAnswerAccordionNotExists(2);
82
+ fillInTheGapsDragAndDropPage.steps.verifyAlternativeAnswerAccordionLabel(1);
83
+ });
84
+
85
+ it('When the user deletes an option assigned as correct in the correct accordion then the correct accordion should be in the expanded state', () => {
86
+ fillInTheGapsDragAndDropPage.steps.deleteOption(3);
87
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerAccordionIsExpanded();
88
+ });
89
+ });
90
+ });
@@ -0,0 +1,50 @@
1
+ import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const options1 = ['Flower', 'Petals'];
5
+ const options2 = ['Seeds', 'Stem'];
6
+ const options3 = options1.concat(options2);
7
+
8
+ describe('Create Item Page: Fill in the gaps with drag and drop: Switching cases between \'Standard\' and \'Grouped\' options layout', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Fill in the gaps with drag and drop: Switching cases between \'Standard\' and \'Grouped\' options layout: \'Response Options section\'', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
17
+ cy.barsPreLoaderWait();
18
+ fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
19
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
20
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(options1);
21
+ });
22
+
23
+ it('When the user switches from \'Standard\' response layout to \'Grouped\', all the option input fields along with text should appear in the group options', () => {
24
+ fillInTheGapsDragAndDropPage.steps.expandDraggableOptionsLayoutDropdown();
25
+ fillInTheGapsDragAndDropPage.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped');
26
+ fillInTheGapsDragAndDropPage.steps.verifyOptionFieldContentsInOptionsSection(options1);
27
+ cy.log('verifying draggable options in \'Specify correct answer\' section')
28
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, options1);
29
+ });
30
+
31
+ it('When the user creates more than one group of options and switches to \'Standard\' response layout, all the option input fields along with text should appear in the standard options', () => {
32
+ cy.log('Adding a new group and adding input to the option fields')
33
+ fillInTheGapsDragAndDropPage.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection('Group B', options2);
34
+ fillInTheGapsDragAndDropPage.steps.expandDraggableOptionsLayoutDropdown();
35
+ fillInTheGapsDragAndDropPage.steps.selectOptionFromDraggableOptionsLayoutDropdown('Standard');
36
+ fillInTheGapsDragAndDropPage.steps.verifyOptionFieldContentsInOptionsSection(options3);
37
+ cy.log('verifying draggable options in \'Specify correct answer\' section')
38
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(options3);
39
+ });
40
+
41
+ it('On switching back to \'Grouped\' response layout, all option input fields should be present under Group A and no other group should exist', () => {
42
+ fillInTheGapsDragAndDropPage.steps.expandDraggableOptionsLayoutDropdown();
43
+ fillInTheGapsDragAndDropPage.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped');
44
+ utilities.verifyElementCount(fillInTheGapsDragAndDropPage.groupTab(), 1);
45
+ fillInTheGapsDragAndDropPage.steps.verifyOptionFieldContentsInOptionsSection(options3);
46
+ cy.log('verifying draggable options in \'Specify correct answer\' section')
47
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, options3);
48
+ });
49
+ });
50
+ });