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,273 @@
1
+ import { setPointsPopupBase } from "../../../pages/components/setPointsPopupBase";
2
+ import { dialogBoxBase } from "../../../pages/dialogBoxBase";
3
+ import { listOrderingPage } from "../../../pages/listOrderingPage";
4
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
5
+ import utilities from "../../../support/helpers/utilities";
6
+ const css = Cypress.env('css');
7
+
8
+ const optionStyleDropdownOptions = ['Grid', 'Minimal', 'Inline'];
9
+ const answerNumerationDropdownOptions = ['Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
10
+ const fontSizeDropdownOptions = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
11
+ const numbers = ['1', '2', '3', '4'];
12
+ const lowercase = ['a', 'b', 'c', 'd'];
13
+ const uppercase = ['A', 'B', 'C', 'D'];
14
+ const fontSizes = ['16px', '12px', '14px', '17px', '20px', '24px'];
15
+ let options = ['plant', 'sprout', 'flower', 'seed'];
16
+ let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
17
+
18
+ describe('Create Item page - List ordering: Additional settings', () => {
19
+ before(() => {
20
+ cy.loginAs('admin');
21
+ });
22
+
23
+ describe('Set points - Edit tab contents', () => {
24
+ abortEarlySetup();
25
+ before(() => {
26
+ cy.log('Navigating to list ordering question type');
27
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
28
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
29
+ cy.barsPreLoaderWait();
30
+ listOrderingPage.steps.addQuestionInstructions();
31
+ cy.log('Add Image to option input field')
32
+ listOrderingPage.steps.focusInOptionsInputField(0);
33
+ listOrderingPage.steps.selectImageOptionFromCKEditorToolbar()
34
+ listOrderingPage.steps.addImageToInputField();
35
+ cy.log('Add equation to option input field')
36
+ listOrderingPage.steps.focusInOptionsInputField(1);
37
+ listOrderingPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
38
+ listOrderingPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
39
+ cy.log('Add link to option input field')
40
+ listOrderingPage.steps.focusInOptionsInputField(2);
41
+ listOrderingPage.steps.selectLinkOptionFromCKEditorToolbar();
42
+ listOrderingPage.steps.addLinkToInputField()
43
+ cy.log('Add bold text to input field')
44
+ listOrderingPage.steps.focusInOptionsInputField(3);
45
+ listOrderingPage.steps.selectBoldOptionFromCKEditorToolbar();
46
+ listOrderingPage.steps.addBoldTextInputToOptionsInputField(3);
47
+ listOrderingPage.steps.allotPoints('20');
48
+ listOrderingPage.steps.expandAdditonalSettings();
49
+ });
50
+
51
+ it('When user has selected \'Option style\' as \'Inline\' and Scoring type as \'Partial different weights\' Set points button should be displayed', () => {
52
+ listOrderingPage.steps.selectOptionStyleDropdownOption('Inline')
53
+ utilities.verifyInnerText(listOrderingPage.optionStyleDropdown(), 'Inline');
54
+ listOrderingPage.steps.selectPartialDifferentWeightsCheckbox();
55
+ listOrderingPage.steps.verifySetPointsButton()
56
+ });
57
+
58
+ it('CSS of \'Set points\' button', { tags: 'css' }, () => {
59
+ utilities.verifyCSS(listOrderingPage.buttonSetPoints().find('.set-points-label-wrapper'), {
60
+ 'color': css.color.activeButtons,
61
+ 'font-size': css.fontSize.default,
62
+ 'font-weight': css.fontWeight.regular
63
+ });
64
+ });
65
+
66
+ it('Accessibility of \'Set points\' button', { tags: 'a11y' }, () => {
67
+ cy.checkAccessibility(listOrderingPage.buttonSetPoints());
68
+ });
69
+
70
+ it('When user selects \'Set points\' button a popup should be displayed with a \'Set points\' title and \'Cancel\' and \'Save\' button', () => {
71
+ listOrderingPage.steps.clickOnSetPointsButton();
72
+ utilities.verifyInnerText(setPointsPopupBase.dialogBoxTitle(), 'Set points');
73
+ utilities.verifyInnerText(setPointsPopupBase.buttonReject(), 'Cancel');
74
+ utilities.verifyInnerText(setPointsPopupBase.buttonAccept(), 'Save');
75
+ });
76
+
77
+ it('CSS of Set points popup', { tags: 'css' }, () => {
78
+ utilities.verifyCSS(setPointsPopupBase.dialogBoxTitle(), {
79
+ 'color': css.color.flyoutTitle,
80
+ 'font-size': css.fontSize.heading,
81
+ 'font-weight': css.fontWeight.semibold
82
+ });
83
+ utilities.verifyCSS(setPointsPopupBase.buttonAccept(), {
84
+ 'color': css.color.primaryBtn,
85
+ 'font-size': css.fontSize.default,
86
+ 'font-weight': css.fontWeight.semibold,
87
+ 'background-color': css.color.primaryBtnBg
88
+ });
89
+ utilities.verifyCSS(setPointsPopupBase.buttonReject(), {
90
+ 'color': css.color.secondaryBtn,
91
+ 'font-size': css.fontSize.default,
92
+ 'font-weight': css.fontWeight.semibold,
93
+ 'background-color': css.color.transparent
94
+ });
95
+ });
96
+
97
+ it('All Options should be displayed along with numeration according to the \'Options\' section', () => {
98
+ listOrderingPage.steps.verifyImageAddedToOptionInSetPointsPopup(0);
99
+ listOrderingPage.steps.verifyEquationAddedToOptionInSetPointsPopup(1);
100
+ listOrderingPage.steps.verifyLinkAddedToOptionInSetPointsPopup(2);
101
+ listOrderingPage.steps.verifyBoldTextAddedToOptionInSetPointsPopup(3);
102
+ utilities.verifyElementCount(listOrderingPage.setPointsPopupOptions(), 4);
103
+ listOrderingPage.steps.verifySetPointsPopupOptionNumeration(numbers)
104
+ });
105
+
106
+ it('\'Points\' label and empty input fields should be displayed for all the options', () => {
107
+ utilities.verifyInnerText(listOrderingPage.setPointsPopupPointsLabel(), 'Points');
108
+ utilities.verifyElementVisibilityState(listOrderingPage.pointsInputField(), 'exist');
109
+ utilities.verifyInnerText(listOrderingPage.pointsInputField(), '');
110
+ utilities.verifyElementCount(listOrderingPage.pointsInputField(), 4);
111
+ });
112
+ });
113
+
114
+ //Failing due to - https://redmine.zeuslearning.com/issues/547865
115
+ describe('Set points - Edit tab functionality', () => {
116
+ abortEarlySetup();
117
+ before(() => {
118
+ cy.log('Navigating to list ordering question type');
119
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
120
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
121
+ cy.barsPreLoaderWait();
122
+ listOrderingPage.steps.addQuestionInstructions();
123
+ listOrderingPage.steps.addInputToOptionsInputField(options);
124
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
125
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
126
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
127
+ listOrderingPage.steps.expandAdditonalSettings();
128
+ listOrderingPage.steps.selectOptionStyleDropdownOption('Inline')
129
+ utilities.verifyInnerText(listOrderingPage.optionStyleDropdown(), 'Inline');
130
+ listOrderingPage.steps.selectPartialDifferentWeightsCheckbox();
131
+ listOrderingPage.steps.clickOnSetPointsButton();
132
+ });
133
+
134
+ it('When user has opened \'Set points\' popup and focuses in and out of the points input field then an error message \'Error: Please enter points.\' should be displayed', () => {
135
+ listOrderingPage.steps.focusInAndFocusOutOfPointsInputField(0);
136
+ utilities.verifyInnerText(listOrderingPage.errorMessage(), 'Error: Please enter points.');
137
+ });
138
+
139
+ it('When user enters points then the error message should disappear', () => {
140
+ setPointsPopupBase.steps.allotPointsToSetPointsPopupPointsInputField([10]);
141
+ utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'notExist');
142
+ });
143
+
144
+ it('When user clicks on Cancel button then the popup should close and the on opening the popup again empty points fields should be displayed', () => {
145
+ setPointsPopupBase.steps.cancelSetPointsPopup();
146
+ listOrderingPage.steps.clickOnSetPointsButton();
147
+ utilities.verifyInnerText(listOrderingPage.pointsInputField(), '');
148
+ cy.log('Close the Set points popup')
149
+ setPointsPopupBase.steps.cancelSetPointsPopup();
150
+ });
151
+
152
+ //Failing due to - https://redmine.zeuslearning.com/issues/538676
153
+ it('When user deletes an option from the \'Option\' section then it should not be displayed in the \'Set points\' popup and the numeration should change accordingly', () => {
154
+ listOrderingPage.steps.deleteOption(0);
155
+ listOrderingPage.steps.clickOnSetPointsButton();
156
+ utilities.verifyElementCount(listOrderingPage.setPointsPopupOptions(), 3);
157
+ listOrderingPage.steps.verifySetPointsPopupOptionNumeration(numbers.slice(0, 2));
158
+ cy.log('Close the Set points popup')
159
+ setPointsPopupBase.steps.cancelSetPointsPopup();
160
+ });
161
+
162
+ //Failing due to - https://redmine.zeuslearning.com/issues/538680
163
+ it('When user adds an option in the \'Option\' section then it should be displayed in the \'Set points\' popup with an empty points field', () => {
164
+ listOrderingPage.steps.addOption();
165
+ listOrderingPage.steps.clickOnSetPointsButton();
166
+ utilities.verifyElementCount(listOrderingPage.setPointsPopupOptions(), 4);
167
+ listOrderingPage.steps.verifySetPointsPopupOptionNumeration(numbers);
168
+ utilities.verifyInnerText(listOrderingPage.pointsInputField(), '');
169
+ });
170
+
171
+ it('When user adds points to the options and clicks on \'Save\' button then the popup should close and opening the popup again the points should be prefilled', () => {
172
+ setPointsPopupBase.steps.allotPointsToSetPointsPopupPointsInputField([4.8, 3, 2.2]);
173
+ setPointsPopupBase.steps.saveSetPointsPopup();
174
+ listOrderingPage.steps.clickOnSetPointsButton();
175
+ setPointsPopupBase.steps.verifyPointsAllotedInSetPointsPopup([4.8, 3, 2.2]);
176
+ cy.log('Close the Set points popup')
177
+ setPointsPopupBase.steps.cancelSetPointsPopup();
178
+ });
179
+
180
+ it('When user tries to add \'Alternate\' tab without adding points to all options field then an warning popup should be displayed with \'Warning!\' title and \'Please fill required details.\' should be displayed', () => {
181
+ listOrderingPage.steps.clickOnAddAlternateAnswerButton();
182
+ dialogBoxBase.steps.allFieldsRequiredWarningPopupContents();
183
+ });
184
+
185
+ it('Warning popup should close on clicking the Close icon button', () => {
186
+ dialogBoxBase.steps.closeWarningPopup();
187
+ });
188
+
189
+ //Failing due to - https://redmine.zeuslearning.com/issues/539309
190
+ it('\'Error: Please enter points.\' error message should be displayed below the Set points button with error icon on the Correct tab', () => {
191
+ listOrderingPage.steps.verifySetCorrectAnswerErrorIconIsDisplayed();
192
+ utilities.verifyInnerText(listOrderingPage.errorMessage(), 'Error: Please enter points.');
193
+ });
194
+
195
+ it('When user opens the Set points popup an error message should be displayed below the empty points input field and on entering points the error message should disappear', () => {
196
+ listOrderingPage.steps.clickOnSetPointsButton();
197
+ setPointsPopupBase.steps.verifyPointsErrorMessageInSetPointsPopup(3);
198
+ setPointsPopupBase.steps.allotPointsToSetPointsPopupPointsInputField([4, 3, 2, 5]);
199
+ utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'notExist');
200
+ });
201
+
202
+ it('When user has alloted points to all options then the error message and error icon should not be displayed', () => {
203
+ listOrderingPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
204
+ utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'notExist');
205
+ });
206
+
207
+ it('User should be able to add \'Alternate\' tab', () => {
208
+ setPointsPopupBase.steps.saveSetPointsPopup();
209
+ listOrderingPage.steps.addAlternateTab(1);
210
+ });
211
+
212
+ it('When user clicks on the \'Set points\' button of the \'Alternate\' tab then options should be displayed with empty points field', () => {
213
+ listOrderingPage.steps.clickOnSetPointsButton();
214
+ listOrderingPage.steps.verifySetPointsPopupOptionNumeration(numbers)
215
+ utilities.verifyInnerText(listOrderingPage.pointsInputField(), '');
216
+ setPointsPopupBase.steps.allotPointsToSetPointsPopupPointsInputField([1, 2, 4, 5]);
217
+ setPointsPopupBase.steps.saveSetPointsPopup();
218
+ });
219
+
220
+ //Failing due to - https://redmine.zeuslearning.com/issues/539283
221
+ it(`When user changes the Answer numeration option to ${answerNumerationDropdownOptions[2]} then the set points popup options should be displayed with lowercase numeration`, () => {
222
+ listOrderingPage.steps.navigateToCorrectTab()
223
+ listOrderingPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[2]}`);
224
+ listOrderingPage.steps.clickOnSetPointsButton()
225
+ listOrderingPage.steps.verifySetPointsPopupOptionNumeration(lowercase);
226
+ });
227
+ });
228
+
229
+ describe('Set points - Preview tab', () => {
230
+ abortEarlySetup();
231
+ before(() => {
232
+ cy.log('Navigating to list ordering question type');
233
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
234
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
235
+ cy.barsPreLoaderWait();
236
+ listOrderingPage.steps.addQuestionInstructions();
237
+ listOrderingPage.steps.addInputToOptionsInputField(options);
238
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
239
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
240
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
241
+ listOrderingPage.steps.allotPoints('20');
242
+ listOrderingPage.steps.expandAdditonalSettings();
243
+ listOrderingPage.steps.selectOptionStyleDropdownOption('Inline')
244
+ utilities.verifyInnerText(listOrderingPage.optionStyleDropdown(), 'Inline');
245
+ listOrderingPage.steps.selectPartialDifferentWeightsCheckbox();
246
+ listOrderingPage.steps.clickOnSetPointsButton();
247
+ });
248
+
249
+ it('When user adds points in the \'Set points\' popup and switches to preview tab then the score should be displayed in the preview tab', () => {
250
+ setPointsPopupBase.steps.allotPointsToSetPointsPopupPointsInputField([4.8, 3, 2.2, 2]);
251
+ setPointsPopupBase.steps.saveSetPointsPopup();
252
+ listOrderingPage.steps.switchToPreviewTab();
253
+ listOrderingPage.previewScoreText()
254
+ .verifyInnerText('0/12');
255
+ });
256
+
257
+ it('When user attempts the question correctly then on selecting \'Show correct answer\' checkbox, the user should be awarded full points and green check-mark icons should be displayed beside all the options, a label \'Correct answer\' and border should not be displayed below the question preview and the correct answer container should not be displayed', () => {
258
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
259
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 1);
260
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(correctAnswerArray);
261
+ listOrderingPage.previewScoreText()
262
+ .verifyInnerText('12/12');
263
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox()
264
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
265
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
266
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
267
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
268
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
269
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
270
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
271
+ });
272
+ });
273
+ });
@@ -0,0 +1,178 @@
1
+ import { listOrderingPage } from "../../../pages/listOrderingPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ let options = ['sprout', 'plant', 'flower', 'seed'];
6
+ let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
7
+ let alternateCorrectAnswerArray = ['seed', 'flower', 'sprout', 'plant'];
8
+
9
+ describe('Create Item page - List ordering: All or nothing scoring', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Show correct answer', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ cy.log('Navigating to list ordering question type');
18
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
19
+ cy.barsPreLoaderWait();
20
+ listOrderingPage.steps.addQuestionInstructions();
21
+ listOrderingPage.steps.addInputToOptionsInputField(options);
22
+ });
23
+
24
+ listOrderingPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet()
25
+
26
+ it('When the user has set correct answer options and alloted points \'Show correct answer\' checkbox should be displayed and it should be unchecked by default and points for the question should be displayed beside it', () => {
27
+ listOrderingPage.steps.switchToEditTab();
28
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
29
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
30
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
31
+ listOrderingPage.steps.allotPoints('15');
32
+ listOrderingPage.steps.switchToPreviewTab();
33
+ listOrderingPage.steps.verifyDefaultShowCorrectAnswerCheckboxAndLabel();
34
+ listOrderingPage.steps.verifyPreviewTabScoreText(0, 15);
35
+ });
36
+
37
+ it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab users response should not persist', () => {
38
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
39
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 1);
40
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(correctAnswerArray)
41
+ listOrderingPage.steps.resetQuestionPreview(options);
42
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
43
+ });
44
+ });
45
+
46
+ describe('Question Preview: AutoScored - All or Nothing scoring', () => {
47
+ abortEarlySetup();
48
+ before(() => {
49
+ cy.log('Navigating to list ordering question type');
50
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
51
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
52
+ cy.barsPreLoaderWait();
53
+ listOrderingPage.steps.addQuestionInstructions();
54
+ listOrderingPage.steps.addInputToOptionsInputField(options);
55
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
56
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
57
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
58
+ listOrderingPage.steps.allotPoints('20');
59
+ listOrderingPage.steps.expandAdditonalSettings();
60
+ listOrderingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
61
+ listOrderingPage.steps.switchToPreviewTab();
62
+ });
63
+
64
+ listOrderingPage.tests.verifyCSSOfPreviewAndEditTabAndScoringContents();
65
+
66
+ listOrderingPage.tests.verifya11yOfCreateItemWrapperContents();
67
+
68
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct/incorrect border or icons should not be displayed, a correct answer container with \'Correct answers:\' label and all correct answers with numeration should be displayed below the question preview', () => {
69
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox();
70
+ listOrderingPage.steps.verifyPreviewTabScoreText(0, 20);
71
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
72
+ listOrderingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
73
+ listOrderingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
74
+ utilities.verifyInnerText(listOrderingPage.correctAnswerContainerCorrectAnswersLabel(), 'Correct answers:');
75
+ });
76
+
77
+ it('When user selects Check answer button without attempting the question, correct/incorrect answer border for the question and label should not be displayed below the question preview and correct answer container should not be displayed', () => {
78
+ cy.log('Pre-step: Deselect the show correct checkbox')
79
+ listOrderingPage.steps.uncheckShowCorrectAnswerCheckbox()
80
+ listOrderingPage.steps.checkAnswer();
81
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
82
+ listOrderingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
83
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
84
+ });
85
+
86
+ it('Case: When user attempts the question incorrect', () => {
87
+ cy.log('When user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all the options, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with all correct answers along with numeration should be displayed')
88
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 3);
89
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 0);
90
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['flower', 'plant', 'seed', 'sprout',]);
91
+ listOrderingPage.steps.verifyPreviewTabScoreText(0, 20);
92
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox();
93
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
94
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
95
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
96
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
97
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
98
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
99
+ listOrderingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
100
+
101
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
102
+
103
+ cy.log('When user attempts the question incorrectly and clicks on the \'Check Answer\' button, then red cross-mark icons should be displayed beside all the options, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
104
+ listOrderingPage.steps.checkAnswer();
105
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
106
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
107
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
108
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
109
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
110
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
111
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
112
+ });
113
+
114
+ listOrderingPage.tests.verifyCSSAndA11yOfIncorrectAnswerLabel('list ordering')
115
+
116
+ it('Case: When user attempts the question partially correct', () => {
117
+ cy.log('When user attempts the question partially correct with some options at the correct position and some at incorrect then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points, 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 with all correct answers along with numeration should be displayed')
118
+ listOrderingPage.steps.resetQuestionPreview(options);
119
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 3);
120
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 0);
121
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['plant', 'sprout', 'seed', 'flower']);
122
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox()
123
+ listOrderingPage.steps.verifyPreviewTabScoreText(0, 20);
124
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
125
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
126
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
127
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
128
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
129
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
130
+ listOrderingPage.steps.verifyCorrectAnswerContainerContents(['seed', 'plant'], ['1', '3']);
131
+
132
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
133
+
134
+ cy.log('When user attempts the question partially correct and clicks 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')
135
+ listOrderingPage.steps.checkAnswer()
136
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
137
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
138
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
139
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
140
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
141
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
142
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
143
+ });
144
+
145
+ it('Case: When user attempts the question correct', () => {
146
+ cy.log('When user attempts the question correctly then on selecting \'Show correct answer\' checkbox, the user should be awarded full points and green check-mark icons should be displayed beside all the options, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
147
+ listOrderingPage.steps.resetQuestionPreview(options);
148
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
149
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 1);
150
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(correctAnswerArray);
151
+ listOrderingPage.steps.verifyPreviewTabScoreText(20, 20);
152
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox()
153
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
154
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
155
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
156
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
157
+ listOrderingPage.steps.verifyCorrectAttemptBorder();
158
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
159
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
160
+
161
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
162
+
163
+ cy.log('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')
164
+ listOrderingPage.steps.checkAnswer();
165
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
166
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
167
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
168
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
169
+ listOrderingPage.steps.verifyCorrectAttemptBorder();
170
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
171
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
172
+ });
173
+
174
+ listOrderingPage.tests.verifyCSSAndA11yOfFullScoreTextAndCorrectAnswerLabel('list ordering')
175
+
176
+ listOrderingPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer('20');
177
+ });
178
+ });