itemengine-cypress-automation 1.0.30 → 1.0.31
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesAdditionalSettings.js +963 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesClickAndDrop.js +669 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesEditTabScoringTypes.js +205 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesGroupedOptionsAllOrNothing.js +143 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesGroupedOptionsPartialScoreForEachCell.js +145 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesGroupedOptionsPartialScoreForEachResponse.js +141 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesGroupedOptionsTotalScoreDividedBetweenCell.js +165 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesGroupedOptionsTotalScoreDividedBetweenResponses.js +420 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesGroupedSetCorrectAnswerCheckboxes.js +266 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesHeaderSection.js +83 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesManuallyAndNonScored.js +184 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesResponseOptionsSection.js +112 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesRowsAndCategoriesSection.js +569 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesSetCorrectAnswerSection.js +130 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesStandardAllOrNothing.js +186 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesStandardPartialScoreForEachCell.js +145 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesStandardPartialScoreForEachResponse.js +140 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesStandardSetCorrectAnswerCheckboxes.js +234 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesStandardTotalScoreDividedBetweenCell.js +165 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesStandardTotalScoreDividedBetweenResponse.js +420 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesSwitchingCases.js +45 -0
- package/package.json +1 -1
package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesAdditionalSettings.js
ADDED
@@ -0,0 +1,963 @@
|
|
1
|
+
import { dragAndDropIntoCategoriesPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
const optionsArray = ['Bat', 'Eagle', 'Parrot', 'Whale'];
|
6
|
+
const answerNumerationDropdownOptions = ['Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
|
7
|
+
const numbers = ['1', '2', '3', '4'];
|
8
|
+
const lowercase = ['a', 'b', 'c', 'd'];
|
9
|
+
const uppercase = ['A', 'B', 'C', 'D'];
|
10
|
+
const fontSizeDropdownOptions = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
|
11
|
+
const fontSizes = ['16px', '12px', '14px', '17px', '20px', '24px'];
|
12
|
+
|
13
|
+
describe('Create item page: Drag and drop into categories: Additional settings', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
describe('Additional settings accordion', () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
22
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
23
|
+
});
|
24
|
+
|
25
|
+
dragAndDropIntoCategoriesPage.tests.verifyAdditonalSettingsAccordionProperties();
|
26
|
+
});
|
27
|
+
|
28
|
+
describe('Additional settings: Student response area and layout', () => {
|
29
|
+
abortEarlySetup();
|
30
|
+
before(() => {
|
31
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
32
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
33
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
34
|
+
});
|
35
|
+
|
36
|
+
dragAndDropIntoCategoriesPage.tests.verifyStudentResponseAreaAndLayoutLabelAndCSS();
|
37
|
+
|
38
|
+
//Note: a11y covered in verifyAdditonalSettingsAccordionProperties
|
39
|
+
});
|
40
|
+
|
41
|
+
describe('Additional settings: Response option placement - Contents', () => {
|
42
|
+
abortEarlySetup();
|
43
|
+
before(() => {
|
44
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
45
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
46
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
47
|
+
cy.barsPreLoaderWait();
|
48
|
+
});
|
49
|
+
|
50
|
+
it('\'Response option placement\' label and dropdown should be displayed. By default \'Bottom\' option should be selected in \'Response option placement\'', () => {
|
51
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.responseOptionPlacementLabel(), 'Response option placement');
|
52
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.responseOptionPlacementLabel(), 'visible');
|
53
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.responseOptionPlacementDropdown(), 'Bottom');
|
54
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.responseOptionPlacementDropdown(), 'visible');
|
55
|
+
});
|
56
|
+
|
57
|
+
it('CSS of \'Response option placement\' section', { tags: 'css' }, () => {
|
58
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.responseOptionPlacementDropdown(), {
|
59
|
+
'border': `1px solid ${css.color.secondaryBtnBorder}`,
|
60
|
+
'background-color': css.color.secondaryBtnBg
|
61
|
+
});
|
62
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.responseOptionPlacementDropdown().find('.dropdown-label-text'), {
|
63
|
+
'color': css.color.liText,
|
64
|
+
'font-size': css.fontSize.default,
|
65
|
+
'font-weight': css.fontWeight.regular,
|
66
|
+
});
|
67
|
+
});
|
68
|
+
|
69
|
+
it('When user clicks on \'Response option placement\' dropdown, a list of 4 options should open - Top, Bottom, Left, Right', () => {
|
70
|
+
dragAndDropIntoCategoriesPage.steps.clickOnResponseOptionPlacementDropdown();
|
71
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.responseOptionPlacementDropdownListOption(), 'visible');
|
72
|
+
dragAndDropIntoCategoriesPage.steps.verifyResponseOptionPlacementDropdownOptions();
|
73
|
+
});
|
74
|
+
|
75
|
+
it('CSS of \'Response option placement\' dropdown in active state', { tags: 'css' }, () => {
|
76
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.responseOptionPlacementDropdownListOption().eq(1), {
|
77
|
+
'color': css.color.liText,
|
78
|
+
'font-size': css.fontSize.default,
|
79
|
+
'font-weight': css.fontWeight.regular,
|
80
|
+
'background-color': css.color.liTextSelectedBg
|
81
|
+
});
|
82
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.responseOptionPlacementDropdownListOption().eq(0), {
|
83
|
+
'color': css.color.liText,
|
84
|
+
'font-size': css.fontSize.default,
|
85
|
+
'font-weight': css.fontWeight.regular,
|
86
|
+
'background-color': css.color.transparent
|
87
|
+
});
|
88
|
+
});
|
89
|
+
|
90
|
+
it('Accessibility of \'Response option placement\' dropdown in active state', { tags: 'a11y' }, () => {
|
91
|
+
cy.checkAccessibility(dragAndDropIntoCategoriesPage.dropdownList());
|
92
|
+
});
|
93
|
+
});
|
94
|
+
|
95
|
+
describe('Additional settings: Response option placement - Preview tab', () => {
|
96
|
+
const dropdownOptions = ['Top', 'Bottom', 'Left', 'Right'];
|
97
|
+
abortEarlySetup();
|
98
|
+
before(() => {
|
99
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
100
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
101
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
102
|
+
cy.barsPreLoaderWait();
|
103
|
+
});
|
104
|
+
|
105
|
+
dropdownOptions.forEach((dropdownOption) => {
|
106
|
+
it(`When the user selects ${dropdownOption} from the \'Response option placement\' dropdown, then the response options container should be displayed at the \'${dropdownOption}\' in the question preview`, () => {
|
107
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
108
|
+
dragAndDropIntoCategoriesPage.steps.clickOnResponseOptionPlacementDropdown();
|
109
|
+
dragAndDropIntoCategoriesPage.steps.selectResponseOptionPlacementDropdownOption(dropdownOption);
|
110
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
111
|
+
dragAndDropIntoCategoriesPage.steps.verifyResponseOptionPlacementPreviewTab(dropdownOption);
|
112
|
+
});
|
113
|
+
})
|
114
|
+
});
|
115
|
+
|
116
|
+
describe('Additional settings: \'Answer numeration\' (only while grading) - Contents', () => {
|
117
|
+
abortEarlySetup();
|
118
|
+
before(() => {
|
119
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
120
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
121
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
122
|
+
});
|
123
|
+
|
124
|
+
dragAndDropIntoCategoriesPage.tests.verifyAnswerNumerationContents();
|
125
|
+
});
|
126
|
+
|
127
|
+
describe('Additional settings: \'Answer numeration\' (only while grading) - Set correct answer section', () => {
|
128
|
+
abortEarlySetup();
|
129
|
+
before(() => {
|
130
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
131
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
132
|
+
cy.barsPreLoaderWait();
|
133
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
134
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
135
|
+
});
|
136
|
+
|
137
|
+
it(`When the user selects ${answerNumerationDropdownOptions[0]} option from the \'Answer numeration\' dropdown, then category cell numeration should not be displayed in the \'Set correct answer section\'`, () => {
|
138
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.answerNumerationDropdown(), `${answerNumerationDropdownOptions[0]}`)
|
139
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.categoryCellNumeration(), 'notExist');
|
140
|
+
});
|
141
|
+
|
142
|
+
it(`When the user selects ${answerNumerationDropdownOptions[1]} option from the \'Answer numeration\' dropdown, then category cell numeration should not be displayed in the \'Set correct answer section\'`, () => {
|
143
|
+
dragAndDropIntoCategoriesPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[1]}`);
|
144
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.categoryCellNumeration(), 'notExist');
|
145
|
+
});
|
146
|
+
|
147
|
+
it(`When the user selects ${answerNumerationDropdownOptions[2]} option from the \'Answer numeration\' dropdown, then category cell numeration should not be displayed in the \'Set correct answer section\'`, () => {
|
148
|
+
dragAndDropIntoCategoriesPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[2]}`);
|
149
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.categoryCellNumeration(), 'notExist');
|
150
|
+
});
|
151
|
+
});
|
152
|
+
|
153
|
+
describe('Additional settings: \'Answer numeration\' (only while grading) - Preview tab', () => {
|
154
|
+
abortEarlySetup();
|
155
|
+
before(() => {
|
156
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
157
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
158
|
+
cy.barsPreLoaderWait();
|
159
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
160
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Bat', 0);
|
161
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Eagle', 1);
|
162
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
|
163
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Platypus', 3);
|
164
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints('20');
|
165
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
166
|
+
dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
167
|
+
});
|
168
|
+
|
169
|
+
it(`When the user selects ${answerNumerationDropdownOptions[0]} option from the \'Answer numeration\' dropdown and has not selected show correct answer checkbox or check answer button then category cell numeration should not be displayed in the preview tab`, () => {
|
170
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
171
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.answerNumerationDropdown(), `${answerNumerationDropdownOptions[0]}`)
|
172
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
173
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.categoryCellNumeration(), 'notExist');
|
174
|
+
});
|
175
|
+
|
176
|
+
dragAndDropIntoCategoriesPage.tests.verifyCategoryCellsAndCorrectAnswerContainerNumerationWhenShowCorrectAnswerCheckboxIsChecked(numbers);
|
177
|
+
|
178
|
+
dragAndDropIntoCategoriesPage.tests.verifyCategoryCellsNumerationNotDisplayedWhenCheckAnswerIsSelected(numbers)
|
179
|
+
|
180
|
+
it(`When the user selects ${answerNumerationDropdownOptions[1]} option from the \'Answer numeration\' dropdown and has not selected show correct answer checkbox or check answer button then category cell numeration should not be displayed in the preview tab`, () => {
|
181
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
182
|
+
dragAndDropIntoCategoriesPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[1]}`);
|
183
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
184
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.categoryCellNumeration(), 'notExist');
|
185
|
+
});
|
186
|
+
|
187
|
+
dragAndDropIntoCategoriesPage.tests.verifyCategoryCellsAndCorrectAnswerContainerNumerationWhenShowCorrectAnswerCheckboxIsChecked(uppercase);
|
188
|
+
|
189
|
+
dragAndDropIntoCategoriesPage.tests.verifyCategoryCellsNumerationNotDisplayedWhenCheckAnswerIsSelected(uppercase)
|
190
|
+
|
191
|
+
it(`When the user selects ${answerNumerationDropdownOptions[2]} option from the \'Answer numeration\' dropdown and has not selected show correct answer checkbox or check answer button then category cell numeration should not be displayed in the preview tab`, () => {
|
192
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
193
|
+
dragAndDropIntoCategoriesPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[2]}`);
|
194
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
195
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.categoryCellNumeration(), 'notExist');
|
196
|
+
});
|
197
|
+
|
198
|
+
dragAndDropIntoCategoriesPage.tests.verifyCategoryCellsAndCorrectAnswerContainerNumerationWhenShowCorrectAnswerCheckboxIsChecked(lowercase);
|
199
|
+
|
200
|
+
dragAndDropIntoCategoriesPage.tests.verifyCategoryCellsNumerationNotDisplayedWhenCheckAnswerIsSelected(lowercase)
|
201
|
+
});
|
202
|
+
|
203
|
+
describe('Additional settings: \'Row title width (px)\' - Contents', () => {
|
204
|
+
abortEarlySetup();
|
205
|
+
before(() => {
|
206
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
207
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
208
|
+
cy.barsPreLoaderWait();
|
209
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowInputField(0, 'Can fly');
|
210
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
211
|
+
});
|
212
|
+
|
213
|
+
it('\'Row title width (px)\' label and input field should be displayed. By default, the \'Row title width\' input field should be empty', () => {
|
214
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.rowTitleWidthLabel(), 'Row title width (px)');
|
215
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowTitleWidthLabel(), 'visible');
|
216
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowTitleWidthInputField(), 'visible');
|
217
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthInputFieldValue('');
|
218
|
+
});
|
219
|
+
|
220
|
+
it('CSS of \'Row title width (px)\' contents', { tags: 'css' }, () => {
|
221
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.rowTitleWidthLabel(), {
|
222
|
+
'color': css.color.labels,
|
223
|
+
'font-size': css.fontSize.normal,
|
224
|
+
'font-weight': css.fontWeight.semibold
|
225
|
+
});
|
226
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.rowTitleWidthInputField(), {
|
227
|
+
'color': css.color.text,
|
228
|
+
'font-size': css.fontSize.default,
|
229
|
+
'font-weight': css.fontWeight.regular
|
230
|
+
});
|
231
|
+
});
|
232
|
+
|
233
|
+
//Note: a11y covered in verifyAdditonalSettingsAccordionProperties
|
234
|
+
|
235
|
+
it('The user should only be able to enter only numeric value in the \'Row title width\' input field', () => {
|
236
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowTitleWidthInputField();
|
237
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowTitleWidthInputField('a!1b#c4d0');
|
238
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthInputFieldValue(140);
|
239
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthSetCorrectAnswerSection(140);
|
240
|
+
});
|
241
|
+
});
|
242
|
+
|
243
|
+
//https://redmine.zeuslearning.com/issues/547937
|
244
|
+
describe('Additional settings: \'Row title width (px)\' - Set correct answer section', () => {
|
245
|
+
abortEarlySetup();
|
246
|
+
before(() => {
|
247
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
248
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
249
|
+
cy.barsPreLoaderWait();
|
250
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
251
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints('20');
|
252
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
253
|
+
dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
254
|
+
});
|
255
|
+
|
256
|
+
it('When the user has not set any value in the \'Row title width\' input field, the width of the row title should be 64px by default', () => {
|
257
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthSetCorrectAnswerSection(64);
|
258
|
+
});
|
259
|
+
|
260
|
+
it('When the user enters a numeric value in the \'Row title width\' input field, the row title width should get updated accordingly', () => {
|
261
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowTitleWidthInputField(100);
|
262
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthInputFieldValue(100);
|
263
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthSetCorrectAnswerSection(100);
|
264
|
+
});
|
265
|
+
|
266
|
+
it('When the users adds a value greater than 400, the entered value should automatically update to 400 and the row title width should change to 400px', () => {
|
267
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowTitleWidthInputField();
|
268
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowTitleWidthInputField(500);
|
269
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthInputFieldValue(400);
|
270
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthSetCorrectAnswerSection(400);
|
271
|
+
});
|
272
|
+
|
273
|
+
it('When user clears the \'Row title width\' input field, the row title width should change back to the default value', () => {
|
274
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowTitleWidthInputField();
|
275
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthSetCorrectAnswerSection(64);
|
276
|
+
});
|
277
|
+
|
278
|
+
it('When the users adds a value less than 64, the entered value should automatically update to 64 and the row title width should change to 64px', () => {
|
279
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowTitleWidthInputField();
|
280
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowTitleWidthInputField(50);
|
281
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthInputFieldValue(64);
|
282
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthSetCorrectAnswerSection(64);
|
283
|
+
});
|
284
|
+
});
|
285
|
+
|
286
|
+
describe('Additional settings: \'Row title width (px)\' - Preview tab', () => {
|
287
|
+
abortEarlySetup();
|
288
|
+
before(() => {
|
289
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
290
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
291
|
+
cy.barsPreLoaderWait();
|
292
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
293
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints('20');
|
294
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
295
|
+
dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
296
|
+
});
|
297
|
+
|
298
|
+
it('When the user has not set any value in the \'Row title width\' input field, the width of the row title should be 64px by default in the preview tab', () => {
|
299
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
300
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthPreviewTab(64);
|
301
|
+
});
|
302
|
+
|
303
|
+
it('When the user enters a numeric value in the \'Row title width\' input field, the row title width should get updated accordingly in the preview tab', () => {
|
304
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
305
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowTitleWidthInputField(100);
|
306
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthInputFieldValue(100);
|
307
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
308
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthPreviewTab(100);
|
309
|
+
});
|
310
|
+
|
311
|
+
it('When user clears the \'Row title width\' input field, the row title width should change back to the default value in the preview tab', () => {
|
312
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
313
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowTitleWidthInputField();
|
314
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
315
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthPreviewTab(64);
|
316
|
+
});
|
317
|
+
|
318
|
+
it('When the users adds a value greater than 400, the entered value should automatically update to 400 and the row title width should change to 400px in the preview tab', () => {
|
319
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
320
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowTitleWidthInputField();
|
321
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowTitleWidthInputField(500);
|
322
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthInputFieldValue(400);
|
323
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
324
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthPreviewTab(400);
|
325
|
+
});
|
326
|
+
|
327
|
+
it('When the users adds a value less than 64, the entered value should automatically update to 64 and the row title width should change to 64px in the preview tab', () => {
|
328
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
329
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowTitleWidthInputField();
|
330
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowTitleWidthInputField(50);
|
331
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthInputFieldValue(64);
|
332
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
333
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowTitleWidthPreviewTab(64);
|
334
|
+
});
|
335
|
+
});
|
336
|
+
|
337
|
+
describe('Additional settings: \'Row minimum height (px)\' - Contents', () => {
|
338
|
+
abortEarlySetup();
|
339
|
+
before(() => {
|
340
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
341
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
342
|
+
cy.barsPreLoaderWait();
|
343
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
344
|
+
});
|
345
|
+
|
346
|
+
it('\'Row minimum height (px)\' label and input field should be displayed. By default, the \'Row minimum height\' input field should be empty', () => {
|
347
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.rowMinHeightLabel(), 'Row minimum height (px)');
|
348
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowMinHeightLabel(), 'visible');
|
349
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowMinHeightInputField(), 'visible');
|
350
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightInputFieldValue('');
|
351
|
+
});
|
352
|
+
|
353
|
+
it('CSS of \'Row minimum height (px)\' contents', { tags: 'css' }, () => {
|
354
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.rowMinHeightLabel(), {
|
355
|
+
'color': css.color.labels,
|
356
|
+
'font-size': css.fontSize.normal,
|
357
|
+
'font-weight': css.fontWeight.semibold
|
358
|
+
});
|
359
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.rowMinHeightInputField(), {
|
360
|
+
'color': css.color.text,
|
361
|
+
'font-size': css.fontSize.default,
|
362
|
+
'font-weight': css.fontWeight.regular
|
363
|
+
});
|
364
|
+
});
|
365
|
+
|
366
|
+
//Note: a11y covered in verifyAdditonalSettingsAccordionProperties
|
367
|
+
|
368
|
+
it('The user should only be able to enter only numeric value in the \'Row minimum height\' input field', () => {
|
369
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowMinHeightInputField();
|
370
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowMinHeightInputField('a!1b#c4d0');
|
371
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightInputFieldValue(140);
|
372
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightSetCorrectAnswerSection(140);
|
373
|
+
});
|
374
|
+
});
|
375
|
+
|
376
|
+
describe('Additional settings: \'Row minimum height (px)\' - Set correct answer section', () => {
|
377
|
+
abortEarlySetup();
|
378
|
+
before(() => {
|
379
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
380
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
381
|
+
cy.barsPreLoaderWait();
|
382
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
383
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints('20');
|
384
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
385
|
+
});
|
386
|
+
|
387
|
+
it('\'Row minimum height (px)\' label and input field should be displayed. By default, the \'Row minimum height\' input field should be empty', () => {
|
388
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.rowMinHeightLabel(), 'Row minimum height (px)');
|
389
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowMinHeightLabel(), 'visible');
|
390
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowMinHeightInputField(), 'visible');
|
391
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightInputFieldValue('');
|
392
|
+
});
|
393
|
+
|
394
|
+
it('When the user has not set any value in the \'Row minimum height\' input field, the minimum row height should be 100px by default', () => {
|
395
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightSetCorrectAnswerSection(100);
|
396
|
+
});
|
397
|
+
|
398
|
+
it('When the user enters a numeric value in the \'Row minimum height\' input field, the minimum row height should get updated accordingly', () => {
|
399
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowMinHeightInputField(200);
|
400
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightInputFieldValue(200);
|
401
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightSetCorrectAnswerSection(200);
|
402
|
+
});
|
403
|
+
|
404
|
+
it('When user clears the \'Row minimum height\' input field, the minimum row height should change back to the default value', () => {
|
405
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowMinHeightInputField();
|
406
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightSetCorrectAnswerSection(100);
|
407
|
+
});
|
408
|
+
|
409
|
+
it('When the users adds a value greater than 400, the entered value should automatically update to 400 and the minimum row height should change to 400px', () => {
|
410
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowMinHeightInputField();
|
411
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowMinHeightInputField(500);
|
412
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightInputFieldValue(400);
|
413
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightSetCorrectAnswerSection(400);
|
414
|
+
});
|
415
|
+
|
416
|
+
it('When the users adds a value less than 50, the entered value should automatically update to 50 and the minimum row height should change to 50px', () => {
|
417
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowMinHeightInputField();
|
418
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowMinHeightInputField(40);
|
419
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightInputFieldValue(50);
|
420
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightSetCorrectAnswerSection(50);
|
421
|
+
});
|
422
|
+
});
|
423
|
+
|
424
|
+
describe('Additional settings: \'Row minimum height (px)\' - Preview tab', () => {
|
425
|
+
abortEarlySetup();
|
426
|
+
before(() => {
|
427
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
428
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
429
|
+
cy.barsPreLoaderWait();
|
430
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
431
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints('20');
|
432
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
433
|
+
});
|
434
|
+
|
435
|
+
it('When the user has not set any value in the \'Row minimum height\' input field, the minimum row height should be 100px by default in the preview tab', () => {
|
436
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
437
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightPreviewTab(100);
|
438
|
+
});
|
439
|
+
|
440
|
+
it('When the user enters a numeric value in the \'Row minimum height\' input field, the minimum row height should get updated accordingly in the preview tab', () => {
|
441
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
442
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowMinHeightInputField(200);
|
443
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
444
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightPreviewTab(200);
|
445
|
+
});
|
446
|
+
|
447
|
+
it('When user clears the \'Row minimum height\' input field, the minimum row height should change back to the default value in the preview tab', () => {
|
448
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
449
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowMinHeightInputField();
|
450
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
451
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightPreviewTab(100);
|
452
|
+
});
|
453
|
+
|
454
|
+
it('When the users adds a value greater than 400, the entered value should automatically update to 400 and the minimum row height should change to 400px in the preview tab', () => {
|
455
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
456
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowMinHeightInputField();
|
457
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowMinHeightInputField(500);
|
458
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightInputFieldValue(400);
|
459
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
460
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightPreviewTab(400);
|
461
|
+
});
|
462
|
+
|
463
|
+
it('When the users adds a value less than 50, the entered value should automatically update to 50 and the minimum row height should change to 50px in the preview tab', () => {
|
464
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
465
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowMinHeightInputField();
|
466
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowMinHeightInputField(40);
|
467
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightInputFieldValue(50);
|
468
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
469
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowMinHeightPreviewTab(50);
|
470
|
+
});
|
471
|
+
});
|
472
|
+
|
473
|
+
describe('Additional settings: \'Row heading\' - Contents', () => {
|
474
|
+
abortEarlySetup();
|
475
|
+
before(() => {
|
476
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
477
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
478
|
+
cy.barsPreLoaderWait();
|
479
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
480
|
+
});
|
481
|
+
|
482
|
+
it('\'Row heading\' label and input field should be displayed. By default, the \'Row heading\' input field should be empty', () => {
|
483
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.rowHeadingLabel(), 'Row heading');
|
484
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowHeadingLabel(), 'visible');
|
485
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowHeadingInputField(), 'visible');
|
486
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowHeadingInputFieldValue('');
|
487
|
+
});
|
488
|
+
|
489
|
+
it('CSS of \'Row heading\' contents', { tags: 'css' }, () => {
|
490
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.rowHeadingLabel(), {
|
491
|
+
'color': css.color.labels,
|
492
|
+
'font-size': css.fontSize.normal,
|
493
|
+
'font-weight': css.fontWeight.semibold
|
494
|
+
});
|
495
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.rowHeadingInputField(), {
|
496
|
+
'color': css.color.text,
|
497
|
+
'font-size': css.fontSize.default,
|
498
|
+
'font-weight': css.fontWeight.regular
|
499
|
+
});
|
500
|
+
});
|
501
|
+
|
502
|
+
//Note: a11y covered in verifyAdditonalSettingsAccordionProperties
|
503
|
+
});
|
504
|
+
|
505
|
+
describe('Additional settings: \'Row heading\' - Set correct answer section', () => {
|
506
|
+
abortEarlySetup();
|
507
|
+
before(() => {
|
508
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
509
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
510
|
+
cy.barsPreLoaderWait();
|
511
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
512
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints('20');
|
513
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
514
|
+
dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
515
|
+
});
|
516
|
+
|
517
|
+
it('When the user has not entered any value in the \'Row heading\' input field, Row heading should not be displayed', () => {
|
518
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowHeadingSetCorrectAnswerSection(), 'notExist');
|
519
|
+
});
|
520
|
+
|
521
|
+
it('When the user enters text in the \'Row heading\' input field, a Row heading should be displayed', () => {
|
522
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowHeadingInputField('Row heading');
|
523
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.rowHeadingSetCorrectAnswerSection(), 'Row heading');
|
524
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowHeadingSetCorrectAnswerSection(), 'visible');
|
525
|
+
});
|
526
|
+
|
527
|
+
it('When user clears the \'Row heading\' input field, the Row heading should disappear', () => {
|
528
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowHeadingInputField();
|
529
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowHeadingSetCorrectAnswerSection(), 'notExist');
|
530
|
+
});
|
531
|
+
});
|
532
|
+
|
533
|
+
describe('Additional settings: \'Row heading\' - Preview tab', () => {
|
534
|
+
abortEarlySetup();
|
535
|
+
before(() => {
|
536
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
537
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
538
|
+
cy.barsPreLoaderWait();
|
539
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
540
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints('20');
|
541
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
542
|
+
dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
543
|
+
});
|
544
|
+
|
545
|
+
it('When the user has not entered any value in the \'Row heading\' input field, Row heading should not be displayed in the preview tab', () => {
|
546
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowHeadingPreviewTab(), 'notExist');
|
547
|
+
});
|
548
|
+
|
549
|
+
it('When the user enters text in the \'Row heading\' input field, a Row heading should be displayed in the preview tab', () => {
|
550
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
551
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowHeadingInputField('Row heading');
|
552
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
553
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.rowHeadingPreviewTab(), 'Row heading');
|
554
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowHeadingPreviewTab(), 'visible');
|
555
|
+
});
|
556
|
+
|
557
|
+
it('When user clears the \'Row heading\' input field, the Row heading should disappear from the preview tab', () => {
|
558
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
559
|
+
dragAndDropIntoCategoriesPage.steps.clearTextInRowHeadingInputField();
|
560
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
561
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rowHeadingPreviewTab(), 'notExist');
|
562
|
+
});
|
563
|
+
});
|
564
|
+
|
565
|
+
describe('Additional settings: \'Maximum responses per cell\' - Contents', () => {
|
566
|
+
abortEarlySetup();
|
567
|
+
before(() => {
|
568
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
569
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
570
|
+
cy.barsPreLoaderWait();
|
571
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
572
|
+
});
|
573
|
+
|
574
|
+
it('\'Maximum responses per cell\' label and input field should be displayed. By default, the \'Maximum responses per cell\' input field should be empty', () => {
|
575
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.maxResponsePerCellLabel(), 'Maximum responses per cell');
|
576
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.maxResponsePerCellLabel(), 'visible');
|
577
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.maxResponsePerCellInputField(), 'visible');
|
578
|
+
dragAndDropIntoCategoriesPage.steps.verifyMaxResponsePerCellInputFieldValue('');
|
579
|
+
});
|
580
|
+
|
581
|
+
it('CSS of \'Maximum responses per cell\' contents', { tags: 'css' }, () => {
|
582
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.maxResponsePerCellLabel(), {
|
583
|
+
'color': css.color.labels,
|
584
|
+
'font-size': css.fontSize.normal,
|
585
|
+
'font-weight': css.fontWeight.semibold
|
586
|
+
});
|
587
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.maxResponsePerCellInputField(), {
|
588
|
+
'color': css.color.text,
|
589
|
+
'font-size': css.fontSize.default,
|
590
|
+
'font-weight': css.fontWeight.regular
|
591
|
+
});
|
592
|
+
});
|
593
|
+
});
|
594
|
+
|
595
|
+
describe('Additional settings: \'Maximum responses per cell\' - Set correct answer section', () => {
|
596
|
+
abortEarlySetup();
|
597
|
+
before(() => {
|
598
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
599
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
600
|
+
cy.barsPreLoaderWait();
|
601
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
602
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints('20');
|
603
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
604
|
+
dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
605
|
+
});
|
606
|
+
|
607
|
+
it('When the user has not entered any value in the \'Maximum response per cell\' input field, the user should be able to set any number of options in a category cell', () => {
|
608
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Bat', 0);
|
609
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Eagle', 0);
|
610
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 0);
|
611
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Platypus', 0);
|
612
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionInCategoryCellOfSetCorrectAnswerSection(0, ['Bat', 'Eagle', 'Whale', 'Platypus']);
|
613
|
+
});
|
614
|
+
|
615
|
+
it('When the user sets a value in the \'Maximum response per cell\' input field, the user should be able to set only the specified number of options in a category cell, the additional options from the previously filled category cells should be automatically removed', () => {
|
616
|
+
dragAndDropIntoCategoriesPage.steps.setMaxResponsePerCell('2');
|
617
|
+
dragAndDropIntoCategoriesPage.steps.verifyMaxResponsePerCellInputFieldValue('2');
|
618
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Falcon', 1);
|
619
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Peacock', 1);
|
620
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Ostrich', 1);
|
621
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionInCategoryCellOfSetCorrectAnswerSection(1, ['Falcon', 'Peacock']);
|
622
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionInCategoryCellOfSetCorrectAnswerSection(0, ['Bat', 'Eagle']);
|
623
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableResponsesSetCorrectAnswer('drag and drop into categories', ['Platypus', 'Ostrich', 'Whale', 'Parrot', 'Flying squirrel']);
|
624
|
+
});
|
625
|
+
|
626
|
+
it('When user clears the \'Maximum response per cell\' input field, the user should be able to set any number of options in a category cell ', () => {
|
627
|
+
dragAndDropIntoCategoriesPage.steps.clearMaxResponsePerCellInputField();
|
628
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Parrot', 2);
|
629
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Platypus', 2);
|
630
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
|
631
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionInCategoryCellOfSetCorrectAnswerSection(2, ['Parrot', 'Platypus', 'Whale']);
|
632
|
+
});
|
633
|
+
|
634
|
+
it('The user should only be able to enter only numeric values in the \'Maximum response per cell\' input field', () => {
|
635
|
+
dragAndDropIntoCategoriesPage.steps.setMaxResponsePerCell('a!1b#c4d');
|
636
|
+
dragAndDropIntoCategoriesPage.steps.verifyMaxResponsePerCellInputFieldValue('14');
|
637
|
+
});
|
638
|
+
});
|
639
|
+
|
640
|
+
describe('Additional settings: \'Maximum responses per cell\' - Preview tab', () => {
|
641
|
+
abortEarlySetup();
|
642
|
+
before(() => {
|
643
|
+
cy.log('Navigate to Drag and drop into categories question type');
|
644
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
645
|
+
cy.barsPreLoaderWait();
|
646
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
647
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints('20');
|
648
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
649
|
+
dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
650
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
651
|
+
});
|
652
|
+
|
653
|
+
it('When the user has not entered any value in the \'Maximum response per cell\' input field, the user should be able to attempt with any number of options in a category cell in the preview tab', () => {
|
654
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
|
655
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Eagle', 0);
|
656
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Whale', 0);
|
657
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Platypus', 0);
|
658
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionInCategoryCellOfPreviewTab(0, ['Bat', 'Eagle', 'Whale', 'Platypus']);
|
659
|
+
});
|
660
|
+
|
661
|
+
it('When the user sets a value in the \'Maximum response per cell\' input field, the user should be able to attempt with only the specified number of options in a category cell in the preview tab', () => {
|
662
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
663
|
+
dragAndDropIntoCategoriesPage.steps.setMaxResponsePerCell('2');
|
664
|
+
dragAndDropIntoCategoriesPage.steps.verifyMaxResponsePerCellInputFieldValue('2');
|
665
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
666
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Falcon', 1);
|
667
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Peacock', 1);
|
668
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Ostrich', 1);
|
669
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionInCategoryCellOfPreviewTab(1, ['Falcon', 'Peacock']);
|
670
|
+
});
|
671
|
+
|
672
|
+
it('When user clears the \'Maximum response per cell\' input field, the user should be able to attempt with any number of options in a category cell in the preview tab ', () => {
|
673
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
674
|
+
dragAndDropIntoCategoriesPage.steps.clearMaxResponsePerCellInputField();
|
675
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
676
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Falcon', 1);
|
677
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Peacock', 1);
|
678
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Ostrich', 1);
|
679
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionInCategoryCellOfPreviewTab(1, ['Falcon', 'Peacock', 'Ostrich']);
|
680
|
+
});
|
681
|
+
});
|
682
|
+
|
683
|
+
describe('Additional settings: Font size - Contents', () => {
|
684
|
+
abortEarlySetup();
|
685
|
+
before(() => {
|
686
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
687
|
+
cy.barsPreLoaderWait();
|
688
|
+
dragAndDropIntoCategoriesPage.steps.addOption();
|
689
|
+
dragAndDropIntoCategoriesPage.steps.addOption();
|
690
|
+
dragAndDropIntoCategoriesPage.steps.addInputToOptionsForDragAndDropFields(optionsArray);
|
691
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints(20);
|
692
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Bat', 0);
|
693
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Eagle', 1);
|
694
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
|
695
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Platypus', 3);
|
696
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
697
|
+
});
|
698
|
+
|
699
|
+
dragAndDropIntoCategoriesPage.tests.verifyFontSizeSectionContents();
|
700
|
+
});
|
701
|
+
|
702
|
+
//Note: Will need to work on the font size describes after https://redmine.zeuslearning.com/issues/543473 gets resolved
|
703
|
+
describe('Additional settings: Font size - Set correct answer section', () => {
|
704
|
+
abortEarlySetup();
|
705
|
+
before(() => {
|
706
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
707
|
+
cy.barsPreLoaderWait();
|
708
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
709
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints(20);
|
710
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Bat', 0);
|
711
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Eagle', 1);
|
712
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
|
713
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Platypus', 3);
|
714
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
715
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInRowHeadingInputField('Row heading');
|
716
|
+
});
|
717
|
+
|
718
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
719
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the set correct answer section (options, labels) should be changed to ${option}`, () => {
|
720
|
+
dragAndDropIntoCategoriesPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
|
721
|
+
dragAndDropIntoCategoriesPage.fontSizeDropdown()
|
722
|
+
.verifyInnerText(`${option}`);
|
723
|
+
dragAndDropIntoCategoriesPage.setCorrectAnswerDraggableOptionsWrapper('drag and drop into categories')
|
724
|
+
.within(() => {
|
725
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.draggableOption(), {
|
726
|
+
'font-size': fontSizes[fontsIndex]
|
727
|
+
});
|
728
|
+
});
|
729
|
+
dragAndDropIntoCategoriesPage.setCorrectAnswerSectionCategoryGrid()
|
730
|
+
.within(() => {
|
731
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.draggableOption(), {
|
732
|
+
'font-size': fontSizes[fontsIndex]
|
733
|
+
});
|
734
|
+
});
|
735
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.setCorrectAnswerSectionCategoryTitle(), {
|
736
|
+
'font-size': fontSizes[fontsIndex]
|
737
|
+
});
|
738
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.setCorrectAnswerSectionRowTitle(), {
|
739
|
+
'font-size': fontSizes[fontsIndex]
|
740
|
+
});
|
741
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.rowHeadingSetCorrectAnswerSection(), {
|
742
|
+
'font-size': fontSizes[fontsIndex]
|
743
|
+
});
|
744
|
+
});
|
745
|
+
});
|
746
|
+
});
|
747
|
+
|
748
|
+
describe('Additional settings: Font size - Preview tab', () => {
|
749
|
+
abortEarlySetup();
|
750
|
+
before(() => {
|
751
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
752
|
+
cy.barsPreLoaderWait();
|
753
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
754
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints(20);
|
755
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Bat', 0);
|
756
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Eagle', 1);
|
757
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
|
758
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Platypus', 3);
|
759
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
760
|
+
});
|
761
|
+
|
762
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
763
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview (options, question instructions question stems) should be changed to ${option} in the preview tab Answer table`, () => {
|
764
|
+
dragAndDropIntoCategoriesPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
|
765
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.fontSizeDropdown(), `${option}`);
|
766
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
767
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.questionInstructionsText(), {
|
768
|
+
'font-size': fontSizes[fontsIndex]
|
769
|
+
});
|
770
|
+
dragAndDropIntoCategoriesPage.previewTabDraggableOptionsWrapper('drag and drop into categories')
|
771
|
+
.within(() => {
|
772
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.draggableOption(), {
|
773
|
+
'font-size': fontSizes[fontsIndex]
|
774
|
+
});
|
775
|
+
});
|
776
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
|
777
|
+
dragAndDropIntoCategoriesPage.previewTabCategoryGrid()
|
778
|
+
.within(() => {
|
779
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.draggableOption(), {
|
780
|
+
'font-size': fontSizes[fontsIndex]
|
781
|
+
});
|
782
|
+
});
|
783
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.previewTabCategoryTitle(), {
|
784
|
+
'font-size': fontSizes[fontsIndex]
|
785
|
+
});
|
786
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.previewTabRowTitle(), {
|
787
|
+
'font-size': fontSizes[fontsIndex]
|
788
|
+
});
|
789
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.rowHeadingPreviewTab(), {
|
790
|
+
'font-size': fontSizes[fontsIndex]
|
791
|
+
});
|
792
|
+
cy.log('Font size of answer numeration and correct answer container when show correct answer is checked')
|
793
|
+
dragAndDropIntoCategoriesPage.steps.checkShowCorrectAnswerCheckbox();
|
794
|
+
dragAndDropIntoCategoriesPage.previewTabCategoryGrid()
|
795
|
+
.within(() => {
|
796
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.categoryCellNumeration(), {
|
797
|
+
'font-size': fontSizes[fontsIndex]
|
798
|
+
});
|
799
|
+
});
|
800
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.correctAnswerLabel(), {
|
801
|
+
'font-size': fontSizes[fontsIndex]
|
802
|
+
});
|
803
|
+
dragAndDropIntoCategoriesPage.correctAnswerContainer()
|
804
|
+
.within(() => {
|
805
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.categoryCellNumeration(), {
|
806
|
+
'font-size': fontSizes[fontsIndex]
|
807
|
+
});
|
808
|
+
});
|
809
|
+
dragAndDropIntoCategoriesPage.correctAnswerContainer()
|
810
|
+
.within(() => {
|
811
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.correctAnswerOption(), {
|
812
|
+
'font-size': fontSizes[fontsIndex]
|
813
|
+
});
|
814
|
+
});
|
815
|
+
cy.log('Uncheck show correct answer checkbox')
|
816
|
+
dragAndDropIntoCategoriesPage.steps.uncheckShowCorrectAnswerCheckbox()
|
817
|
+
cy.log('Font size of answer numeration when check answer is selected')
|
818
|
+
dragAndDropIntoCategoriesPage.steps.checkAnswer()
|
819
|
+
dragAndDropIntoCategoriesPage.previewTabCategoryGrid()
|
820
|
+
.within(() => {
|
821
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.categoryCellNumeration(), {
|
822
|
+
'font-size': fontSizes[fontsIndex]
|
823
|
+
});
|
824
|
+
});
|
825
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
826
|
+
});
|
827
|
+
});
|
828
|
+
});
|
829
|
+
|
830
|
+
describe('Additional settings: Check answer', () => {
|
831
|
+
abortEarlySetup();
|
832
|
+
before(() => {
|
833
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
834
|
+
cy.barsPreLoaderWait();
|
835
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
836
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints(20);
|
837
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Bat', 0);
|
838
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Eagle', 1);
|
839
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
|
840
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Platypus', 3);
|
841
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
842
|
+
});
|
843
|
+
|
844
|
+
dragAndDropIntoCategoriesPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
|
845
|
+
});
|
846
|
+
|
847
|
+
describe('Additional settings: Check answer - Functionality', () => {
|
848
|
+
abortEarlySetup();
|
849
|
+
before(() => {
|
850
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
851
|
+
cy.barsPreLoaderWait();
|
852
|
+
dragAndDropIntoCategoriesPage.steps.setQuestion();
|
853
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints(20);
|
854
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Bat', 0);
|
855
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Eagle', 1);
|
856
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
|
857
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Platypus', 3);
|
858
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
859
|
+
dragAndDropIntoCategoriesPage.steps.setMaximumCheckAnswerAttempts(2);
|
860
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
861
|
+
});
|
862
|
+
|
863
|
+
dragAndDropIntoCategoriesPage.tests.verifyCheckAnswerButtonFunctionalityWhenQuestionIsUnattempted();
|
864
|
+
|
865
|
+
it('When the user attempts the question partially correct, then on clicking on the \'Check answer\' button, green check-mark icon should be displayed besides the correct response, red cross-mark should be displayed besides incorrect response and \'Incorrect answer\' label should be displayed below the question preview', () => {
|
866
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
|
867
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Eagle', 1);
|
868
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Whale', 3);
|
869
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Platypus', 2);
|
870
|
+
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
871
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
872
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
|
873
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
|
874
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
|
875
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectAttemptBorder();
|
876
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
877
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotVisible();
|
878
|
+
cy.log('Dropping the options back to the options container')
|
879
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Whale');
|
880
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Platypus');
|
881
|
+
});
|
882
|
+
|
883
|
+
it('When the user attempts the question correctly, then on clicking on the \'Check answer\' button, green check-mark icon should be displayed besides the correct response and \'Correct answer\' label should be displayed below the question preview', () => {
|
884
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Whale', 2);
|
885
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Platypus', 3);
|
886
|
+
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
887
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
888
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
|
889
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(2);
|
890
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(3);
|
891
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAttemptBorder();
|
892
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
893
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotVisible();
|
894
|
+
});
|
895
|
+
|
896
|
+
dragAndDropIntoCategoriesPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y();
|
897
|
+
|
898
|
+
it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
|
899
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
900
|
+
dragAndDropIntoCategoriesPage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
901
|
+
dragAndDropIntoCategoriesPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(1);
|
902
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
903
|
+
dragAndDropIntoCategoriesPage.steps.verifyCheckAnswerButtonEnabled();
|
904
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
|
905
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Eagle', 1);
|
906
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Whale', 3);
|
907
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Platypus', 2);
|
908
|
+
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
909
|
+
dragAndDropIntoCategoriesPage.steps.verifyCheckAnswerButtonDisabled();
|
910
|
+
});
|
911
|
+
|
912
|
+
it('When the \'Maximum check answer attempts\' input field has value \'0\' and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
|
913
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
914
|
+
dragAndDropIntoCategoriesPage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
915
|
+
dragAndDropIntoCategoriesPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
|
916
|
+
cy.log('Switching to Preview tab')
|
917
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
918
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
|
919
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Eagle', 1);
|
920
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Whale', 3);
|
921
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Platypus', 2);
|
922
|
+
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
923
|
+
dragAndDropIntoCategoriesPage.steps.verifyCheckAnswerButtonEnabled();
|
924
|
+
cy.log('Dropping the options back to the options container')
|
925
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Whale');
|
926
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Platypus');
|
927
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Whale', 2);
|
928
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Platypus', 3);
|
929
|
+
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
930
|
+
dragAndDropIntoCategoriesPage.steps.verifyCheckAnswerButtonEnabled();
|
931
|
+
});
|
932
|
+
|
933
|
+
it('When the \'Maximum check answer attempts\' input field is empty and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
|
934
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
935
|
+
dragAndDropIntoCategoriesPage.steps.clearMaximumCheckAnswerAttemptsInputField()
|
936
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
937
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
|
938
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Eagle', 1);
|
939
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Whale', 3);
|
940
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Platypus', 2);
|
941
|
+
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
942
|
+
dragAndDropIntoCategoriesPage.steps.verifyCheckAnswerButtonEnabled();
|
943
|
+
cy.log('Dropping the options back to the options container')
|
944
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Whale');
|
945
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Platypus');
|
946
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Whale', 2);
|
947
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Platypus', 3);
|
948
|
+
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
949
|
+
dragAndDropIntoCategoriesPage.steps.verifyCheckAnswerButtonEnabled();
|
950
|
+
});
|
951
|
+
});
|
952
|
+
|
953
|
+
describe('Additional settings: Details section', () => {
|
954
|
+
abortEarlySetup();
|
955
|
+
before(() => {
|
956
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
957
|
+
cy.barsPreLoaderWait();
|
958
|
+
dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
|
959
|
+
});
|
960
|
+
|
961
|
+
dragAndDropIntoCategoriesPage.tests.verifyDetailsSection();
|
962
|
+
});
|
963
|
+
});
|