itemengine-cypress-automation 1.0.32 → 1.0.37

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/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/listSortingAdditionalSettingsAnswerNumerationAndOptionStyleDropdown.js +319 -0
  50. package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettingsBasic.js +326 -0
  51. package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettingsOptionLabelSection.js +202 -0
  52. package/cypress/e2e/ILC/ListSorting/listSortingAllOrNothingScoring.js +188 -0
  53. package/cypress/e2e/ILC/ListSorting/listSortingAllOrNothingScoringWithAlternateAnswer.js +759 -0
  54. package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +936 -0
  55. package/cypress/e2e/ILC/ListSorting/listSortingClickAndDrop.js +456 -0
  56. package/cypress/e2e/ILC/ListSorting/listSortingEditTabBasicSection.js +165 -0
  57. package/cypress/e2e/ILC/ListSorting/listSortingEditTabScoringSection.js +259 -0
  58. package/cypress/e2e/ILC/ListSorting/listSortingHeaderSection.js +89 -0
  59. package/cypress/e2e/ILC/ListSorting/listSortingManuallyAndNonScoredScoring.js +171 -0
  60. package/cypress/e2e/ILC/ListSorting/listSortingOptionsSection.js +287 -0
  61. package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoring.js +210 -0
  62. package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoringWithAlternateTab.js +952 -0
  63. package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoring.js +207 -0
  64. package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoringWithAlternateAnswer.js +860 -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,185 @@
