itemengine-cypress-automation 1.0.32 → 1.0.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsAnswerNumerationAndResponseOptionPlacement.js +196 -0
  2. package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsBasic.js +210 -0
  3. package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsStemAndResponseColumnHeader.js +206 -0
  4. package/cypress/e2e/ILC/ListMatching/listMatchingAlternateAnswer.js +193 -0
  5. package/cypress/e2e/ILC/ListMatching/listMatchingClickAndDrop.js +644 -0
  6. package/cypress/e2e/ILC/ListMatching/listMatchingEditTabScoringTypes.js +105 -0
  7. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsAllOrNothingScoring.js +117 -0
  8. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsAllOrNothingScoringWithAlternateAnswer.js +30 -0
  9. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsManualAndNonScoredScoring.js +49 -0
  10. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialDifferentScoringWithAlternateTab.js +36 -0
  11. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialDifferentScorings.js +49 -0
  12. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialEqualWeightsScoring.js +48 -0
  13. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialEqualWeightsScoringWithAlternateTab.js +36 -0
  14. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.js +207 -0
  15. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesEditTab.js +139 -0
  16. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesPreviewTab.js +227 -0
  17. package/cypress/e2e/ILC/ListMatching/listMatchingHeaderSection.js +95 -0
  18. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.js +246 -0
  19. package/cypress/e2e/ILC/ListMatching/listMatchingScoringSectionBasic.js +21 -0
  20. package/cypress/e2e/ILC/ListMatching/listMatchingSetCorrectAnswerSectionBasic.js +40 -0
  21. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsAllOrNothingScoring.js +113 -0
  22. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsAllOrNothingScoringWithAlternateAnswer.js +30 -0
  23. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsManualAndNonScoredScoring.js +48 -0
  24. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialDIfferentScoring.js +49 -0
  25. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialDifferentScoringWithAlternateAnswer.js +36 -0
  26. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialEqualScoring.js +48 -0
  27. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialEqualScoringWithAlternateAnswer.js +35 -0
  28. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSection.js +233 -0
  29. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesEditTab.js +113 -0
  30. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.js +185 -0
  31. package/cypress/e2e/ILC/ListMatching/listMatchingSwitchingCases.js +47 -0
  32. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsAnswerNumerationAndOptionLabel.js +295 -0
  33. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsBasic.js +300 -0
  34. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsOptionStyleDropdown.js +302 -0
  35. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsSetPointsPopup.js +273 -0
  36. package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoring.js +178 -0
  37. package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoringWithAlternateAnswer.js +712 -0
  38. package/cypress/e2e/ILC/ListOrdering/listOrderingEditTabBasicSection.js +316 -0
  39. package/cypress/e2e/ILC/ListOrdering/listOrderingEditTabScoringSection.js +256 -0
  40. package/cypress/e2e/ILC/ListOrdering/listOrderingHeaderSection.js +83 -0
  41. package/cypress/e2e/ILC/ListOrdering/listOrderingManuallyAndNonScoredScoring.js +160 -0
  42. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoring.js +191 -0
  43. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoringWithAlternateAnswer.js +895 -0
  44. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoring.js +191 -0
  45. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoringWithAlternateAnswer.js +807 -0
  46. package/cypress/e2e/ILC/ListOrdering/listOrderingSetCorrectAnswerCheckboxes.js +208 -0
  47. package/cypress/e2e/ILC/ListOrdering/listOrderingSetCorrectAnswerSection.js +172 -0
  48. package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettings.js +820 -0
  49. package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +936 -0
  50. package/cypress/e2e/ILC/ListSorting/listSortingClickAndDrop.js +456 -0
  51. package/cypress/e2e/ILC/ListSorting/listSortingEditTabBasicSection.js +440 -0
  52. package/cypress/e2e/ILC/ListSorting/listSortingEditTabScoringSection.js +259 -0
  53. package/cypress/e2e/ILC/ListSorting/listSortingHeaderSection.js +89 -0
  54. package/cypress/e2e/ILC/ListSorting/listSortingManuallyAndNonScoredScoring.js +171 -0
  55. package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoring.js +1150 -0
  56. package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoring.js +1055 -0
  57. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.js +263 -0
  58. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerSection.js +168 -0
  59. package/package.json +1 -1
