itemengine-cypress-automation 1.0.32 → 1.0.36
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsAnswerNumerationAndResponseOptionPlacement.js +196 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsBasic.js +210 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsStemAndResponseColumnHeader.js +206 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingAlternateAnswer.js +193 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingClickAndDrop.js +644 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingEditTabScoringTypes.js +105 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsAllOrNothingScoring.js +117 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsAllOrNothingScoringWithAlternateAnswer.js +30 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsManualAndNonScoredScoring.js +49 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialDifferentScoringWithAlternateTab.js +36 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialDifferentScorings.js +49 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialEqualWeightsScoring.js +48 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialEqualWeightsScoringWithAlternateTab.js +36 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.js +207 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesEditTab.js +139 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesPreviewTab.js +227 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingHeaderSection.js +95 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.js +246 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingScoringSectionBasic.js +21 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingSetCorrectAnswerSectionBasic.js +40 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsAllOrNothingScoring.js +113 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsAllOrNothingScoringWithAlternateAnswer.js +30 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsManualAndNonScoredScoring.js +48 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialDIfferentScoring.js +49 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialDifferentScoringWithAlternateAnswer.js +36 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialEqualScoring.js +48 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialEqualScoringWithAlternateAnswer.js +35 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSection.js +233 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesEditTab.js +113 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.js +185 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingSwitchingCases.js +47 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsAnswerNumerationAndOptionLabel.js +295 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsBasic.js +300 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsOptionStyleDropdown.js +302 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsSetPointsPopup.js +273 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoring.js +178 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoringWithAlternateAnswer.js +712 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingEditTabBasicSection.js +316 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingEditTabScoringSection.js +256 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingHeaderSection.js +83 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingManuallyAndNonScoredScoring.js +160 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoring.js +191 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoringWithAlternateAnswer.js +895 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoring.js +191 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoringWithAlternateAnswer.js +807 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingSetCorrectAnswerCheckboxes.js +208 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingSetCorrectAnswerSection.js +172 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettings.js +820 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +936 -0
- package/cypress/e2e/ILC/ListSorting/listSortingClickAndDrop.js +456 -0
- package/cypress/e2e/ILC/ListSorting/listSortingEditTabBasicSection.js +440 -0
- package/cypress/e2e/ILC/ListSorting/listSortingEditTabScoringSection.js +259 -0
- package/cypress/e2e/ILC/ListSorting/listSortingHeaderSection.js +89 -0
- package/cypress/e2e/ILC/ListSorting/listSortingManuallyAndNonScoredScoring.js +171 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoring.js +1150 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoring.js +1055 -0
- package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.js +263 -0
- package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerSection.js +168 -0
- package/package.json +1 -1
@@ -0,0 +1,207 @@
|
|
1
|
+
import { listMatchingPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
|
5
|
+
const optionsForGroup2 = ['Response 5', 'Response 6'];
|
6
|
+
let optionsForThreeResponses = ['Response 1', 'Response 2', 'Response 3'];
|
7
|
+
let optionsForFourResponses = ['Response 1', 'Response 2', 'Response 3', 'Response 4'];
|
8
|
+
|
9
|
+
describe('Create Item Page: List matching: Grouped response layout - Edit tab', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('\'Grouped\' response options layout - Edit tab section contents', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
cy.log('Navigating to List Matching question type');
|
18
|
+
listMatchingPage.steps.navigateToCreateQuestion('list matching');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
});
|
21
|
+
|
22
|
+
listMatchingPage.tests.verifyGroupedOptionsContentAndFunctionality();
|
23
|
+
});
|
24
|
+
|
25
|
+
describe('\'Grouped\' response options layout - Set correct answer section contents', () => {
|
26
|
+
abortEarlySetup();
|
27
|
+
before(() => {
|
28
|
+
cy.log('Navigating to List Matching question type');
|
29
|
+
listMatchingPage.steps.navigateToCreateQuestion('list matching');
|
30
|
+
cy.barsPreLoaderWait();
|
31
|
+
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
32
|
+
});
|
33
|
+
|
34
|
+
it('When the user has not entered text in the \'Group title\' input field then no group title should be displayed for the group in the response options container of the \'Set Correct Answer\' section', () => {
|
35
|
+
listMatchingPage.setCorrectAnswerSectionGroupedResponseTitle()
|
36
|
+
.should('not.exist');
|
37
|
+
});
|
38
|
+
|
39
|
+
it('When the user enters text in the \'Group title\' input field, a group title should be displayed for the group in the response options container of the \'Set Correct Answer\' section', () => {
|
40
|
+
listMatchingPage.steps.addGroupTitle(0, 'Group title A');
|
41
|
+
listMatchingPage.setCorrectAnswerSectionGroupedResponseTitle()
|
42
|
+
.should('have.text', 'Group title A');
|
43
|
+
});
|
44
|
+
|
45
|
+
it('When the user has not entered text in the options input field then three empty draggable options along with drag handles should be displayed as a group in the response options container of the \'Set Correct Answer\' section', () => {
|
46
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['', '', '']);
|
47
|
+
listMatchingPage.steps.verifyDragIconVisibleInOptionsInSetCorrectAnswerSection();
|
48
|
+
});
|
49
|
+
|
50
|
+
it('When the user enters text in options input fields then the entered text should be displayed in the respective draggable options in a group in the response options container of the \'Set Correct Answer\' section', () => {
|
51
|
+
listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
|
52
|
+
cy.wait(500);
|
53
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForThreeResponses);
|
54
|
+
});
|
55
|
+
|
56
|
+
//Failing due to https://redmine.zeuslearning.com/issues/541421
|
57
|
+
it('CSS of \'Grouped\' container in the \'Set Correct Answer\' section', { tags: 'css' }, () => {
|
58
|
+
listMatchingPage.setCorrectAnswerSectionGroupedResponseContainer()
|
59
|
+
.should('have.css', 'border', `1px solid ${css.color.defaultDropdownBorder}`);
|
60
|
+
listMatchingPage.draggableOption()
|
61
|
+
.should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`)
|
62
|
+
.find('.question-text-wrapper')
|
63
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
64
|
+
listMatchingPage.draggableOption()
|
65
|
+
.find('.drag-indicator-icon')
|
66
|
+
.should('have.css', 'fill', `${css.color.activeButtons}`);
|
67
|
+
});
|
68
|
+
|
69
|
+
it('Accessibility of \'Grouped\' container in the \'Set Correct Answer\' section', { tags: 'a11y' }, () => {
|
70
|
+
cy.checkAccessibility(listMatchingPage.setCorrectAnswerSectionGroupedResponseContainer());
|
71
|
+
});
|
72
|
+
|
73
|
+
it('When the user adds an option using \'Add Option\' button then the added option should be displayed along with drag handle inside the group in the response options container of the \'Set Correct Answer\' section', () => {
|
74
|
+
listMatchingPage.steps.addOption();
|
75
|
+
listMatchingPage.steps.verifyCountOfDraggableOptionsInSetCorrectAnswerSection('List matching', 4);
|
76
|
+
listMatchingPage.steps.verifyDefaultStateOfDraggableOptionsInSetCorrectAnswerSection('List matching', 3);
|
77
|
+
cy.log('Checking that input text to the newly added option is displayed in the response options container of the \'Set Correct Answer\' section')
|
78
|
+
listMatchingPage.steps.addInputToOptionForDragAndDropInputField(optionsForFourResponses[3], 3);
|
79
|
+
cy.wait(500);
|
80
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForFourResponses);
|
81
|
+
});
|
82
|
+
|
83
|
+
it('When the user deletes an option then the deleted option should get removed from the group in the response options container of the \'Set Correct Answer\' section', () => {
|
84
|
+
listMatchingPage.steps.deleteResponseOptionInputField(3);
|
85
|
+
cy.log('verifying the text of draggable options after deleting an option')
|
86
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForThreeResponses);
|
87
|
+
});
|
88
|
+
|
89
|
+
it('When the user adds a new group, the new group should be displayed in the response options container of the \'Set Correct Answer\' section', () => {
|
90
|
+
listMatchingPage.steps.addGroup();
|
91
|
+
listMatchingPage.steps.verifyCountOfGroupsInSetCorrectAnswerSection(2);
|
92
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(1, ['', '']);
|
93
|
+
});
|
94
|
+
|
95
|
+
it('When the user deletes a group, then the deleted group should get removed from the response options container as well as from the response areas (if any) of the \'Set Correct Answer\' section', () => {
|
96
|
+
cy.log('Pre step: Entering text into the text fields of group 2 response container')
|
97
|
+
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, optionsForGroup2);
|
98
|
+
listMatchingPage.steps.addGroupTitle(1, 'Group title B');
|
99
|
+
cy.log('Setting a correct answer option')
|
100
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Response 2', 0);
|
101
|
+
cy.log('Deleting the 1st group')
|
102
|
+
listMatchingPage.steps.deleteGroup(0);
|
103
|
+
listMatchingPage.steps.verifyCountOfGroupsInSetCorrectAnswerSection(1);
|
104
|
+
listMatchingPage.steps.verifyErroredStateOfEmptyResponseFieldInSetCorrectAnswerSection(0);
|
105
|
+
cy.log('verifying the contents of group 2 after deleting group 1')
|
106
|
+
listMatchingPage.steps.verifyGroupedResponseOptionsInSetCorrectAnswerSection(0, 'Group title B', optionsForGroup2);
|
107
|
+
});
|
108
|
+
});
|
109
|
+
|
110
|
+
describe('\'Grouped\' response options layout - Preview tab contents', () => {
|
111
|
+
abortEarlySetup();
|
112
|
+
before(() => {
|
113
|
+
cy.log('Navigating to List Matching question type');
|
114
|
+
listMatchingPage.steps.navigateToCreateQuestion('list matching');
|
115
|
+
cy.barsPreLoaderWait();
|
116
|
+
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
117
|
+
listMatchingPage.steps.switchToPreviewTab();
|
118
|
+
});
|
119
|
+
|
120
|
+
it('When the user has not entered text in the \'Group title\' input field then no group title should be displayed for the group in the response options container of the \'Preview tab\'', () => {
|
121
|
+
listMatchingPage.previewTabGroupedResponseTitle()
|
122
|
+
.should('not.exist');
|
123
|
+
});
|
124
|
+
|
125
|
+
it('When the user enters text in the \'Group title\' input field, a group title should be displayed for the group in the response options container of the \'Preview tab\'', () => {
|
126
|
+
cy.log('Pre step: Switching to edit tab')
|
127
|
+
listMatchingPage.steps.switchToEditTab();
|
128
|
+
listMatchingPage.steps.addGroupTitle(0, 'Group title A');
|
129
|
+
listMatchingPage.steps.switchToPreviewTab();
|
130
|
+
listMatchingPage.previewTabGroupedResponseTitle()
|
131
|
+
.should('have.text', 'Group title A');
|
132
|
+
});
|
133
|
+
|
134
|
+
it('When the user has not entered text in the options input field then three empty draggable options along with drag handles should be displayed as a group in the response options container of the \'Preview tab\'', () => {
|
135
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['', '', '']);
|
136
|
+
});
|
137
|
+
|
138
|
+
it('When the user enters text in options input fields then the entered text should be displayed in the respective draggable options in the response options container of the \'Preview tab\'', () => {
|
139
|
+
cy.log('Pre step: Switching to edit tab')
|
140
|
+
listMatchingPage.steps.switchToEditTab();
|
141
|
+
listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
|
142
|
+
listMatchingPage.steps.switchToPreviewTab();
|
143
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, optionsForThreeResponses);
|
144
|
+
});
|
145
|
+
|
146
|
+
it('CSS of \'Grouped\' container in the response options container of the \'Preview tab\'', { tags: 'css' }, () => {
|
147
|
+
listMatchingPage.previewTabGroupedResponseContainer()
|
148
|
+
.should('have.css', 'border', `1px solid ${css.color.defaultDropdownBorder}`)
|
149
|
+
.within(() => {
|
150
|
+
listMatchingPage.draggableOption()
|
151
|
+
.should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`)
|
152
|
+
.find('.drag-indicator-icon')
|
153
|
+
.should('have.css', 'fill', `${css.color.activeButtons}`);
|
154
|
+
});
|
155
|
+
});
|
156
|
+
|
157
|
+
it('Accessibility of \'Grouped\' container in the response options container of the \'Preview tab\'', { tags: 'a11y' }, () => {
|
158
|
+
cy.checkAccessibility(listMatchingPage.previewTabGroupedResponseContainer());
|
159
|
+
});
|
160
|
+
|
161
|
+
it('When the user adds an option using \'Add Option\' button then the added option should be displayed inside the group in the response options container of the \'Preview tab\'', () => {
|
162
|
+
cy.log('Pre step: Switching to edit tab')
|
163
|
+
listMatchingPage.steps.switchToEditTab();
|
164
|
+
listMatchingPage.steps.addOption();
|
165
|
+
listMatchingPage.steps.switchToPreviewTab();
|
166
|
+
listMatchingPage.steps.verifyCountOfDraggableOptionsInPreviewTab('List matching', 4);
|
167
|
+
listMatchingPage.steps.verifyDefaultStateOfDraggableOptionsInPreviewTab('List matching', 3);
|
168
|
+
cy.log('Checking that input text to the newly added option is displayed in the option in Preview tab section')
|
169
|
+
listMatchingPage.steps.switchToEditTab();
|
170
|
+
listMatchingPage.steps.addInputToOptionForDragAndDropInputField(optionsForFourResponses[3], 3);
|
171
|
+
listMatchingPage.steps.switchToPreviewTab();
|
172
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, optionsForFourResponses);
|
173
|
+
});
|
174
|
+
|
175
|
+
it('When the user deletes an option then the deleted option should get removed from the group in the response options container of the \'Preview tab\'', () => {
|
176
|
+
cy.log('Pre step: Switching to edit tab')
|
177
|
+
listMatchingPage.steps.switchToEditTab();
|
178
|
+
listMatchingPage.steps.deleteResponseOptionInputField(3);
|
179
|
+
cy.log('Checking the deleted option should not exist in the Preview tab')
|
180
|
+
listMatchingPage.steps.switchToPreviewTab();
|
181
|
+
cy.log('verifying the text of draggable options after deleting an option')
|
182
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, optionsForThreeResponses);
|
183
|
+
});
|
184
|
+
|
185
|
+
it('When the user adds a new group, the new group should be displayed in the response options container of the \'Preview tab\'', () => {
|
186
|
+
cy.log('Pre step: Switching to edit tab')
|
187
|
+
listMatchingPage.steps.switchToEditTab();
|
188
|
+
listMatchingPage.steps.addGroup();
|
189
|
+
listMatchingPage.steps.switchToPreviewTab();
|
190
|
+
listMatchingPage.steps.verifyCountOfGroupsInPreviewTab(2);
|
191
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(1, ['', '']);
|
192
|
+
});
|
193
|
+
|
194
|
+
it('When the user deletes a group, it should get removed from response options container of the \'Preview tab\'', () => {
|
195
|
+
cy.log('Pre step: Switching to edit tab')
|
196
|
+
listMatchingPage.steps.switchToEditTab();
|
197
|
+
cy.log('Pre step: Entering text into the text fields of group 2 response container')
|
198
|
+
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, optionsForGroup2)
|
199
|
+
listMatchingPage.steps.addGroupTitle(1, 'Group title B');
|
200
|
+
listMatchingPage.steps.deleteGroup(0);
|
201
|
+
listMatchingPage.steps.switchToPreviewTab();
|
202
|
+
listMatchingPage.steps.verifyCountOfGroupsInPreviewTab(1);
|
203
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, optionsForGroup2);
|
204
|
+
listMatchingPage.steps.verifyGroupTitleInPreviewTab(0, 'Group title B');
|
205
|
+
});
|
206
|
+
});
|
207
|
+
})
|
package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesEditTab.js
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
import { listMatchingPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
let stems = ['Stem 1', 'Stem 2', 'Stem 3', 'Stem 4'];
|
5
|
+
let optionsForResponses = [
|
6
|
+
['Response 1', 'Response 2', 'Response 3', 'Response 4'],
|
7
|
+
['Response 5', 'Response 6', 'Response 7', 'Response 8'],
|
8
|
+
['Response 9', 'Response 10', 'Response 11', 'Response 12'],
|
9
|
+
['Response 13', 'Response 14', 'Response 15', 'Response 16']
|
10
|
+
];
|
11
|
+
let groupTitles = ['Group title A', 'Group title B', 'Group title C', 'Group title D'];
|
12
|
+
|
13
|
+
describe('Create Item page - List Matching: Randomize options, Reuse options, Hide drag handle functionalities for \'Grouped\' response option layout in edit tab', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
describe('Randomize options - Functionality : Edit tab', () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
cy.log('Navigating to List Matching question type');
|
22
|
+
listMatchingPage.steps.navigateToCreateQuestion('list matching');
|
23
|
+
cy.barsPreLoaderWait();
|
24
|
+
listMatchingPage.steps.addInputToAllStemFields(['Stem 1', 'Stem 2', 'Stem 3']);
|
25
|
+
listMatchingPage.steps.addStem();
|
26
|
+
listMatchingPage.steps.addInputToStemField(3, stems[3]);
|
27
|
+
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
28
|
+
listMatchingPage.steps.addOptionInGroupedResponseLayout(0);
|
29
|
+
listMatchingPage.steps.addGroupTitle(0, groupTitles[0]);
|
30
|
+
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(0, optionsForResponses[0]);
|
31
|
+
listMatchingPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(1, groupTitles[1], optionsForResponses[1]);
|
32
|
+
listMatchingPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(2, groupTitles[2], optionsForResponses[2]);
|
33
|
+
listMatchingPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(3, groupTitles[3], optionsForResponses[3]);
|
34
|
+
});
|
35
|
+
|
36
|
+
it('When the \'Randomize options\' functionality is disabled, the grouped draggable options in the option container should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
|
37
|
+
optionsForResponses.forEach((options, index) => {
|
38
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(index, options);
|
39
|
+
});
|
40
|
+
});
|
41
|
+
|
42
|
+
it('When the \'Randomize options\' functionality is disabled, the stem fields in the set correct answer section should be displayed in the order in which the user has set them in the Stems section', () => {
|
43
|
+
listMatchingPage.steps.verifyStemFieldsInSetCorrectAnswerSection(stems);
|
44
|
+
});
|
45
|
+
|
46
|
+
it('When the user enables the \'Randomize options\' functionality, then the draggable options in the response container should be in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
|
47
|
+
listMatchingPage.steps.checkRandomizeOptionsCheckbox();
|
48
|
+
optionsForResponses.forEach((options, index) => {
|
49
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(index, options);
|
50
|
+
});
|
51
|
+
groupTitles.forEach((groupTitle, groupIndex) => {
|
52
|
+
listMatchingPage.steps.verifyGroupTitleInSetCorrectAnswerSection(groupIndex, groupTitle);
|
53
|
+
});
|
54
|
+
});
|
55
|
+
|
56
|
+
it('When the user enables the \'Randomize options\' functionality, then the stem fields in the set correct answer section should be in the order in which the user has set them in the Stems section', () => {
|
57
|
+
listMatchingPage.steps.verifyStemFieldsInSetCorrectAnswerSection(stems);
|
58
|
+
});
|
59
|
+
|
60
|
+
listMatchingPage.tests.verifyCSSAndA11yOfCheckedStateOfRandomizeOptionsCheckbox();
|
61
|
+
});
|
62
|
+
|
63
|
+
describe('Reuse options - Functionality : Edit tab', () => {
|
64
|
+
abortEarlySetup();
|
65
|
+
before(() => {
|
66
|
+
listMatchingPage.steps.navigateToCreateQuestion('list matching');
|
67
|
+
cy.barsPreLoaderWait();
|
68
|
+
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
69
|
+
listMatchingPage.steps.deleteResponseOptionInputField(0);
|
70
|
+
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(0, ['Response 1', 'Response 2']);
|
71
|
+
listMatchingPage.steps.addGroup();
|
72
|
+
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, ['Response 3', 'Response 4']);
|
73
|
+
});
|
74
|
+
|
75
|
+
it('When the \'Reuse options\' functionality is disabled, then on setting correct answer in the response area, the draggable options should get removed from the respective group container', () => {
|
76
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Response 1', 0);
|
77
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 2']);
|
78
|
+
});
|
79
|
+
|
80
|
+
it('When the user enables the \'Reuse options\' functionality, then on setting correct answer in the response area, the draggable options should persist in the respective group container', () => {
|
81
|
+
cy.log('Pre step: Removing the set correct answer option from the response area')
|
82
|
+
listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInSetCorrectAnswerSection(0);
|
83
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 1', 'Response 2']);
|
84
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(1, ['Response 3', 'Response 4']);
|
85
|
+
cy.log('Checking the reuse option checkbox and setting the correct answer option')
|
86
|
+
listMatchingPage.steps.checkReuseOptionsCheckbox();
|
87
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Response 1', 0);
|
88
|
+
listMatchingPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
|
89
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 1', 'Response 2']);
|
90
|
+
});
|
91
|
+
|
92
|
+
listMatchingPage.tests.verifyCSSAndA11yOfCheckedStateOfReuseOptionsCheckbox();
|
93
|
+
|
94
|
+
it('The user should be able to use the same draggable option for multiple response areas', () => {
|
95
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Response 1', 1);
|
96
|
+
listMatchingPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
|
97
|
+
listMatchingPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(1, 'Response 1');
|
98
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 1', 'Response 2']);
|
99
|
+
});
|
100
|
+
|
101
|
+
it('When the user removes the option from the response area and moves it into the grouped options container, only one option should be displayed in the respective group', () => {
|
102
|
+
listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInSetCorrectAnswerSection(0);
|
103
|
+
listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInSetCorrectAnswerSection(1);
|
104
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 1', 'Response 2']);
|
105
|
+
});
|
106
|
+
|
107
|
+
it('When the user disables the \'Reuse options\' functionality, the duplicate answer set as correct answer should get removed from the response area and the draggable option should also not exist in the respective group container of the \'Set correct answer\' section', () => {
|
108
|
+
cy.log('PRe-step: Setting the same draggable option for multiple response areas');
|
109
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Response 1', 0);
|
110
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Response 1', 1);
|
111
|
+
listMatchingPage.steps.uncheckReuseOptionsCheckbox();
|
112
|
+
listMatchingPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
|
113
|
+
listMatchingPage.steps.verifyEmptyResponseAreaInSetCorrectAnswerSection(1);
|
114
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 2']);
|
115
|
+
});
|
116
|
+
});
|
117
|
+
|
118
|
+
describe('Hide drag handle - Functionality: Edit tab', () => {
|
119
|
+
abortEarlySetup();
|
120
|
+
before(() => {
|
121
|
+
cy.log('Navigating to List Matching question type');
|
122
|
+
listMatchingPage.steps.navigateToCreateQuestion('list matching');
|
123
|
+
cy.barsPreLoaderWait();
|
124
|
+
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
125
|
+
});
|
126
|
+
|
127
|
+
it('When the \'Hide drag handle\' functionality is disabled, then the draggable options displayed in response container of the \'Set correct answer\' section should have a drag handle', () => {
|
128
|
+
listMatchingPage.steps.verifyDragIconVisibleInOptionsInSetCorrectAnswerSection()
|
129
|
+
});
|
130
|
+
|
131
|
+
it('When the user enables the \'Hide drag handle\' functionality, then the draggable options displayed in response container of the \'Set correct answer\' section should not have a drag handle', () => {
|
132
|
+
listMatchingPage.steps.switchToEditTab();
|
133
|
+
listMatchingPage.steps.checkHideDragHandleCheckbox();
|
134
|
+
listMatchingPage.steps.verifyDragIconNotVisibleInOptionsInSetCorrectAnswerSection();
|
135
|
+
});
|
136
|
+
|
137
|
+
listMatchingPage.tests.verifyCSSAndA11yOfCheckedStateOfHideDragHandleCheckbox();
|
138
|
+
});
|
139
|
+
});
|
@@ -0,0 +1,227 @@
|
|
1
|
+
import { listMatchingPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
let stems = ['Stem 1', 'Stem 2', 'Stem 3', 'Stem 4'];
|
5
|
+
let optionsForResponses = [
|
6
|
+
['Response 1', 'Response 2', 'Response 3', 'Response 4'],
|
7
|
+
['Response 5', 'Response 6', 'Response 7', 'Response 8'],
|
8
|
+
['Response 9', 'Response 10', 'Response 11', 'Response 12'],
|
9
|
+
['Response 13', 'Response 14', 'Response 15', 'Response 16']
|
10
|
+
];
|
11
|
+
let groupTitles = ['Group title A', 'Group title B', 'Group title C', 'Group title D'];
|
12
|
+
|
13
|
+
describe('Create Item page - List Matching: Randomize options, Reuse options, Hide drag handle functionalities for \'Grouped\' response option layout in preview tab', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
describe('Randomize options - Functionality : Preview tab', () => {
|
19
|
+
let optionsArray = [];
|
20
|
+
let stemsArray = [];
|
21
|
+
let groupTitleArray = [];
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
cy.log('Navigating to List Matching question type');
|
25
|
+
listMatchingPage.steps.navigateToCreateQuestion('list matching');
|
26
|
+
cy.barsPreLoaderWait();
|
27
|
+
listMatchingPage.steps.addInputToAllStemFields(['Stem 1', 'Stem 2', 'Stem 3']);
|
28
|
+
listMatchingPage.steps.addStem();
|
29
|
+
listMatchingPage.steps.addInputToStemField(3, stems[3]);
|
30
|
+
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
31
|
+
listMatchingPage.steps.addOptionInGroupedResponseLayout(0);
|
32
|
+
listMatchingPage.steps.addGroupTitle(0, groupTitles[0]);
|
33
|
+
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(0, optionsForResponses[0]);
|
34
|
+
listMatchingPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(1, groupTitles[1], optionsForResponses[1]);
|
35
|
+
listMatchingPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(2, groupTitles[2], optionsForResponses[2]);
|
36
|
+
listMatchingPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(3, groupTitles[3], optionsForResponses[3]);
|
37
|
+
listMatchingPage.steps.switchToPreviewTab();
|
38
|
+
});
|
39
|
+
|
40
|
+
it('When the \'Randomize options\' functionality is disabled, then the grouped draggable options in the option container should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
|
41
|
+
optionsForResponses.forEach((options, index) => {
|
42
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(index, options);
|
43
|
+
});
|
44
|
+
groupTitles.forEach((groupTitle, groupIndex) => {
|
45
|
+
listMatchingPage.steps.verifyGroupTitleInPreviewTab(groupIndex, groupTitle);
|
46
|
+
});
|
47
|
+
});
|
48
|
+
|
49
|
+
it('When the \'Randomize options\' functionality is disabled, the stem fields should be displayed in the order in which the user has set them in the Stems section', () => {
|
50
|
+
listMatchingPage.steps.verifyStemFieldsInPreviewTab(stems);
|
51
|
+
});
|
52
|
+
|
53
|
+
it('When the user enables the \'Randomize options\' functionality, then the groups as well as the draggable options inside the groups should be displayed in a random order', () => {
|
54
|
+
listMatchingPage.steps.switchToEditTab();
|
55
|
+
listMatchingPage.steps.checkRandomizeOptionsCheckbox();
|
56
|
+
cy.log('Added wait here to prevent cypress from switching to preview tab just after checking randomize options checkbox');
|
57
|
+
cy.wait(1000);
|
58
|
+
listMatchingPage.steps.switchToPreviewTab();
|
59
|
+
listMatchingPage.steps.verifyRandomizationOfGroupsInPreviewTab(groupTitles);
|
60
|
+
for (let groupIndex = 0; groupIndex < groupTitles.length; groupIndex++) {
|
61
|
+
listMatchingPage.steps.verifyRandomizeOptionOrderInGroup(groupTitles[groupIndex], optionsForResponses[groupIndex]);
|
62
|
+
};
|
63
|
+
optionsArray = listMatchingPage.steps.getOptionsArray('List Matching');
|
64
|
+
groupTitleArray = listMatchingPage.steps.getGroupTitleArray();
|
65
|
+
});
|
66
|
+
|
67
|
+
it('When the user enables the \'Randomize options\' functionality, then the stem fields should be displayed in a random order', () => {
|
68
|
+
listMatchingPage.steps.verifyRandomizedStemsOrder(stems);
|
69
|
+
stemsArray = listMatchingPage.steps.getStemsArray();
|
70
|
+
});
|
71
|
+
|
72
|
+
it('When the user switches to \'Edit tab\' and does not modify any question properties, then the order of the draggable options should not change in the response container', () => {
|
73
|
+
listMatchingPage.steps.switchToEditTab();
|
74
|
+
listMatchingPage.steps.switchToPreviewTab();
|
75
|
+
listMatchingPage.steps.verifyOptionsInPreviewTab(optionsArray);
|
76
|
+
});
|
77
|
+
|
78
|
+
it('When the user switches to \'Edit tab\' and does not modify any question properties, then the order of the stem fields should not change in the response container', () => {
|
79
|
+
listMatchingPage.steps.switchToEditTab();
|
80
|
+
listMatchingPage.steps.switchToPreviewTab();
|
81
|
+
listMatchingPage.steps.verifyStemFieldsInPreviewTab(stemsArray);
|
82
|
+
});
|
83
|
+
|
84
|
+
it('When the user switches to \'Edit tab\' and modifies any of question properties, then the order of the draggable options should change in the response container', () => {
|
85
|
+
listMatchingPage.steps.switchToEditTab();
|
86
|
+
listMatchingPage.steps.allotPoints(5);
|
87
|
+
cy.log('Added wait here to prevent cypress from switching to preview tab just after modifying the question');
|
88
|
+
cy.wait(1000);
|
89
|
+
listMatchingPage.steps.switchToPreviewTab();
|
90
|
+
for (let groupIndex = 0; groupIndex < groupTitles.length; groupIndex++) {
|
91
|
+
listMatchingPage.steps.verifyRandomizeOptionOrderInGroup(groupTitles[groupIndex], optionsForResponses[groupIndex]);
|
92
|
+
};
|
93
|
+
listMatchingPage.steps.verifyRerandomizedOptionsOrder(optionsArray, 'List matching');
|
94
|
+
listMatchingPage.steps.verifyRerandomizedGroupOrder(groupTitleArray);
|
95
|
+
});
|
96
|
+
|
97
|
+
it('When the user switches to \'Edit tab\' and modifies any of question properties, then the order of the stem fields should change in the response container', () => {
|
98
|
+
listMatchingPage.steps.switchToEditTab();
|
99
|
+
listMatchingPage.steps.selectPartialEqualWeightsCheckbox();
|
100
|
+
cy.log('Added wait here to prevent cypress from switching to preview tab just after modifying the question');
|
101
|
+
cy.wait(1000);
|
102
|
+
listMatchingPage.steps.switchToPreviewTab();
|
103
|
+
listMatchingPage.steps.verifyRandomizedStemsOrder(stems);
|
104
|
+
listMatchingPage.steps.verifyRerandomizedStemsOrder(stemsArray);
|
105
|
+
});
|
106
|
+
|
107
|
+
it('When the user disables the \'Randomize options\' functionality, then the draggable options in the response container should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
|
108
|
+
listMatchingPage.steps.switchToEditTab();
|
109
|
+
listMatchingPage.steps.uncheckRandomizeOptionsCheckbox();
|
110
|
+
listMatchingPage.steps.switchToPreviewTab();
|
111
|
+
optionsForResponses.forEach((options, index) => {
|
112
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(index, options);
|
113
|
+
});
|
114
|
+
groupTitles.forEach((groupTitle, groupIndex) => {
|
115
|
+
listMatchingPage.steps.verifyGroupTitleInPreviewTab(groupIndex, groupTitle);
|
116
|
+
});
|
117
|
+
});
|
118
|
+
|
119
|
+
it('When the user has disabled the \'Randomize options\' functionality, then the stem fields should be displayed in the order in which the user has set them in the set correct answer section', () => {
|
120
|
+
listMatchingPage.steps.verifyStemFieldsInPreviewTab(stems)
|
121
|
+
});
|
122
|
+
});
|
123
|
+
|
124
|
+
describe('Reuse options - Functionality: Preview tab', () => {
|
125
|
+
abortEarlySetup();
|
126
|
+
before(() => {
|
127
|
+
cy.log('Navigating to List Matching question type');
|
128
|
+
listMatchingPage.steps.navigateToCreateQuestion('list matching');
|
129
|
+
cy.barsPreLoaderWait();
|
130
|
+
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
131
|
+
listMatchingPage.steps.deleteResponseOptionInputField(0);
|
132
|
+
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(0, ['Response 1', 'Response 2']);
|
133
|
+
listMatchingPage.steps.addGroup();
|
134
|
+
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, ['Response 3', 'Response 4']);
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When the \'Reuse options\' functionality is disabled, then on attempting the question, the draggable options should get removed from the respective group container', () => {
|
138
|
+
listMatchingPage.steps.switchToPreviewTab();
|
139
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Response 1', 0);
|
140
|
+
listMatchingPage.steps.verifyFilledOptionResponseAreaInPreviewTab(0, 'Response 1')
|
141
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 2']);
|
142
|
+
});
|
143
|
+
|
144
|
+
it('When the \'Reuse options\' functionality is enabled, then on attempting the question, the draggable options should persist in the respective group container', () => {
|
145
|
+
listMatchingPage.steps.switchToEditTab();
|
146
|
+
listMatchingPage.steps.checkReuseOptionsCheckbox();
|
147
|
+
listMatchingPage.steps.switchToPreviewTab();
|
148
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Response 1', 0);
|
149
|
+
listMatchingPage.steps.verifyFilledOptionResponseAreaInPreviewTab(0, 'Response 1');
|
150
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 1', 'Response 2']);
|
151
|
+
});
|
152
|
+
|
153
|
+
it('The user should be able to use the same draggable option for multiple response areas', () => {
|
154
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Response 1', 0);
|
155
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Response 1', 1);
|
156
|
+
listMatchingPage.steps.verifyFilledOptionResponseAreaInPreviewTab(0, 'Response 1');
|
157
|
+
listMatchingPage.steps.verifyFilledOptionResponseAreaInPreviewTab(1, 'Response 1');
|
158
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 1', 'Response 2']);
|
159
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(1, ['Response 3', 'Response 4']);
|
160
|
+
});
|
161
|
+
|
162
|
+
it('When the user removes the option from the response area and moves it into the grouped options container, only one option should be displayed in the respective group', () => {
|
163
|
+
listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(0);
|
164
|
+
listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(1);
|
165
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 1', 'Response 2']);
|
166
|
+
});
|
167
|
+
|
168
|
+
it('When the user disables the \'Reuse options\' functionality, then on attempting the question, the draggable options should get removed from the response container', () => {
|
169
|
+
listMatchingPage.steps.switchToEditTab();
|
170
|
+
listMatchingPage.steps.uncheckReuseOptionsCheckbox();
|
171
|
+
listMatchingPage.steps.switchToPreviewTab();
|
172
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Response 1', 0);
|
173
|
+
listMatchingPage.steps.verifyFilledOptionResponseAreaInPreviewTab(0, 'Response 1');
|
174
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 2']);
|
175
|
+
});
|
176
|
+
});
|
177
|
+
|
178
|
+
describe('Reuse options - Scoring', () => {
|
179
|
+
abortEarlySetup();
|
180
|
+
before(() => {
|
181
|
+
cy.log('Navigating to List Matching question type');
|
182
|
+
listMatchingPage.steps.navigateToCreateQuestion('list matching');
|
183
|
+
cy.barsPreLoaderWait();
|
184
|
+
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
185
|
+
listMatchingPage.steps.deleteResponseOptionInputField(0);
|
186
|
+
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(0, ['Response 1', 'Response 2']);
|
187
|
+
listMatchingPage.steps.addGroup();
|
188
|
+
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, ['Response 3', 'Response 4']);
|
189
|
+
listMatchingPage.steps.allotPoints(5);
|
190
|
+
listMatchingPage.steps.checkReuseOptionsCheckbox();
|
191
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Response 1', 0);
|
192
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Response 1', 1);
|
193
|
+
listMatchingPage.steps.switchToPreviewTab();
|
194
|
+
});
|
195
|
+
|
196
|
+
it('When the user has set same answer options in the \'Set correct answer\' section, then the user should be awarded full points on attempting the question with reused options', () => {
|
197
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Response 1', 0);
|
198
|
+
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Response 1', 1);
|
199
|
+
listMatchingPage.previewScoreText()
|
200
|
+
.verifyInnerText('5/5');
|
201
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 1', 'Response 2']);
|
202
|
+
listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(1, ['Response 3', 'Response 4']);
|
203
|
+
});
|
204
|
+
});
|
205
|
+
|
206
|
+
describe('Hide drag handle - Functionality: Preview tab', () => {
|
207
|
+
abortEarlySetup();
|
208
|
+
before(() => {
|
209
|
+
cy.log('Navigating to List Matching question type');
|
210
|
+
listMatchingPage.steps.navigateToCreateQuestion('list matching');
|
211
|
+
cy.barsPreLoaderWait();
|
212
|
+
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
213
|
+
});
|
214
|
+
|
215
|
+
it('When the \'Hide drag handle\' functionality is disabled, then the draggable options displayed in response container of the preview tab should have a drag handle', () => {
|
216
|
+
listMatchingPage.steps.switchToPreviewTab();
|
217
|
+
listMatchingPage.steps.verifyDragIconVisibleInOptionsInPreviewTab();
|
218
|
+
});
|
219
|
+
|
220
|
+
it('When the \'Hide drag handle\' functionality is enabled, then the draggable options displayed in response container of the preview tab should not have a drag handle', () => {
|
221
|
+
listMatchingPage.steps.switchToEditTab();
|
222
|
+
listMatchingPage.steps.checkHideDragHandleCheckbox();
|
223
|
+
listMatchingPage.steps.switchToPreviewTab();
|
224
|
+
listMatchingPage.steps.verifyDragIconNotVisibleInOptionsInPreviewTab();
|
225
|
+
});
|
226
|
+
});
|
227
|
+
});
|