1
+ import { listMatchingPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ let stems = ['Stem 1', 'Stem 2', 'Stem 3'];
5
+ let optionsForResponses = ['Correct answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3'];
6
+
7
+ describe('Create Item page - List Matching: Randomize options, Reuse options, Hide drag handle functionalities for \'Standard\' response option layout in preview tab', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Randomize options - Functionality : Preview tab', () => {
13
+ let optionsArray = [];
14
+ let stemsArray = [];
15
+ abortEarlySetup();
16
+ before(() => {
17
+ cy.log('Navigating to List Matching question type');
18
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
19
+ cy.barsPreLoaderWait();
20
+ listMatchingPage.steps.addInputToAllStemFields(stems);
21
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
22
+ listMatchingPage.steps.allotPoints('10');
23
+ listMatchingPage.steps.switchToPreviewTab();
24
+ });
25
+
26
+ it('When the \'Randomize options\' functionality is disabled, then the draggable options in the response container should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
27
+ listMatchingPage.steps.verifyOptionsInPreviewTab(optionsForResponses);
28
+ });
29
+
30
+ it('When the \'Randomize options\' functionality is disabled, the stem fields should be displayed in the order in which the user has set them in the Stems section', () => {
31
+ listMatchingPage.steps.verifyStemFieldsInPreviewTab(stems);
32
+ });
33
+
34
+ it('When the user enables the \'Randomize options\' functionality, then the draggable options in the response container should be displayed in a random order', () => {
35
+ listMatchingPage.steps.switchToEditTab();
36
+ listMatchingPage.steps.checkRandomizeOptionsCheckbox();
37
+ cy.log('Added wait here to prevent cypress from switching to preview tab just after checking randomize options checkbox');
38
+ cy.wait(1000);
39
+ listMatchingPage.steps.switchToPreviewTab();
40
+ listMatchingPage.steps.verifyRandomizeOptionOrder(optionsForResponses, 'List matching');
41
+ optionsArray = listMatchingPage.steps.getOptionsArray('List Matching');
42
+ });
43
+
44
+ it('When the user enables the \'Randomize options\' functionality, then the stem fields should be displayed in a random order', () => {
45
+ listMatchingPage.steps.verifyRandomizedStemsOrder(stems);
46
+ stemsArray = listMatchingPage.steps.getStemsArray();
47
+ });
48
+
49
+ it('When the user switches to \'Edit tab\' and does not modify any question properties, then the order of the draggable options should not change in the response container', () => {
50
+ listMatchingPage.steps.switchToEditTab();
51
+ listMatchingPage.steps.switchToPreviewTab();
52
+ listMatchingPage.steps.verifyOptionsInPreviewTab(optionsArray);
53
+ });
54
+
55
+ it('When the user switches to \'Edit tab\' and does not modify any question properties, then the order of the stem fields should not change in the response container', () => {
56
+ listMatchingPage.steps.switchToEditTab();
57
+ listMatchingPage.steps.switchToPreviewTab();
58
+ listMatchingPage.steps.verifyStemFieldsInPreviewTab(stemsArray);
59
+ });
60
+
61
+ it('When the user switches to \'Edit tab\' and modifies any of question properties, then the order of the draggable options should change in the response container', () => {
62
+ listMatchingPage.steps.switchToEditTab();
63
+ listMatchingPage.steps.allotPoints(5);
64
+ cy.log('Added wait here to prevent cypress from switching to preview tab just after modifying the question');
65
+ cy.wait(1000);
66
+ listMatchingPage.steps.switchToPreviewTab();
67
+ listMatchingPage.steps.verifyRandomizeOptionOrder(optionsForResponses, 'List matching');
68
+ listMatchingPage.steps.verifyRerandomizedOptionsOrder(optionsArray, 'List matching')
69
+ });
70
+
71
+ it('When the user switches to \'Edit tab\' and modifies any of question properties, then the order of the stem fields should change in the response container', () => {
72
+ listMatchingPage.steps.switchToEditTab();
73
+ listMatchingPage.steps.selectPartialEqualWeightsCheckbox();
74
+ cy.log('Added wait here to prevent cypress from switching to preview tab just after modifying the question');
75
+ cy.wait(1000);
76
+ listMatchingPage.steps.switchToPreviewTab();
77
+ listMatchingPage.steps.verifyRandomizedStemsOrder(stems);
78
+ listMatchingPage.steps.verifyRerandomizedStemsOrder(stemsArray);
79
+ });
80
+
81
+ it('When the user disables the \'Randomize options\' functionality, then the draggable options in the response container should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
82
+ listMatchingPage.steps.switchToEditTab();
83
+ listMatchingPage.steps.uncheckRandomizeOptionsCheckbox();
84
+ listMatchingPage.steps.switchToPreviewTab();
85
+ listMatchingPage.steps.verifyOptionsInPreviewTab(optionsForResponses);
86
+ });
87
+
88
+ it('When the user has disabled the \'Randomize options\' functionality, then the stem fields should be displayed in the order in which the user has set them in the set correct answer section', () => {
89
+ listMatchingPage.steps.verifyStemFieldsInPreviewTab(stems)
90
+ });
91
+ });
92
+
93
+ describe('Reuse options - Functionality: Preview tab', () => {
94
+ abortEarlySetup();
95
+ before(() => {
96
+ cy.log('Navigating to List Matching question type');
97
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
98
+ cy.barsPreLoaderWait();
99
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
100
+ });
101
+
102
+ it('When the \'Reuse options\' functionality is disabled, then on attempting the question, the draggable options should get removed from the response container', () => {
103
+ listMatchingPage.steps.switchToPreviewTab();
104
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
105
+ listMatchingPage.steps.verifyFilledOptionResponseAreaInPreviewTab(0, 'Correct answer for stem 1')
106
+ listMatchingPage.steps.verifyOptionsInPreviewTab([optionsForResponses[1], optionsForResponses[2]]);
107
+ });
108
+
109
+ it('When the \'Reuse options\' functionality is enabled, then on attempting the question, the draggable options should persist in the response container', () => {
110
+ listMatchingPage.steps.switchToEditTab();
111
+ listMatchingPage.steps.checkReuseOptionsCheckbox();
112
+ listMatchingPage.steps.switchToPreviewTab();
113
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
114
+ listMatchingPage.steps.verifyFilledOptionResponseAreaInPreviewTab(0, 'Correct answer for stem 1');
115
+ listMatchingPage.steps.verifyOptionsInPreviewTab(optionsForResponses);
116
+ });
117
+
118
+ it('The user should be able to use the same draggable option for multiple response areas', () => {
119
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
120
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 1);
121
+ listMatchingPage.steps.verifyFilledOptionResponseAreaInPreviewTab(0, 'Correct answer for stem 1');
122
+ listMatchingPage.steps.verifyFilledOptionResponseAreaInPreviewTab(1, 'Correct answer for stem 1');
123
+ listMatchingPage.steps.verifyOptionsInPreviewTab(optionsForResponses);
124
+ });
125
+
126
+ it('When the user removes the option from the response area and moves it into the grouped container, only one option should be displayed in the respective group', () => {
127
+ listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(0);
128
+ listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab(1);
129
+ listMatchingPage.steps.verifyOptionsInPreviewTab(optionsForResponses);
130
+ });
131
+
132
+ it('When the user disables the \'Reuse options\' functionality, then on attempting the question, the draggable options should get removed from the response container', () => {
133
+ listMatchingPage.steps.switchToEditTab();
134
+ listMatchingPage.steps.uncheckReuseOptionsCheckbox();
135
+ listMatchingPage.steps.switchToPreviewTab();
136
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
137
+ listMatchingPage.steps.verifyFilledOptionResponseAreaInPreviewTab(0, 'Correct answer for stem 1');
138
+ listMatchingPage.steps.verifyOptionsInPreviewTab([optionsForResponses[1], optionsForResponses[2]]);
139
+ });
140
+ });
141
+
142
+ describe('Reuse options - Scoring', () => {
143
+ abortEarlySetup();
144
+ before(() => {
145
+ cy.log('Navigating to List Matching question type');
146
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
147
+ cy.barsPreLoaderWait();
148
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
149
+ listMatchingPage.steps.checkReuseOptionsCheckbox();
150
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
151
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 1);
152
+ listMatchingPage.steps.allotPoints(5);
153
+ listMatchingPage.steps.switchToPreviewTab();
154
+ });
155
+
156
+ it('When the user has set same answer options in the \'Set correct answer\' section, then the user should be awarded full points on attempting the question with reused options', () => {
157
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 0);
158
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInPreviewTab('Correct answer for stem 1', 1);
159
+ listMatchingPage.previewScoreText()
160
+ .verifyInnerText('5/5');
161
+ listMatchingPage.steps.verifyOptionsInPreviewTab(optionsForResponses);
162
+ });
163
+ });
164
+
165
+ describe('Hide drag handle - Functionality: Preview tab', () => {
166
+ abortEarlySetup();
167
+ before(() => {
168
+ cy.log('Navigating to List Matching question type');
169
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
170
+ cy.barsPreLoaderWait();
171
+ });
172
+
173
+ 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', () => {
174
+ listMatchingPage.steps.switchToPreviewTab();
175
+ listMatchingPage.steps.verifyDragIconVisibleInOptionsInPreviewTab('list matching');
176
+ });
177
+
178
+ 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', () => {
179
+ listMatchingPage.steps.switchToEditTab();
180
+ listMatchingPage.steps.checkHideDragHandleCheckbox();
181
+ listMatchingPage.steps.switchToPreviewTab();
182
+ listMatchingPage.steps.verifyDragIconNotVisibleInOptionsInPreviewTab('list matching');
183
+ });
184
+ });
185
+ });
@@ -0,0 +1,47 @@
1
+ import { listMatchingPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+ let optionsForResponses = ['Response 1', 'Response 2', 'Response 3'];
5
+ let optionsForResponses2 = ['Response 4', 'Response 5'];
6
+ let optionsForResponses3 = ['Response 1', 'Response 2', 'Response 3', 'Response 4', 'Response 5'];
7
+
8
+ describe('Create Item Page: List matching: Switching cases between \'Standard\' and \'Grouped\' response layouts', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('List matching: Switching cases between \'Standard\' and \'Grouped\' response layouts: \'Response Options section\'', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ cy.log('Navigating to List Matching question type');
17
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
18
+ cy.barsPreLoaderWait();
19
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
20
+ });
21
+
22
+ it('When the user switches from \'Standard\' response layout to \'Grouped\', all the option input fields along with text should appear in the group options', () => {
23
+ listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
24
+ listMatchingPage.steps.verifyOptionInputFieldContentsInOptionsSection(optionsForResponses);
25
+ cy.log('verifying draggable options in \'Set correct answer\' section')
26
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForResponses);
27
+ });
28
+
29
+ it('When the user creates more than one group of options and switches to \'Standard\' response layout, all the option input fields along with text should appear in the standard options', () => {
30
+ cy.log('Adding a new group and adding input to the option fields')
31
+ listMatchingPage.steps.addGroup();
32
+ listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, optionsForResponses2);
33
+ listMatchingPage.steps.selectResponseOptionsLayout('Standard');
34
+ listMatchingPage.steps.verifyOptionInputFieldContentsInOptionsSection(optionsForResponses3);
35
+ cy.log('verifying draggable options in \'Set correct answer\' section')
36
+ listMatchingPage.steps.verifyDraggableResponsesSetCorrectAnswer('List matching', optionsForResponses3);
37
+ });
38
+
39
+ it('On switching back to \'Grouped\' response layout, all option input fields should be present under Group A and no other group should exist', () => {
40
+ listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
41
+ listMatchingPage.steps.verifyCountOfGroupsInSetCorrectAnswerSection(1);
42
+ listMatchingPage.steps.verifyOptionInputFieldContentsInOptionsSection(optionsForResponses3);
43
+ cy.log('verifying draggable options in \'Set correct answer\' section')
44
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForResponses3);
45
+ });
46
+ });
47
+ });
@@ -0,0 +1,295 @@
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 numbers = ['1', '2', '3', '4'];
8
+ const lowercase = ['a', 'b', 'c', 'd'];
9
+ const uppercase = ['A', 'B', 'C', 'D'];
10
+ let options = ['plant', 'sprout', 'flower', 'seed'];
11
+ let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
12
+
13
+ describe('Create Item page - List ordering: Additional settings - Answer numeration (only while grading) and option label section', () => {
14
+ before(() => {
15
+ cy.loginAs('admin');
16
+ });
17
+
18
+
19
+ describe('Additional settings: Student response area and layout', () => {
20
+ abortEarlySetup();
21
+ before(() => {
22
+ cy.log('Navigating to list ordering question type');
23
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
24
+ listOrderingPage.steps.expandAdditonalSettings();
25
+ });
26
+
27
+ listOrderingPage.tests.verifyStudentResponseAreaAndLayoutLabelAndCSS();
28
+ //Note: a11y covered in verifyAdditonalSettingsAccordionProperties
29
+ });
30
+
31
+ describe('Additional settings: Answer numeration (only while grading) contents', () => {
32
+ abortEarlySetup();
33
+ before(() => {
34
+ cy.log('Navigating to list ordering question type');
35
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
36
+ listOrderingPage.steps.expandAdditonalSettings();
37
+ });
38
+
39
+ listOrderingPage.tests.verifyAnswerNumerationContents();
40
+ });
41
+
42
+ describe('Additional settings: Answer Numeration (only while grading) set correct answer section', () => {
43
+ abortEarlySetup();
44
+ before(() => {
45
+ cy.log('Navigating to list ordering question type');
46
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
47
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
48
+ cy.barsPreLoaderWait();
49
+ listOrderingPage.steps.addQuestionInstructions();
50
+ listOrderingPage.steps.addInputToOptionsInputField(options);
51
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
52
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
53
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
54
+ listOrderingPage.steps.allotPoints('20');
55
+ listOrderingPage.steps.expandAdditonalSettings();
56
+ listOrderingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
57
+ });
58
+
59
+ listOrderingPage.tests.verifyAnswerNumerationFunctionalityInSetCorrectAnswerSection(answerNumerationDropdownOptions);
60
+ });
61
+
62
+ describe('Additional settings: Answer Numeration (only while grading) preview tab', () => {
63
+ abortEarlySetup();
64
+ before(() => {
65
+ cy.log('Navigating to list ordering question type');
66
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
67
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
68
+ cy.barsPreLoaderWait();
69
+ listOrderingPage.steps.addQuestionInstructions();
70
+ listOrderingPage.steps.addInputToOptionsInputField(options);
71
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
72
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
73
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
74
+ listOrderingPage.steps.allotPoints('20');
75
+ listOrderingPage.steps.expandAdditonalSettings();
76
+ listOrderingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
77
+ });
78
+
79
+ it(`When the user selects ${answerNumerationDropdownOptions[0]} option from the Answer Numeration dropdown and has not selected show correct answer checkbox or check answer button then option numeration should not be displayed in the preview tab`, () => {
80
+ listOrderingPage.steps.switchToEditTab();
81
+ utilities.verifyInnerText(listOrderingPage.answerNumerationDropdown(), `${answerNumerationDropdownOptions[0]}`)
82
+ listOrderingPage.steps.switchToPreviewTab();
83
+ utilities.verifyElementVisibilityState(listOrderingPage.optionNumeration(), 'notExist');
84
+ });
85
+
86
+ listOrderingPage.tests.verifyOptionsAndCorrectAnswerContainerNumerationWhenShowCorrectAnswerCheckboxIsChecked(numbers);
87
+
88
+ listOrderingPage.tests.verifyOptionsNumerationWhenCheckAnswerIsSelected(numbers)
89
+
90
+ it(`When the user selects ${answerNumerationDropdownOptions[1]} option from the Answer Numeration dropdownand has not selected show correct answer checkbox or check answer button then option numeration should not be displayed in the preview tab`, () => {
91
+ listOrderingPage.steps.switchToEditTab();
92
+ listOrderingPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[1]}`);
93
+ listOrderingPage.steps.switchToPreviewTab();
94
+ utilities.verifyElementVisibilityState(listOrderingPage.optionNumeration(), 'notExist');
95
+ });
96
+
97
+ listOrderingPage.tests.verifyOptionsAndCorrectAnswerContainerNumerationWhenShowCorrectAnswerCheckboxIsChecked(uppercase);
98
+
99
+ listOrderingPage.tests.verifyOptionsNumerationWhenCheckAnswerIsSelected(uppercase)
100
+
101
+ it(`When the user selects ${answerNumerationDropdownOptions[2]} option from the Answer Numeration dropdownand has not selected show correct answer checkbox or check answer button then option numeration should not be displayed in the preview tab`, () => {
102
+ listOrderingPage.steps.switchToEditTab();
103
+ listOrderingPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[2]}`);
104
+ listOrderingPage.steps.switchToPreviewTab();
105
+ utilities.verifyElementVisibilityState(listOrderingPage.optionNumeration(), 'notExist');
106
+ });
107
+
108
+ listOrderingPage.tests.verifyOptionsAndCorrectAnswerContainerNumerationWhenShowCorrectAnswerCheckboxIsChecked(lowercase);
109
+
110
+ listOrderingPage.tests.verifyOptionsNumerationWhenCheckAnswerIsSelected(lowercase)
111
+ });
112
+
113
+ describe('Additional settings: Option label section contents', () => {
114
+ abortEarlySetup();
115
+ before(() => {
116
+ cy.log('Navigating to list ordering question type');
117
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
118
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
119
+ cy.barsPreLoaderWait();
120
+ listOrderingPage.steps.addQuestionInstructions();
121
+ listOrderingPage.steps.addInputToOptionsInputField(options);
122
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
123
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
124
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
125
+ listOrderingPage.steps.allotPoints('20');
126
+ listOrderingPage.steps.expandAdditonalSettings();
127
+ });
128
+
129
+ it('\'Option label\' should be displayed', () => {
130
+ utilities.verifyInnerText(listOrderingPage.optionLabelLabel(), 'Option label');
131
+ utilities.verifyElementVisibilityState(listOrderingPage.optionLabelLabel(), 'visible');
132
+ });
133
+
134
+ it('\'Include labels\' label and checkbox should be displayed and it should be unchecked by default', () => {
135
+ utilities.verifyInnerText(listOrderingPage.includeLabelsLabel(), 'Include labels');
136
+ utilities.verifyElementVisibilityState(listOrderingPage.includeLabelsCheckbox(), 'exist');
137
+ listOrderingPage.steps.verifyIncludeLablesCheckboxIsUnchecked()
138
+ });
139
+
140
+ it('\'Top label\' and \'Bottom label\' labels and input fields should be displayed and they should be disabled by default', () => {
141
+ utilities.verifyInnerText(listOrderingPage.topLabelLabel(), 'Top label');
142
+ utilities.verifyElementVisibilityState(listOrderingPage.topLabelInputField(), 'exist');
143
+ listOrderingPage.steps.verifyTopLabelInputFieldDisabled();
144
+ utilities.verifyInnerText(listOrderingPage.bottomLabelLabel(), 'Bottom label');
145
+ utilities.verifyElementVisibilityState(listOrderingPage.bottomLabelInputField(), 'exist');
146
+ listOrderingPage.steps.verifyBottomLabelInputFieldDisabled();
147
+ });
148
+
149
+ it('When the user selects \'Include labels\' checkbox then the \'Top label\' and \'Bottom label\' input fields should be enabled', () => {
150
+ listOrderingPage.steps.checkIncludeLablesCheckbox();
151
+ listOrderingPage.steps.verifyTopLabelInputFieldEnabled();
152
+ listOrderingPage.steps.verifyBottomLabelInputFieldEnabled();
153
+ });
154
+
155
+ it('When the \'Include labels\' checkbox is checked user should be able to add inputs to \'Top label\' and \'Bottom label\' input fields', () => {
156
+ listOrderingPage.steps.addInputToTopLabelInputField('Top label');
157
+ listOrderingPage.steps.addInputToBottomLabelInputField('Bottom label');
158
+ });
159
+
160
+ it('CSS of \'Option label\' section', { tags: 'css' }, () => {
161
+ utilities.verifyCSS(listOrderingPage.optionLabelLabel(), {
162
+ 'color': css.color.labels,
163
+ 'font-size': css.fontSize.default,
164
+ 'font-weight': css.fontWeight.semibold
165
+ });
166
+ utilities.verifyCSS(listOrderingPage.includeLabelsLabel(), {
167
+ 'color': css.color.labelText,
168
+ 'font-size': css.fontSize.normal,
169
+ 'font-weight': css.fontWeight.regular
170
+ });
171
+ utilities.verifyCSS(listOrderingPage.includeLabelsCheckbox().parents('.ngie-checkbox-control-label').find('.checkbox-icon-border-rect'), {
172
+ 'fill': css.color.activeButtons
173
+ });
174
+ utilities.verifyCSS(listOrderingPage.topLabelLabel(), {
175
+ 'color': css.color.labels,
176
+ 'font-size': css.fontSize.normal,
177
+ 'font-weight': css.fontWeight.semibold
178
+ });
179
+ utilities.verifyCSS(listOrderingPage.topLabelInputField(), {
180
+ 'color': css.color.text,
181
+ 'font-size': css.fontSize.default,
182
+ 'font-weight': css.fontWeight.regular
183
+ });
184
+ utilities.verifyCSS(listOrderingPage.bottomLabelLabel(), {
185
+ 'color': css.color.labels,
186
+ 'font-size': css.fontSize.normal,
187
+ 'font-weight': css.fontWeight.semibold
188
+ });
189
+ utilities.verifyCSS(listOrderingPage.bottomLabelInputField(), {
190
+ 'color': css.color.text,
191
+ 'font-size': css.fontSize.default,
192
+ 'font-weight': css.fontWeight.regular
193
+ });
194
+ });
195
+
196
+ it('Accessibility of Option label section', { tags: 'a11y' }, () => {
197
+ cy.checkAccessibility(listOrderingPage.optionLabelLabel().parents('.special-character-wrapper'))
198
+ });
199
+ });
200
+
201
+ describe('Additional settings: Option label set correct answer section', () => {
202
+ abortEarlySetup();
203
+ before(() => {
204
+ cy.log('Navigating to list ordering question type');
205
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
206
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
207
+ cy.barsPreLoaderWait();
208
+ listOrderingPage.steps.addQuestionInstructions();
209
+ listOrderingPage.steps.addInputToOptionsInputField(options);
210
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
211
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
212
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
213
+ listOrderingPage.steps.allotPoints('20');
214
+ listOrderingPage.steps.expandAdditonalSettings();
215
+ listOrderingPage.steps.checkIncludeLablesCheckbox();
216
+ });
217
+
218
+ it('When user adds input to \'Top label\' then it should be displayed at the top of the options in the \'Set correct answer\' section', () => {
219
+ listOrderingPage.steps.addInputToTopLabelInputField('Top label');
220
+ utilities.verifyInnerText(listOrderingPage.setCorrectAnswerSectionTopLabel(), 'Top label');
221
+ utilities.verifyElementVisibilityState(listOrderingPage.setCorrectAnswerSectionBottomLabel(), 'hidden');
222
+ cy.log('Post step: Clear top label input field')
223
+ listOrderingPage.steps.clearTopLabelInputField();
224
+ });
225
+
226
+ it('When user adds input to \'Bottom label\' then it should be displayed at the bottom of the options in the \'Set correct answer\' section ', () => {
227
+ listOrderingPage.steps.addInputToBottomLabelInputField('Bottom label');
228
+ utilities.verifyInnerText(listOrderingPage.setCorrectAnswerSectionBottomLabel(), 'Bottom label');
229
+ utilities.verifyElementVisibilityState(listOrderingPage.setCorrectAnswerSectionTopLabel(), 'hidden');
230
+ });
231
+
232
+ it('When user adds input to both \'Top label\' and \'Bottom label\' then it should be displayed at the top and bottom of the options in the \'Set correct answer\' section respectively', () => {
233
+ listOrderingPage.steps.addInputToTopLabelInputField('Top label');
234
+ utilities.verifyInnerText(listOrderingPage.setCorrectAnswerSectionTopLabel(), 'Top label');
235
+ utilities.verifyInnerText(listOrderingPage.setCorrectAnswerSectionBottomLabel(), 'Bottom label');
236
+ });
237
+
238
+ it('When user unchecks the \'Include labels\' checkbox then the labels should not be displayed in the \'Set correct answer\' section', () => {
239
+ listOrderingPage.steps.uncheckIncludeLablesCheckbox();
240
+ utilities.verifyElementVisibilityState(listOrderingPage.setCorrectAnswerSectionTopLabel(), 'notExist');
241
+ utilities.verifyElementVisibilityState(listOrderingPage.setCorrectAnswerSectionBottomLabel(), 'notExist');
242
+ });
243
+ });
244
+
245
+ describe('Additional settings: Option label preview tab', () => {
246
+ abortEarlySetup();
247
+ before(() => {
248
+ cy.log('Navigating to list ordering question type');
249
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
250
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
251
+ cy.barsPreLoaderWait();
252
+ listOrderingPage.steps.addQuestionInstructions();
253
+ listOrderingPage.steps.addInputToOptionsInputField(options);
254
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
255
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
256
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
257
+ listOrderingPage.steps.allotPoints('20');
258
+ listOrderingPage.steps.expandAdditonalSettings();
259
+ listOrderingPage.steps.checkIncludeLablesCheckbox();
260
+ });
261
+
262
+ it('When user adds input to \'Top label\' then it should be displayed at the top of the options in the \'Preview tab\'', () => {
263
+ listOrderingPage.steps.addInputToTopLabelInputField('Top label');
264
+ listOrderingPage.steps.switchToPreviewTab();
265
+ utilities.verifyInnerText(listOrderingPage.previewTabTopLabel(), 'Top label');
266
+ utilities.verifyElementVisibilityState(listOrderingPage.previewTabBottomLabel(), 'hidden');
267
+ listOrderingPage.steps.switchToEditTab();
268
+ cy.log('Post step: Clear top label input field')
269
+ listOrderingPage.steps.clearTopLabelInputField();
270
+ });
271
+
272
+ it('When user adds input to \'Bottom label\' then it should be displayed at the bottom of the options in the \'Preview tab\' ', () => {
273
+ listOrderingPage.steps.addInputToBottomLabelInputField('Bottom label');
274
+ listOrderingPage.steps.switchToPreviewTab();
275
+ utilities.verifyInnerText(listOrderingPage.previewTabBottomLabel(), 'Bottom label');
276
+ utilities.verifyElementVisibilityState(listOrderingPage.previewTabTopLabel(), 'hidden');
277
+ });
278
+
279
+ it('When user adds input to both \'Top label\' and \'Bottom label\' then it should be displayed at the top and bottom of the options in the \'Preview tab\' respectively', () => {
280
+ listOrderingPage.steps.switchToEditTab();
281
+ listOrderingPage.steps.addInputToTopLabelInputField('Top label');
282
+ listOrderingPage.steps.switchToPreviewTab();
283
+ utilities.verifyInnerText(listOrderingPage.previewTabTopLabel(), 'Top label');
284
+ utilities.verifyInnerText(listOrderingPage.previewTabBottomLabel(), 'Bottom label');
285
+ });
286
+
287
+ it('When user unchecks the \'Include labels\' checkbox then the labels should not be displayed in the \'Preview tab\'', () => {
288
+ listOrderingPage.steps.switchToEditTab();
289
+ listOrderingPage.steps.uncheckIncludeLablesCheckbox();
290
+ listOrderingPage.steps.switchToPreviewTab();
291
+ utilities.verifyElementVisibilityState(listOrderingPage.previewTabTopLabel(), 'notExist');
292
+ utilities.verifyElementVisibilityState(listOrderingPage.previewTabBottomLabel(), 'notExist');
293
+ });
294
+ });
295
+ });