@@ -0,0 +1,263 @@
1
+ import { listSortingPage } from "../../../pages/listSortingPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ let options = ['plant', 'sprout', 'flower', 'seed'];
7
+ let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
8
+
9
+ describe('Create Item page -list sorting: Randomize options functionality, Hide drag Handle functionality', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Randomize options - Functionality : Edit tab', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ cy.log('Navigating to List sorting question type');
18
+ listSortingPage.steps.navigateToCreateQuestion('list sorting');
19
+ cy.log('Adding question instructions, setting correct answer order and adding points');
20
+ cy.barsPreLoaderWait();
21
+ listSortingPage.steps.addQuestionInstructions();
22
+ listSortingPage.steps.addInputToOptionsInputField(options);
23
+ listSortingPage.steps.allotPoints('20');
24
+ });
25
+
26
+ it('\'Randomize options\' checkbox and label should be displayed and by default it should be unchecked', () => {
27
+ utilities.verifyInnerText(listSortingPage.randomizeOptionsCheckboxLabel(), 'Randomize options');
28
+ utilities.verifyElementVisibilityState(listSortingPage.randomizeOptionsCheckboxLabel(), 'visible');
29
+ listSortingPage.steps.verifyRandomizeOptionsCheckboxUnchecked();
30
+ });
31
+
32
+ it('CSS of \'Randomize options\'', { tags: 'css' }, () => {
33
+ utilities.verifyCSS(listSortingPage.randomizeOptionsCheckboxLabel(), {
34
+ 'color': css.color.labelText,
35
+ 'font-size': css.fontSize.normal,
36
+ 'font-weight': css.fontWeight.regular
37
+ });
38
+ });
39
+
40
+ it('Accessibility of \'Randomize options\'', { tags: 'a11y' }, () => {
41
+ cy.checkAccessibility(listSortingPage.randomizeOptionsCheckbox().parents('[data-ngie-testid="randomize-options-checkbox"]'));
42
+ });
43
+
44
+ it('When the \'Randomize options\' functionality is disabled, the options in the set correct answer source section should be displayed in the order in which the user has set them in the \'Options\' section', () => {
45
+ listSortingPage.steps.verifyRandomizeOptionsCheckboxUnchecked();
46
+ listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(options);
47
+ });
48
+
49
+ it('When the user enables the \'Randomize options\' functionality, then the options in the set correct answer source section should be in the order in which the user has set them in the \'Options\' section', () => {
50
+ listSortingPage.steps.checkRandomizeOptionsCheckbox();
51
+ listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(options);
52
+ cy.log('Post step: Uncheck Randomize options checkbox')
53
+ listSortingPage.steps.uncheckRandomizeOptionsCheckbox();
54
+ });
55
+
56
+ it('When user sets the order in the target section when \'Randomize options\' functionality is enabled then the options in the set correct answer source section should be in the order in which the user has set them', () => {
57
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
58
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
59
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
60
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
61
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
62
+ listSortingPage.steps.checkRandomizeOptionsCheckbox();
63
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
64
+ });
65
+
66
+ it('CSS of \'Randomize options\' functionality - checked state', { tags: 'css' }, () => {
67
+ utilities.verifyCSS(listSortingPage.randomizeOptionsCheckbox().parents('[data-ngie-testid="randomize-options-checkbox"]').find('g').eq(1), {
68
+ 'fill': css.color.activeButtons
69
+ });
70
+ });
71
+
72
+ it('Accessibility of \'Randomize options\' functionality - checked state', { tags: 'a11y' }, () => {
73
+ cy.checkAccessibility(listSortingPage.randomizeOptionsCheckbox().parents('[data-ngie-testid="randomize-options-checkbox"]'))
74
+ });
75
+ });
76
+
77
+ describe('Randomize options - Functionality : Preview tab', () => {
78
+ let optionsArray = [];
79
+ abortEarlySetup();
80
+ before(() => {
81
+ cy.log('Navigating to list sorting question type');
82
+ listSortingPage.steps.navigateToCreateQuestion('list sorting');
83
+ cy.log('Adding question instructions, setting correct answer order and adding points');
84
+ cy.barsPreLoaderWait();
85
+ listSortingPage.steps.addQuestionInstructions();
86
+ listSortingPage.steps.addInputToOptionsInputField(options);
87
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
88
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
89
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
90
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
91
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
92
+ listSortingPage.steps.allotPoints('20');
93
+ });
94
+
95
+ it('When the \'Randomize options\' functionality is disabled, options in the preview tab should be displayed in the order in which the user has set them in the \'Options\' section', () => {
96
+ listSortingPage.steps.verifyRandomizeOptionsCheckboxUnchecked()
97
+ listSortingPage.steps.switchToPreviewTab();
98
+ listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(options);
99
+ });
100
+
101
+ it('When the user enables the \'Randomize options\' functionality, then options in preview tab should be displayed in a random order', () => {
102
+ listSortingPage.steps.switchToEditTab()
103
+ listSortingPage.steps.checkRandomizeOptionsCheckbox()
104
+ listSortingPage.steps.switchToPreviewTab();
105
+ listSortingPage.steps.verifyRandomizeOptionOrder(options);
106
+ optionsArray = listSortingPage.steps.getOptionsArray();
107
+ });
108
+
109
+ it('When the user switches to \'Edit tab\' and does not modify any question properties, then the order of the options should not change in the preview tab', () => {
110
+ listSortingPage.steps.switchToEditTab();
111
+ listSortingPage.steps.switchToPreviewTab();
112
+ listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(optionsArray);
113
+ });
114
+
115
+ it('When the user switches to \'Edit tab\' and modifies any of question properties, then the order of the options should change and the options should be displayed in the order in which the user has set them in the preview tab', () => {
116
+ listSortingPage.steps.switchToEditTab();
117
+ listSortingPage.steps.clearPointsField();
118
+ listSortingPage.steps.allotPoints(12);
119
+ listSortingPage.steps.switchToPreviewTab();
120
+ listSortingPage.steps.verifyRandomizeOptionOrder(options);
121
+ listSortingPage.steps.verifyOptionsAreRerandomized(optionsArray);
122
+ });
123
+
124
+ it('When the user disables the \'Randomize options\' functionality, then the options in the preview tab should be displayed in the order in which the user has set them in the \'Options\' section', () => {
125
+ listSortingPage.steps.switchToEditTab()
126
+ listSortingPage.steps.uncheckRandomizeOptionsCheckbox()
127
+ listSortingPage.steps.switchToPreviewTab();
128
+ listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(options);
129
+ });
130
+ });
131
+
132
+ describe('Hide drag handle - Functionality: Edit tab', () => {
133
+ abortEarlySetup();
134
+ before(() => {
135
+ cy.log('Navigating to list sorting question type');
136
+ listSortingPage.steps.navigateToCreateQuestion('list sorting');
137
+ cy.log('Adding question instructions, setting correct answer order and adding points');
138
+ cy.barsPreLoaderWait();
139
+ listSortingPage.steps.addQuestionInstructions();
140
+ listSortingPage.steps.addInputToOptionsInputField(options);
141
+ listSortingPage.steps.allotPoints('20');
142
+ });
143
+
144
+ it('When the \'Hide drag handle\' functionality is disabled, then the options displayed in response container of the \'Set correct answer\' section should have a drag handle', () => {
145
+ listSortingPage.steps.verifyHideDragHandleCheckboxUnchecked();
146
+ for (let index = 0; index < 4; index++) {
147
+ listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
148
+ }
149
+ });
150
+
151
+ it('When the \'Hide drag handle\' functionality is disabled, and the user sets answer in the \'Set correct answer\' section should not have a drag handle', () => {
152
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
153
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
154
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
155
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
156
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
157
+ for (let index = 0; index < 4; index++) {
158
+ listSortingPage.steps.verifyDragHandleButtonDoesNotExistInSetCorrectAnswerSection(index)
159
+ }
160
+ });
161
+
162
+ it('When the user enables the \'Hide drag handle\' functionality, then the options displayed in response container of the \'Set correct answer\' section should not have a drag handle', () => {
163
+ listSortingPage.steps.switchToEditTab();
164
+ listSortingPage.steps.checkHideDragHandleCheckbox();
165
+ for (let index = 0; index < 4; index++) {
166
+ listSortingPage.steps.verifyDragHandleButtonDoesNotExistInSetCorrectAnswerSection(index);
167
+ }
168
+ });
169
+
170
+ it('CSS of \'Hide drag handle\' functionality - checked state', { tags: 'css' }, () => {
171
+ utilities.verifyCSS(listSortingPage.hideDragHandleCheckbox().parents('[data-ngie-testid="hide-drag-handle-checkbox"]').find('g').eq(1), {
172
+ 'fill': css.color.activeButtons
173
+ });
174
+ });
175
+
176
+ it('Accessibility of \'Hide drag handle\' functionality - checked state', { tags: 'a11y' }, () => {
177
+ cy.checkAccessibility(listSortingPage.hideDragHandleCheckbox().parents('[data-ngie-testid="hide-drag-handle-checkbox"]'));
178
+ });
179
+
180
+ it('When user sets an answer in \'Set correct answer\' section when \'Hide drag handle\' functionality is enabled then drag handle buttons should not be displayed', () => {
181
+ listSortingPage.steps.clickAndDropOptionFromTargetToSourceInSetCorrectAnswerSection('seed', 0);
182
+ listSortingPage.steps.clickAndDropOptionFromTargetToSourceInSetCorrectAnswerSection('sprout', 1);
183
+ listSortingPage.steps.clickAndDropOptionFromTargetToSourceInSetCorrectAnswerSection('plant', 2);
184
+ listSortingPage.steps.clickAndDropOptionFromTargetToSourceInSetCorrectAnswerSection('flower', 3);
185
+ listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
186
+ for (let index = 0; index < 4; index++) {
187
+ listSortingPage.steps.verifyDragHandleButtonDoesNotExistInSetCorrectAnswerSection(index)
188
+ }
189
+ });
190
+
191
+ it('When the \'Hide drag handle\' functionality is disabled again, then the options displayed in response container of the \'Set correct answer\' section should have a drag handle', () => {
192
+ listSortingPage.steps.uncheckHideDragHandleCheckbox();
193
+ for (let index = 0; index < 4; index++) {
194
+ listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
195
+ }
196
+ });
197
+ });
198
+
199
+ describe('Hide drag handle - Functionality: Preview tab', () => {
200
+ abortEarlySetup();
201
+ before(() => {
202
+ cy.log('Navigating to list sorting question type');
203
+ listSortingPage.steps.navigateToCreateQuestion('list sorting');
204
+ cy.log('Adding question instructions, setting correct answer order and adding points');
205
+ cy.barsPreLoaderWait();
206
+ listSortingPage.steps.addQuestionInstructions();
207
+ listSortingPage.steps.addInputToOptionsInputField(options);
208
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
209
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
210
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
211
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
212
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
213
+ listSortingPage.steps.allotPoints('20');
214
+ });
215
+
216
+ it('When the \'Hide drag handle\' functionality is disabled, then the draggable options displayed in response container of the preview tab should have a drag handle', () => {
217
+ listSortingPage.steps.switchToPreviewTab();
218
+ for (let index = 0; index < 4; index++) {
219
+ listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index);
220
+ }
221
+ });
222
+
223
+ it('When user sets the order in the target section when \'Randomize options\' functionality is disabled then the options in the preview tab target section should not have drag handles', () => {
224
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
225
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
226
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 2);
227
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
228
+ listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(correctAnswerArray);
229
+ for (let index = 0; index < 4; index++) {
230
+ listSortingPage.steps.verifyDragHandleButtonDoesNotExistInPreviewTab(index)
231
+ }
232
+ });
233
+
234
+ it('When the \'Hide drag handle\' functionality is enabled, then the draggable options displayed in response container of the preview tab should not have a drag handle', () => {
235
+ listSortingPage.steps.switchToEditTab();
236
+ listSortingPage.steps.checkHideDragHandleCheckbox();
237
+ listSortingPage.steps.switchToPreviewTab();
238
+ for (let index = 0; index < 4; index++) {
239
+ listSortingPage.steps.verifyDragHandleButtonDoesNotExistInPreviewTab(index);
240
+ }
241
+ });
242
+
243
+ it('When user sets the order in the target section when \'Randomize options\' functionality is enabled then the options in the set correct answer source section then drag handles should not be displayed', () => {
244
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
245
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
246
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 2);
247
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
248
+ listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(correctAnswerArray);
249
+ for (let index = 0; index < 4; index++) {
250
+ listSortingPage.steps.verifyDragHandleButtonDoesNotExistInPreviewTab(index)
251
+ }
252
+ });
253
+
254
+ it('When the \'Hide drag handle\' functionality is disabled again, then the options displayed in response container of the \'Preview tab\' section should have a drag handle', () => {
255
+ listSortingPage.steps.switchToEditTab();
256
+ listSortingPage.steps.uncheckHideDragHandleCheckbox();
257
+ listSortingPage.steps.switchToPreviewTab();
258
+ for (let index = 0; index < 4; index++) {
259
+ listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
260
+ }
261
+ });
262
+ });
263
+ });
@@ -0,0 +1,168 @@
1
+ import { dialogBoxBase } from "../../../pages/dialogBoxBase";
2
+ import { listSortingPage } from "../../../pages/listSortingPage";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+ let options = ['plant', 'sprout', 'flower', 'seed'];
8
+
9
+ describe('Create Item page - list sorting: Set correct answer, Alternate correct answer - Edit tab cases', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Set Correct Answer section', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ cy.log('Navigating to list sorting question type');
18
+ listSortingPage.steps.navigateToCreateQuestion('list sorting');
19
+ listSortingPage.steps.addQuestionInstructions();
20
+ listSortingPage.steps.addInputToOptionsInputField(options);
21
+ });
22
+
23
+ listSortingPage.tests.verifyAutoScoredSetCorrectAnswerHeaderSectionContents('list sorting');
24
+
25
+ it('By default, 4 \'Options\' should be displayed with Drag handle in \'Set correct answer\' section', () => {
26
+ for (let index = 0; index < 4; index++) {
27
+ listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
28
+ }
29
+ utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 4);
30
+ utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), 4);
31
+ utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), 4);
32
+ utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), '');
33
+ });
34
+
35
+ it('When user clicks on Add alternate answer button without alloting points in the \'Set correct answer\' then a warning popup should be displayed', () => {
36
+ listSortingPage.steps.clickOnAddAlternateAnswerButton();
37
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
38
+ });
39
+
40
+ it('When user closes the warning popup \'Error: Please enter points\' and \'Error: Please set correct answer\' error message should be displayed', () => {
41
+ dialogBoxBase.steps.closeWarningPopup();
42
+ listSortingPage.steps.verifyPointsInputFieldErrorMessage()
43
+ listSortingPage.steps.verifySetCorrectAnswerErrorMessage()
44
+ listSortingPage.steps.verifySetCorrectAnswerErrorIconIsDisplayed();
45
+ });
46
+
47
+ it('When user allots points and sets correct answer then the error messages and error icon should disappear', () => {
48
+ listSortingPage.steps.allotPoints('10');
49
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
50
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
51
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
52
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
53
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
54
+ listSortingPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
55
+ listSortingPage.steps.verifyErrorMessageIsNotDisplayed();
56
+ cy.log('Post step: Clear points field')
57
+ listSortingPage.steps.clearPointsField();
58
+ });
59
+
60
+ listSortingPage.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty('Correct tab');
61
+
62
+ it('User should be able to add an alternate answer without ordering the options in the \'Set correct answer\' section when points are alloted', () => {
63
+ listSortingPage.steps.addAlternateTab(1);
64
+ });
65
+ });
66
+
67
+ describe('Alternate correct answer', () => {
68
+ abortEarlySetup();
69
+ before(() => {
70
+ cy.log('Navigating to list sorting question type');
71
+ listSortingPage.steps.navigateToCreateQuestion('list sorting');
72
+ listSortingPage.steps.addQuestionInstructions();
73
+ listSortingPage.steps.addInputToOptionsInputField(options);
74
+ });
75
+
76
+ listSortingPage.tests.verifyAutoScoredAlternateAnswer('list sorting');
77
+
78
+ it('When the user allots points to the \'Correct tab\' and sets correct answer order in the \'Set correct answer\' section then on clicking the \'Alternate tab\' button an alternate tab should be added', () => {
79
+ listSortingPage.steps.allotPoints('10');
80
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
81
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
82
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
83
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
84
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
85
+ listSortingPage.steps.verifyErrorMessageIsNotDisplayed();
86
+ listSortingPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
87
+ listSortingPage.steps.addAlternateTab(1);
88
+ });
89
+
90
+ it('When the user adds an alternate tab then the options should be displayed in the same order as they appear in the \'Options\' section', () => {
91
+ listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(options);
92
+ utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), '');
93
+ });
94
+
95
+ it('CSS of Alternate correct answer tab', { tags: 'css' }, () => {
96
+ utilities.verifyCSS(listSortingPage.alternateAnswerTab(1), {
97
+ 'color': css.color.secondaryBtnActive,
98
+ 'font-size': css.fontSize.default,
99
+ 'font-weight': css.fontWeight.bold
100
+ });
101
+ cy.log('CSS of inactive Correct answer tab')
102
+ utilities.verifyCSS(listSortingPage.correctTab(), {
103
+ 'color': css.color.labels,
104
+ 'font-size': css.fontSize.default,
105
+ 'font-weight': css.fontWeight.bold
106
+ });
107
+ });
108
+
109
+ it('Accessibility of Alternate correct answer tab', { tags: 'a11y' }, () => {
110
+ cy.checkAccessibility(listSortingPage.correctTab().parents('[class*="AlternatePointsComponentstyles__AnswerTabWrapper"]'));
111
+ });
112
+
113
+ it('User should be able set correct answer in the \'Alternate tab\' by ordering the options in the \'Alternate tab\'', () => {
114
+ listSortingPage.steps.allotPoints('5')
115
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
116
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 1);
117
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 2);
118
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 3);
119
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['seed', 'flower', 'sprout', 'plant']);
120
+ utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), '');
121
+ });
122
+
123
+ it('When user switches to the \'Correct tab\' from the \'Alternate tab\' the order of options set in the \'Correct tab\' should remain the same', () => {
124
+ listSortingPage.steps.navigateToCorrectTab();
125
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
126
+ utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), '');
127
+ });
128
+
129
+ it('User should be able to add another alternate tab for the question using \'Add Alternate Answer\' button and the name for this new tab should be \'Alternate 2\'', () => {
130
+ listSortingPage.steps.addAlternateTab(2);
131
+ });
132
+
133
+ it('When the user adds an alternate tab then the options should be displayed in the same order as they appear in the \'Options\' section', () => {
134
+ listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(options);
135
+ });
136
+
137
+ listSortingPage.tests.verifyWarningPopupAndTabNavigationWhenNoPointsAddedInAlternateTab();
138
+
139
+ //Failing due to - https://redmine.zeuslearning.com/issues/540801
140
+ it('When the user clicks on the \'Close\' button alongside alternate answer tab, alternate answer tab should get removed and the name of the alternate answer tabs should get updated and the order of the options should be displayed accordingly', () => {
141
+ cy.log('Set correct answer and points in alternate 2 tab, then switch to Alternate 1 tab and click delete icon button');
142
+ listSortingPage.steps.allotPoints('2');
143
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 0);
144
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
145
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 2);
146
+ listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 3);
147
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['plant', 'sprout', 'flower', 'seed']);
148
+ listSortingPage.steps.navigateToAlternateTab(1);
149
+ listSortingPage.steps.deleteAlternateTab();
150
+ utilities.verifyElementVisibilityState(listSortingPage.alternateAnswerTab(2), 'notExist');
151
+ utilities.verifyInnerText(listSortingPage.alternateAnswerTab(1), 'Alternate 1')
152
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['plant', 'sprout', 'flower', 'seed']);
153
+ utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), '');
154
+ });
155
+
156
+ //Failing due to - https://redmine.zeuslearning.com/issues/540535
157
+ it('When user deletes an option from the \'Options\' section the order should remain the same without the deleted option in the \'Correct tab\' and \'Alternate tab\' and no error message should be displayed', () => {
158
+ listSortingPage.steps.navigateToCorrectTab();
159
+ listSortingPage.steps.deleteOption(0);
160
+ listSortingPage.steps.verifyErrorMessageIsNotDisplayed();
161
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['seed', 'sprout', 'flower']);
162
+ utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), '');
163
+ listSortingPage.steps.navigateToAlternateTab(1);
164
+ listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['sprout', 'flower', 'seed']);
165
+ utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), '');
166
+ });
167
+ });
168
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.32",
3
+ "version": "1.0.36",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {