itemengine-cypress-automation 1.0.31 → 1.0.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAdditionalSettings.js +1 -415
  2. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAdditionalSettingsBasic.js +423 -0
  3. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAllOrNothingScoring.js +48 -0
  4. package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownAutoScoredScoring.js → fillInTheGapsDropdownAllOrNothingScoringWithAlternateAnswer.js} +1 -37
  5. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialDifferentWeights.js +59 -0
  6. package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownScoringPartialDifferentWeights.js → fillInTheGapsDropdownPartialDifferentWeightsWithAlternateAnswer.js} +1 -47
  7. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialEqualWeights.js +1 -63
  8. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialEqualWeightsWithAlternateAnswer.js +73 -0
  9. package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsAnswerNumerationAndResponseOptionPlacement.js +196 -0
  10. package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsBasic.js +210 -0
  11. package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsStemAndResponseColumnHeader.js +206 -0
  12. package/cypress/e2e/ILC/ListMatching/listMatchingAlternateAnswer.js +193 -0
  13. package/cypress/e2e/ILC/ListMatching/listMatchingClickAndDrop.js +644 -0
  14. package/cypress/e2e/ILC/ListMatching/listMatchingEditTabScoringTypes.js +105 -0
  15. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsAllOrNothingScoring.js +117 -0
  16. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsAllOrNothingScoringWithAlternateAnswer.js +30 -0
  17. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsManualAndNonScoredScoring.js +49 -0
  18. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialDifferentScoringWithAlternateTab.js +36 -0
  19. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialDifferentScorings.js +49 -0
  20. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialEqualWeightsScoring.js +48 -0
  21. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialEqualWeightsScoringWithAlternateTab.js +36 -0
  22. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.js +207 -0
  23. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesEditTab.js +139 -0
  24. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesPreviewTab.js +227 -0
  25. package/cypress/e2e/ILC/ListMatching/listMatchingHeaderSection.js +95 -0
  26. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.js +246 -0
  27. package/cypress/e2e/ILC/ListMatching/listMatchingScoringSectionBasic.js +21 -0
  28. package/cypress/e2e/ILC/ListMatching/listMatchingSetCorrectAnswerSectionBasic.js +40 -0
  29. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsAllOrNothingScoring.js +113 -0
  30. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsAllOrNothingScoringWithAlternateAnswer.js +30 -0
  31. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsManualAndNonScoredScoring.js +48 -0
  32. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialDIfferentScoring.js +49 -0
  33. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialDifferentScoringWithAlternateAnswer.js +36 -0
  34. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialEqualScoring.js +48 -0
  35. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialEqualScoringWithAlternateAnswer.js +35 -0
  36. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSection.js +233 -0
  37. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesEditTab.js +113 -0
  38. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.js +185 -0
  39. package/cypress/e2e/ILC/ListMatching/listMatchingSwitchingCases.js +47 -0
  40. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsAnswerNumerationAndOptionLabel.js +295 -0
  41. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsBasic.js +300 -0
  42. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsOptionStyleDropdown.js +302 -0
  43. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsSetPointsPopup.js +273 -0
  44. package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoring.js +178 -0
  45. package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoringWithAlternateAnswer.js +712 -0
  46. package/cypress/e2e/ILC/ListOrdering/listOrderingEditTabBasicSection.js +316 -0
  47. package/cypress/e2e/ILC/ListOrdering/listOrderingEditTabScoringSection.js +256 -0
  48. package/cypress/e2e/ILC/ListOrdering/listOrderingHeaderSection.js +83 -0
  49. package/cypress/e2e/ILC/ListOrdering/listOrderingManuallyAndNonScoredScoring.js +160 -0
  50. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoring.js +191 -0
  51. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoringWithAlternateAnswer.js +895 -0
  52. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoring.js +191 -0
  53. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoringWithAlternateAnswer.js +807 -0
  54. package/cypress/e2e/ILC/ListOrdering/listOrderingSetCorrectAnswerCheckboxes.js +208 -0
  55. package/cypress/e2e/ILC/ListOrdering/listOrderingSetCorrectAnswerSection.js +172 -0
  56. package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettings.js +820 -0
  57. package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +936 -0
  58. package/cypress/e2e/ILC/ListSorting/listSortingClickAndDrop.js +456 -0
  59. package/cypress/e2e/ILC/ListSorting/listSortingEditTabBasicSection.js +440 -0
  60. package/cypress/e2e/ILC/ListSorting/listSortingEditTabScoringSection.js +259 -0
  61. package/cypress/e2e/ILC/ListSorting/listSortingHeaderSection.js +89 -0
  62. package/cypress/e2e/ILC/ListSorting/listSortingManuallyAndNonScoredScoring.js +171 -0
  63. package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoring.js +1150 -0
  64. package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoring.js +1055 -0
  65. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.js +263 -0
  66. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerSection.js +168 -0
  67. package/package.json +1 -1
@@ -0,0 +1,300 @@
1
+ import { listOrderingPage } from "../../../pages/listOrderingPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const answerNumerationDropdownOptions = ['Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
7
+ const fontSizeDropdownOptions = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
8
+ const fontSizes = ['16px', '12px', '14px', '17px', '20px', '24px'];
9
+ let options = ['plant', 'sprout', 'flower', 'seed'];
10
+ let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
11
+
12
+ describe('Create Item page - List ordering: Additional settings basic', () => {
13
+ before(() => {
14
+ cy.loginAs('admin');
15
+ });
16
+
17
+ describe('Additional Settings accordion', () => {
18
+ abortEarlySetup();
19
+ before(() => {
20
+ cy.log('Navigating to list ordering question type');
21
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
22
+ });
23
+
24
+ listOrderingPage.tests.verifyAdditonalSettingsAccordionProperties();
25
+ });
26
+
27
+ describe('Additional settings: Font size contents', () => {
28
+ abortEarlySetup();
29
+ before(() => {
30
+ cy.log('Navigating to list ordering question type');
31
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
32
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
33
+ cy.barsPreLoaderWait();
34
+ listOrderingPage.steps.addQuestionInstructions();
35
+ listOrderingPage.steps.addInputToOptionsInputField(options);
36
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
37
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
38
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
39
+ listOrderingPage.steps.allotPoints('20');
40
+ listOrderingPage.steps.expandAdditonalSettings();
41
+ listOrderingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
42
+ });
43
+
44
+ listOrderingPage.tests.verifyFontSizeSectionContents();
45
+ });
46
+
47
+ //Failing due to - https://redmine.zeuslearning.com/issues/538526
48
+ describe('Additional settings: Font size contents set correct answer section', () => {
49
+ abortEarlySetup();
50
+ before(() => {
51
+ cy.log('Navigating to list ordering question type');
52
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
53
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
54
+ cy.barsPreLoaderWait();
55
+ listOrderingPage.steps.addQuestionInstructions();
56
+ listOrderingPage.steps.addInputToOptionsInputField(options);
57
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
58
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
59
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
60
+ listOrderingPage.steps.allotPoints('20');
61
+ listOrderingPage.steps.expandAdditonalSettings();
62
+ listOrderingPage.steps.checkIncludeLablesCheckbox();
63
+ listOrderingPage.steps.addInputToTopLabelInputField('Top label');
64
+ listOrderingPage.steps.addInputToBottomLabelInputField('Bottom label');
65
+ });
66
+
67
+ fontSizeDropdownOptions.forEach((option, fontsIndex) => {
68
+ 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}`, () => {
69
+ listOrderingPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
70
+ listOrderingPage.fontSizeDropdown()
71
+ .verifyInnerText(`${option}`);
72
+ utilities.verifyCSS(listOrderingPage.setCorrectAnswerSectionOption(), {
73
+ 'font-size': fontSizes[fontsIndex]
74
+ });
75
+ utilities.verifyCSS(listOrderingPage.setCorrectAnswerSectionTopLabel(), {
76
+ 'font-size': fontSizes[fontsIndex]
77
+ });
78
+ utilities.verifyCSS(listOrderingPage.setCorrectAnswerSectionBottomLabel(), {
79
+ 'font-size': fontSizes[fontsIndex]
80
+ });
81
+ });
82
+ });
83
+ });
84
+
85
+ describe('Additional settings: Font size contents preview tab section', () => {
86
+ abortEarlySetup();
87
+ before(() => {
88
+ cy.log('Navigating to list ordering question type');
89
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
90
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
91
+ cy.barsPreLoaderWait();
92
+ listOrderingPage.steps.addQuestionInstructions();
93
+ listOrderingPage.steps.addInputToOptionsInputField(options);
94
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
95
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
96
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
97
+ listOrderingPage.steps.allotPoints('20');
98
+ listOrderingPage.steps.expandAdditonalSettings();
99
+ listOrderingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
100
+ listOrderingPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[2]}`);
101
+ listOrderingPage.steps.checkIncludeLablesCheckbox();
102
+ listOrderingPage.steps.addInputToTopLabelInputField('Top label');
103
+ listOrderingPage.steps.addInputToBottomLabelInputField('Bottom label');
104
+ });
105
+
106
+ fontSizeDropdownOptions.forEach((option, fontsIndex) => {
107
+ 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`, () => {
108
+ listOrderingPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
109
+ utilities.verifyInnerText(listOrderingPage.fontSizeDropdown(), `${option}`)
110
+ listOrderingPage.steps.switchToPreviewTab();
111
+ utilities.verifyCSS(listOrderingPage.questionInstructionsText(), {
112
+ 'font-size': fontSizes[fontsIndex]
113
+ });
114
+ utilities.verifyCSS(listOrderingPage.previewTabOption(), {
115
+ 'font-size': fontSizes[fontsIndex]
116
+ });
117
+ utilities.verifyCSS(listOrderingPage.previewTabTopLabel(), {
118
+ 'font-size': fontSizes[fontsIndex]
119
+ });
120
+ utilities.verifyCSS(listOrderingPage.previewTabBottomLabel(), {
121
+ 'font-size': fontSizes[fontsIndex]
122
+ });
123
+ cy.log('Font size of Answer numeration and correct answer container when Show correct answer is checked')
124
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox()
125
+ utilities.verifyCSS(listOrderingPage.optionNumeration(), {
126
+ 'font-size': fontSizes[fontsIndex]
127
+ });
128
+ utilities.verifyCSS(listOrderingPage.correctAnswerContainerAnswerWrapper(), {
129
+ 'font-size': fontSizes[fontsIndex]
130
+ });
131
+ utilities.verifyCSS(listOrderingPage.correctAnswerContainerAnswerWrapper().find('[class*="ListOrderingResponsestyles__IndexWrapper"]'), {
132
+ 'font-size': fontSizes[fontsIndex]
133
+ });
134
+ utilities.verifyCSS(listOrderingPage.correctAnswerContainerCorrectAnswersLabel(), {
135
+ 'font-size': fontSizes[fontsIndex]
136
+ });
137
+ cy.log('Uncheck Show correct answer checkbox')
138
+ listOrderingPage.steps.uncheckShowCorrectAnswerCheckbox()
139
+ cy.log('Font size of Answer numeration when Check answer is selected')
140
+ listOrderingPage.steps.checkAnswer()
141
+ utilities.verifyCSS(listOrderingPage.optionNumeration(), {
142
+ 'font-size': fontSizes[fontsIndex]
143
+ });
144
+ listOrderingPage.steps.switchToEditTab();
145
+ });
146
+ });
147
+ });
148
+
149
+ describe('Additional settings: Check answer', () => {
150
+ abortEarlySetup();
151
+ before(() => {
152
+ cy.log('Navigating to list ordering question type');
153
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
154
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
155
+ cy.barsPreLoaderWait();
156
+ listOrderingPage.steps.addQuestionInstructions();
157
+ listOrderingPage.steps.addInputToOptionsInputField(options);
158
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
159
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
160
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
161
+ listOrderingPage.steps.allotPoints('20');
162
+ listOrderingPage.steps.expandAdditonalSettings();
163
+ });
164
+
165
+ listOrderingPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
166
+ });
167
+
168
+ describe('Additional settings: Check answer functionality', () => {
169
+ abortEarlySetup();
170
+ before(() => {
171
+ cy.log('Navigating to list ordering question type');
172
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
173
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
174
+ cy.barsPreLoaderWait();
175
+ listOrderingPage.steps.addQuestionInstructions();
176
+ listOrderingPage.steps.addInputToOptionsInputField(options);
177
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
178
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
179
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
180
+ listOrderingPage.steps.allotPoints('20');
181
+ listOrderingPage.steps.expandAdditonalSettings();
182
+ listOrderingPage.steps.setMaximumCheckAnswerAttempts(2);
183
+ listOrderingPage.steps.switchToPreviewTab()
184
+ });
185
+
186
+ it('When user attempts the question partially correct with some options at the correct position and some at incorrect then on clicking on the Check Answer button, green check-mark icons should be displayed beside the options at the correct position, red cross-mark icons should be displayed beside the options at incorrect position, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed', () => {
187
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 3);
188
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['plant', 'sprout', 'seed', 'flower']);
189
+ listOrderingPage.steps.checkAnswer()
190
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
191
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
192
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
193
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
194
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
195
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
196
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
197
+ });
198
+
199
+ it('When user attempts the question correctly and clicks on the \'Check Answer\' button, green check-mark icons should be displayed beside the options at the correct position, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed', () => {
200
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
201
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 1);
202
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(correctAnswerArray);
203
+ listOrderingPage.steps.checkAnswer();
204
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
205
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
206
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
207
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
208
+ listOrderingPage.steps.verifyCorrectAttemptBorder();
209
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
210
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
211
+ });
212
+
213
+ listOrderingPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y();
214
+
215
+ it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
216
+ listOrderingPage.steps.switchToEditTab();
217
+ listOrderingPage.steps.clearMaximumCheckAnswerAttemptsInputField();
218
+ listOrderingPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(1);
219
+ listOrderingPage.steps.switchToPreviewTab();
220
+ listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
221
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 3);
222
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['plant', 'sprout', 'seed', 'flower']);
223
+ listOrderingPage.steps.checkAnswer();
224
+ listOrderingPage.steps.verifyCheckAnswerButtonDisabled();
225
+ });
226
+
227
+ 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', () => {
228
+ listOrderingPage.steps.switchToEditTab();
229
+ listOrderingPage.steps.clearMaximumCheckAnswerAttemptsInputField();
230
+ listOrderingPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
231
+ cy.log('Switching to Preview tab');
232
+ listOrderingPage.steps.switchToPreviewTab();
233
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 3);
234
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 0);
235
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['flower', 'plant', 'seed', 'sprout']);
236
+ listOrderingPage.steps.checkAnswer();
237
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
238
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
239
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
240
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
241
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
242
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
243
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
244
+ listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
245
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
246
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 1);
247
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'sprout', 'flower', 'plant']);
248
+ listOrderingPage.steps.checkAnswer();
249
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
250
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
251
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
252
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
253
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
254
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
255
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
256
+ listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
257
+ });
258
+
259
+ 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', () => {
260
+ listOrderingPage.steps.switchToEditTab();
261
+ listOrderingPage.steps.clearMaximumCheckAnswerAttemptsInputField()
262
+ listOrderingPage.steps.switchToPreviewTab();
263
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 3);
264
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 0);
265
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['flower', 'plant', 'seed', 'sprout']);
266
+ listOrderingPage.steps.checkAnswer();
267
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
268
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
269
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
270
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
271
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
272
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
273
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
274
+ listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
275
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
276
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 1);
277
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'sprout', 'flower', 'plant']);
278
+ listOrderingPage.steps.checkAnswer();
279
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
280
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
281
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
282
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
283
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
284
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
285
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
286
+ listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
287
+ });
288
+ });
289
+
290
+ describe('Additional Settings: Details section', () => {
291
+ abortEarlySetup();
292
+ before(() => {
293
+ cy.log('Navigating to list ordering question type');
294
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
295
+ listOrderingPage.steps.expandAdditonalSettings();
296
+ });
297
+
298
+ listOrderingPage.tests.verifyDetailsSection();
299
+ });
300
+ });
@@ -0,0 +1,302 @@
1
+ import { listOrderingPage } from "../../../pages/listOrderingPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const optionStyleDropdownOptions = ['Grid', 'Minimal', 'Inline'];
7
+ let options = ['plant', 'sprout', 'flower', 'seed'];
8
+ let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
9
+
10
+ describe('Create Item page - List ordering: Additional settings - Options style dropdown', () => {
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ });
14
+
15
+ describe('Additional settings: Option style contents', () => {
16
+ abortEarlySetup();
17
+ before(() => {
18
+ cy.log('Navigating to list ordering question type');
19
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
20
+ listOrderingPage.steps.expandAdditonalSettings();
21
+ });
22
+
23
+ it(`\'Option style\' label and dropdown should be displayed and by default, ${optionStyleDropdownOptions[0]} option should be selected in the dropdown`, () => {
24
+ utilities.verifyInnerText(listOrderingPage.optionStyleLabel(), 'Option style');
25
+ utilities.verifyElementVisibilityState(listOrderingPage.optionStyleLabel(), 'visible');
26
+ utilities.verifyInnerText(listOrderingPage.optionStyleDropdown(), 'Grid');
27
+ });
28
+
29
+ it('CSS of Option style section', { tags: 'css' }, () => {
30
+ utilities.verifyCSS(listOrderingPage.optionStyleDropdown(), {
31
+ 'color': css.color.liText,
32
+ 'font-size': css.fontSize.default,
33
+ 'font-weight': css.fontWeight.regular
34
+ });
35
+ utilities.verifyCSS(listOrderingPage.optionStyleLabel(), {
36
+ 'color': css.color.labels,
37
+ 'font-size': css.fontSize.normal,
38
+ 'font-weight': css.fontWeight.semibold
39
+ });
40
+ });
41
+
42
+ it(`When user clicks on the Option style dropdown a list of 3 options - ${optionStyleDropdownOptions} should be displayed`, () => {
43
+ listOrderingPage.steps.expandOptionStyleDropdown();
44
+ listOrderingPage.steps.verifyOptionStyleDropdownOptions(optionStyleDropdownOptions);
45
+ });
46
+
47
+ it('CSS of Option style dropdown in active state', { tags: 'css' }, () => {
48
+ utilities.verifyCSS(listOrderingPage.optionStyleDropdownOptions().eq(0), {
49
+ 'color': css.color.liText,
50
+ 'font-size': css.fontSize.default,
51
+ 'font-weight': css.fontWeight.regular,
52
+ 'background-color': css.color.liTextSelectedBg
53
+ });
54
+ utilities.verifyCSS(listOrderingPage.optionStyleDropdownOptions().eq(1), {
55
+ 'color': css.color.liText,
56
+ 'font-size': css.fontSize.default,
57
+ 'font-weight': css.fontWeight.regular,
58
+ 'background-color': css.color.transparent
59
+ });
60
+ });
61
+
62
+ it('Accessbility of Option style dropdown in active state', { tags: 'a11y' }, () => {
63
+ cy.checkAccessibility(listOrderingPage.dropdownList());
64
+ });
65
+ });
66
+
67
+ describe('Additional settings: Option style - Grid set correct answer section', () => {
68
+ abortEarlySetup();
69
+ before(() => {
70
+ cy.log('Navigating to list ordering question type');
71
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
72
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
73
+ cy.barsPreLoaderWait();
74
+ listOrderingPage.steps.addQuestionInstructions();
75
+ listOrderingPage.steps.addInputToOptionsInputField(options);
76
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
77
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
78
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
79
+ listOrderingPage.steps.allotPoints('20');
80
+ listOrderingPage.steps.expandAdditonalSettings();
81
+ });
82
+
83
+ it('When \'Grid\' option is selected in the \'Option style\' dropdown then borders and drag handle button should be displayed for options in the Set correct answer section', () => {
84
+ utilities.verifyInnerText(listOrderingPage.optionStyleDropdown(), 'Grid');
85
+ for (let index = 0; index < 4; index++) {
86
+ listOrderingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
87
+ }
88
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
89
+ utilities.verifyCSS(listOrderingPage.setCorrectAnswerSectionOption(), {
90
+ 'border': `1px solid ${css.color.titleContainerBorder}`
91
+ });
92
+ utilities.verifyCSS(listOrderingPage.setCorrectAnswerSectionOptionsWrapper(), {
93
+ 'flex-direction': 'column'
94
+ });
95
+ });
96
+ });
97
+
98
+ describe('Additional settings: Option style - Grid preview tab', () => {
99
+ abortEarlySetup();
100
+ before(() => {
101
+ cy.log('Navigating to list ordering question type');
102
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
103
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
104
+ cy.barsPreLoaderWait();
105
+ listOrderingPage.steps.addQuestionInstructions();
106
+ listOrderingPage.steps.addInputToOptionsInputField(options);
107
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
108
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
109
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
110
+ listOrderingPage.steps.allotPoints('20');
111
+ listOrderingPage.steps.expandAdditonalSettings();
112
+ });
113
+
114
+ it('When \'Grid\' option is selected in the \'Option style\' dropdown then borders and drag handle button should be displayed for options in the preview tab', () => {
115
+ utilities.verifyInnerText(listOrderingPage.optionStyleDropdown(), 'Grid');
116
+ listOrderingPage.steps.switchToPreviewTab()
117
+ for (let index = 0; index < 4; index++) {
118
+ listOrderingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
119
+ }
120
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(options);
121
+ utilities.verifyCSS(listOrderingPage.previewTabOption(), {
122
+ 'border': `1px solid ${css.color.titleContainerBorder}`
123
+ });
124
+ utilities.verifyCSS(listOrderingPage.previewTabOptionsWrapper(), {
125
+ 'flex-direction': 'column'
126
+ });
127
+ });
128
+ });
129
+
130
+ describe('Additional settings: Option style - Minimal set correct answer section', () => {
131
+ abortEarlySetup();
132
+ before(() => {
133
+ cy.log('Navigating to list ordering question type');
134
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
135
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
136
+ cy.barsPreLoaderWait();
137
+ listOrderingPage.steps.addQuestionInstructions();
138
+ listOrderingPage.steps.addInputToOptionsInputField(options);
139
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
140
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
141
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
142
+ listOrderingPage.steps.expandAdditonalSettings();
143
+ });
144
+
145
+ it('When \'Minimal\' option is selected in the \'Option style\' dropdown then borders should not be displayed in the Set correct answer section', () => {
146
+ listOrderingPage.steps.selectOptionStyleDropdownOption('Minimal')
147
+ utilities.verifyInnerText(listOrderingPage.optionStyleDropdown(), 'Minimal');
148
+ listOrderingPage.steps.verifyNoBorderForSetCorrectAnswerOption();
149
+ utilities.verifyCSS(listOrderingPage.setCorrectAnswerSectionOptionsWrapper(), {
150
+ 'flex-direction': 'column'
151
+ });
152
+ });
153
+
154
+ listOrderingPage.tests.verifyAutoScoredAllOrNothingPointsAndMinimumScoreAwardedLabelAndInputField();
155
+
156
+ listOrderingPage.tests.verifyAllContentsOfSetCorrectAnswerSectionForScoringType('All or nothing', correctAnswerArray);
157
+
158
+ it('When user has selected Auto scored - Partial equal weights scoring type then \'Points\' label and input field along with points per response label and scores should be displayed in the Set correct answer section', () => {
159
+ listOrderingPage.steps.selectPartialEqualWeightsCheckbox()
160
+ listOrderingPage.steps.verifyDefaultPointsLabelAndInputField();
161
+ listOrderingPage.steps.verifyPointsPerResponseLabel()
162
+ listOrderingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('-');
163
+ });
164
+
165
+ listOrderingPage.tests.verifyAllContentsOfSetCorrectAnswerSectionForScoringType('Partial equal weights', correctAnswerArray);
166
+
167
+ it('When user has selected Auto scored - Partial different weights scoring type then \'Points per response\' label and input field should be displayed in the Set correct answer section', () => {
168
+ listOrderingPage.steps.selectPartialDifferentWeightsCheckbox()
169
+ listOrderingPage.steps.verifyPartialDifferentWeightsPointsPerResponseLabel();
170
+ listOrderingPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmptyAndEnabled();
171
+ });
172
+
173
+ listOrderingPage.tests.verifyAllContentsOfSetCorrectAnswerSectionForScoringType('Partial different weights', correctAnswerArray);
174
+ });
175
+
176
+ describe('Additional settings: Option style - Minimal preview tab', () => {
177
+ abortEarlySetup();
178
+ before(() => {
179
+ cy.log('Navigating to list ordering question type');
180
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
181
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
182
+ cy.barsPreLoaderWait();
183
+ listOrderingPage.steps.addQuestionInstructions();
184
+ listOrderingPage.steps.addInputToOptionsInputField(options);
185
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
186
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
187
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
188
+ listOrderingPage.steps.allotPoints('20');
189
+ listOrderingPage.steps.expandAdditonalSettings();
190
+ });
191
+
192
+ it('When \'Minimal\' option is selected in the \'Option style\' dropdown then borders should not be displayed and drag handle button should be displayed for options in the preview tab', () => {
193
+ listOrderingPage.steps.selectOptionStyleDropdownOption('Minimal')
194
+ utilities.verifyInnerText(listOrderingPage.optionStyleDropdown(), 'Minimal');
195
+ listOrderingPage.steps.switchToPreviewTab();
196
+ for (let index = 0; index < 4; index++) {
197
+ listOrderingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
198
+ }
199
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(options);
200
+ listOrderingPage.steps.verifyNoBorderForPreviewTabOption();
201
+ utilities.verifyCSS(listOrderingPage.previewTabOptionsWrapper(), {
202
+ 'flex-direction': 'column'
203
+ });
204
+ });
205
+ });
206
+
207
+ describe('Additional settings: Option style - Inline set correct answer section', () => {
208
+ abortEarlySetup();
209
+ before(() => {
210
+ cy.log('Navigating to list ordering question type');
211
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
212
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
213
+ cy.barsPreLoaderWait();
214
+ listOrderingPage.steps.addQuestionInstructions();
215
+ listOrderingPage.steps.addInputToOptionsInputField(options);
216
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
217
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
218
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
219
+ listOrderingPage.steps.expandAdditonalSettings();
220
+ });
221
+
222
+ it('When \'Inline\' option is selected in the \'Option style\' dropdown then borders should not be displayed and drag handle button should be displayed for options and the options should be displayed in a line in the Set correct answer section', () => {
223
+ listOrderingPage.steps.selectOptionStyleDropdownOption('Inline')
224
+ utilities.verifyInnerText(listOrderingPage.optionStyleDropdown(), 'Inline');
225
+ listOrderingPage.steps.verifyNoBorderForSetCorrectAnswerOption();
226
+ utilities.verifyCSS(listOrderingPage.setCorrectAnswerSectionOptionsWrapper(), {
227
+ 'flex-direction': 'row'
228
+ });
229
+ });
230
+
231
+ listOrderingPage.tests.verifyAutoScoredAllOrNothingPointsAndMinimumScoreAwardedLabelAndInputField();
232
+
233
+ listOrderingPage.tests.verifyAllContentsOfSetCorrectAnswerSectionForScoringType('All or nothing', correctAnswerArray);
234
+
235
+ it('When user has selected Auto scored - Partial equal weights scoring type then \'Points\' label and input field along with \'Points per response : \' should be displayed and points per response scores for all options should not be displayed in the Set correct answer section', () => {
236
+ listOrderingPage.steps.selectPartialEqualWeightsCheckbox();
237
+ listOrderingPage.steps.verifyDefaultPointsLabelAndInputField();
238
+ utilities.verifyInnerText(listOrderingPage.pointsPerResponseLabelForInlineOption(), 'Points per response :')
239
+ utilities.verifyElementVisibilityState(listOrderingPage.pointsPerResponseScoreForInlineOption(), 'exist');
240
+ utilities.verifyElementVisibilityState(listOrderingPage.pointsPerResponseLabel(), 'notExist');
241
+ utilities.verifyElementVisibilityState(listOrderingPage.partialEqualWeightsPointsPerResponseScore(), 'notExist');
242
+ });
243
+
244
+ listOrderingPage.tests.verifyAllContentsOfSetCorrectAnswerSectionForScoringType('Partial equal weights', correctAnswerArray);
245
+
246
+ it('When user gives a score input to \'Points\' input field, then the score should be equally divided and displayed besides each response under the \'Points per response\' label', () => {
247
+ listOrderingPage.steps.allotPoints('20');
248
+ utilities.verifyInnerText(listOrderingPage.pointsPerResponseScoreForInlineOption(), '5');
249
+ });
250
+
251
+
252
+ it('When user adds a option then the Points per response should be updated accordingly', () => {
253
+ listOrderingPage.steps.addOption();
254
+ utilities.verifyInnerText(listOrderingPage.pointsPerResponseScoreForInlineOption(), '4');
255
+ });
256
+
257
+ it('When user deletes a option then the Points per response should be updated accordingly', () => {
258
+ listOrderingPage.steps.deleteOption(4);
259
+ utilities.verifyInnerText(listOrderingPage.pointsPerResponseScoreForInlineOption(), '5');
260
+ });
261
+
262
+ it('When user has selected Auto scored - Partial different weights scoring type then \'Set points\' button should be displayed and \'Points per response\' label and input field should not be displayed in the Set correct answer section', () => {
263
+ listOrderingPage.steps.selectPartialDifferentWeightsCheckbox()
264
+ listOrderingPage.steps.verifySetPointsButton()
265
+ utilities.verifyElementVisibilityState(listOrderingPage.partialDifferentWeightsPointsPerResponseLabel(), 'notExist');
266
+ utilities.verifyElementVisibilityState(listOrderingPage.partialDifferentWeightsPointsInputField(), 'notExist');
267
+ });
268
+
269
+ listOrderingPage.tests.verifyAllContentsOfSetCorrectAnswerSectionForScoringType('Partial different weights', correctAnswerArray);
270
+ });
271
+
272
+ describe('Additional settings: Option style - Inline preview tab', () => {
273
+ abortEarlySetup();
274
+ before(() => {
275
+ cy.log('Navigating to list ordering question type');
276
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
277
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
278
+ cy.barsPreLoaderWait();
279
+ listOrderingPage.steps.addQuestionInstructions();
280
+ listOrderingPage.steps.addInputToOptionsInputField(options);
281
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
282
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
283
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
284
+ listOrderingPage.steps.allotPoints('20');
285
+ listOrderingPage.steps.expandAdditonalSettings();
286
+ });
287
+
288
+ it('When \'Inline\' option is selected in the \'Option style\' dropdown then drag handle button and options should be displayed in a line and borders for options should not be displayed and in the preview tab', () => {
289
+ listOrderingPage.steps.selectOptionStyleDropdownOption('Inline')
290
+ utilities.verifyInnerText(listOrderingPage.optionStyleDropdown(), 'Inline');
291
+ listOrderingPage.steps.switchToPreviewTab()
292
+ for (let index = 0; index < 4; index++) {
293
+ listOrderingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
294
+ }
295
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(options);
296
+ listOrderingPage.steps.verifyNoBorderForPreviewTabOption();
297
+ utilities.verifyCSS(listOrderingPage.previewTabOptionsWrapper(), {
298
+ 'flex-direction': 'row'
299
+ });
300
+ });
301
+ });
302
+ });