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,36 @@
1
+ import { listMatchingPage, listMatchingScoring } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create Item page - List Matching - standard options layout - Partial different weights scoring with alternate answer', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: AutoScored - Partial different weights standard options layout with alternate answer', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ cy.log('Navigate to List Matching question type, adding correct answer responses and alternate answer responses for autoscored - partial different scoring, adding points and switch to preview tab');
13
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
14
+ cy.barsPreLoaderWait();
15
+ listMatchingPage.steps.setQuestionStemsAndOptionsForScoringWithAlternateTab();
16
+ listMatchingPage.steps.setCorrectAnswersForCorrectTab();
17
+ listMatchingPage.steps.selectPartialDifferentWeightsCheckbox();
18
+ listMatchingPage.steps.addPartialDifferentWeightsPoints([5, 7, 4, 8]);
19
+ listMatchingPage.steps.clickOnAddAlternateAnswerButton();
20
+ listMatchingPage.steps.setCorrectAnswersForAlternateTab();
21
+ listMatchingPage.steps.addPartialDifferentWeightsPoints([3, 9, 2, 6]);
22
+ listMatchingPage.steps.uncheckRoundDownScoreCheckbox();
23
+ listMatchingPage.steps.expandAdditonalSettings();
24
+ listMatchingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
25
+ listMatchingPage.steps.switchToPreviewTab();
26
+ });
27
+
28
+ listMatchingScoring.tests.verifyAutoScoredPartialDifferentWeightsScoringWithAlternateAnswer('standard');
29
+
30
+ listMatchingScoring.tests.verifyMinimumScoreAwardedIfAttemptedForIncorrectAnswer('24');
31
+
32
+ listMatchingScoring.tests.verifyPenaltyPointsAwardedForIncorrectAnswer('5', '24');
33
+
34
+ listMatchingScoring.tests.verifyPointsAwardedForIncorrectAnswerWhenMinimumScoreAwardedAndPenaltyPointsAreDefined('5', '24');
35
+ });
36
+ });
@@ -0,0 +1,48 @@
1
+ import { listMatchingPage, listMatchingScoring } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create Item page - List Matching - standard options layout - Partial equal weights scoring', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: AutoScored - Partial equal weights standard options layout', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ cy.log('Navigate to question, add input to stems and options, set correct answers and allocate points, switch to partial equal weights scoring, allow students to check answer, switch to preview tab');
13
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
14
+ cy.barsPreLoaderWait();
15
+ listMatchingPage.steps.setQuestionStemsAndOptionsForScoringWithoutAlternateTab();
16
+ listMatchingPage.steps.selectPartialEqualWeightsCheckbox()
17
+ listMatchingPage.steps.allotPoints(20);
18
+ listMatchingPage.steps.setCorrectAnswersForScoringWithoutAlternateTab();
19
+ listMatchingPage.steps.expandAdditonalSettings();
20
+ listMatchingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
21
+ listMatchingPage.steps.switchToPreviewTab();
22
+ });
23
+
24
+ listMatchingScoring.tests.verifyAutoScoredPartialEqualWeightsScoring();
25
+
26
+ listMatchingScoring.tests.verifyMinimumScoreAwardedIfAttemptedForIncorrectAnswer('20');
27
+
28
+ listMatchingScoring.tests.verifyPenaltyPointsAwardedForIncorrectAnswer('8', '20');
29
+
30
+ listMatchingScoring.tests.verifyPointsAwardedForIncorrectAnswerWhenMinimumScoreAwardedAndPenaltyPointsAreDefined('8', '20');
31
+ });
32
+
33
+ describe('Question Preview: AutoScored - Partial equal weights standard options layout - Round down score', () => {
34
+ abortEarlySetup();
35
+ before(() => {
36
+ cy.log('Navigate to question, add input to stems and options, set correct answers and allocate points, switch to partial equal weights scoring, allow students to check answer, switch to preview tab');
37
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
38
+ cy.barsPreLoaderWait();
39
+ listMatchingPage.steps.setQuestionStemsAndOptionsForScoringWithoutAlternateTab();
40
+ listMatchingPage.steps.selectPartialEqualWeightsCheckbox();
41
+ listMatchingPage.steps.allotPoints(8.5);
42
+ listMatchingPage.steps.setCorrectAnswersForScoringWithoutAlternateTab();
43
+ listMatchingPage.steps.switchToPreviewTab();
44
+ });
45
+
46
+ listMatchingScoring.tests.verifyAutoScoredPartialEqualWeightsRoundDownScore();
47
+ });
48
+ });
@@ -0,0 +1,35 @@
1
+ import { listMatchingPage, listMatchingScoring } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create Item page - List Matching - standard options layout - Partial equal weights scoring with alternate answer', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: AutoScored - Partial equal weights standard options layout with alternate answer', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ cy.log('Navigate to List Matching question type, adding correct answer responses and alternate answer responses for autoscored - partial equal scoring, adding points and switch to preview tab');
13
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
14
+ cy.barsPreLoaderWait();
15
+ listMatchingPage.steps.setQuestionStemsAndOptionsForScoringWithAlternateTab();
16
+ listMatchingPage.steps.selectPartialEqualWeightsCheckbox();
17
+ listMatchingPage.steps.allotPoints(20);
18
+ listMatchingPage.steps.setCorrectAnswersForCorrectTab();
19
+ listMatchingPage.steps.clickOnAddAlternateAnswerButton();
20
+ listMatchingPage.steps.allotPoints(12);
21
+ listMatchingPage.steps.setCorrectAnswersForAlternateTab();
22
+ listMatchingPage.steps.expandAdditonalSettings();
23
+ listMatchingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
24
+ listMatchingPage.steps.switchToPreviewTab();
25
+ });
26
+
27
+ listMatchingScoring.tests.verifyAutoScoredPartialEqualWeightsScoringWithAlternateAnswer('standard');
28
+
29
+ listMatchingScoring.tests.verifyMinimumScoreAwardedIfAttemptedForIncorrectAnswer('20');
30
+
31
+ listMatchingScoring.tests.verifyPenaltyPointsAwardedForIncorrectAnswer('3', '20');
32
+
33
+ listMatchingScoring.tests.verifyPointsAwardedForIncorrectAnswerWhenMinimumScoreAwardedAndPenaltyPointsAreDefined('3', '20');
34
+ });
35
+ });
@@ -0,0 +1,233 @@
1
+ import { listMatchingPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ let optionsForThreeResponses = ['Response 1', 'Response 2', 'Response 3'];
6
+ let optionsForFourResponses = ['Response 1', 'Response 2', 'Response 3', 'Response 4'];
7
+
8
+ describe('Create Item page - List matching: Options sections, Response options', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Response options and Response options layout dropdown', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ cy.log('Navigating to List Matching question type');
17
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
18
+ cy.barsPreLoaderWait();
19
+ });
20
+
21
+ listMatchingPage.tests.verifyResponseOptionsLayoutDropdownSection();
22
+ });
23
+
24
+ describe('Options - \'Standard\' response options - Edit tab section contents', () => {
25
+ abortEarlySetup();
26
+ before(() => {
27
+ cy.log('Navigating to List Matching question type');
28
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
29
+ cy.barsPreLoaderWait();
30
+ });
31
+
32
+ it('\'Options for drag & drop\' label should be displayed', () => {
33
+ listMatchingPage.optionsForDragAndDropLabel()
34
+ .verifyInnerText('Options for drag & drop');
35
+ });
36
+
37
+ it('By default, 3 \'Options\' input fields with numeric counts should be displayed with placeholder text and drag handle and delete option icon buttons should be displayed besides each input field', () => {
38
+ listMatchingPage.steps.verifyOptionsForDragAndDropContentsInSetCorrectAnswerSection();
39
+ listMatchingPage.steps.verifyCountOfOptionsForDragAndDropInputFields(3);
40
+ });
41
+
42
+ it('When only two options are present, the delete buttons should be in disabled state', () => {
43
+ cy.log('Pre-step: Delete one options input field')
44
+ listMatchingPage.steps.deleteResponseOptionInputField(0);
45
+ listMatchingPage.steps.verifyDisabledStateOfOptionDeleteButton();
46
+ });
47
+
48
+ it('CSS of disabled delete option buttons', { tags: 'css' }, () => {
49
+ listMatchingPage.responseOptionsSectionWrapper()
50
+ .within(() => {
51
+ listMatchingPage.deleteOptionButton()
52
+ .should('have.css', 'opacity', '0.5')
53
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
54
+ });
55
+ });
56
+
57
+ listMatchingPage.tests.verifyDragToReorderTooltipInOptionsSection();
58
+
59
+ listMatchingPage.tests.verifyToolTipForDisabledDeleteOptionButton();
60
+
61
+ it('\'Add Option\' button should be present', () => {
62
+ listMatchingPage.addOptionButton()
63
+ .verifyInnerText('Add option')
64
+ .and('be.visible');
65
+ });
66
+
67
+ it('CSS of Options section', { tags: 'css' }, () => {
68
+ listMatchingPage.responseOptionsSectionWrapper()
69
+ .within(() => {
70
+ listMatchingPage.optionsForDragAndDropLabel()
71
+ .verifyCSS(css.color.sectionHeading, css.fontSize.normal, css.fontWeight.semibold);
72
+ listMatchingPage.optionWrapper()
73
+ .eq(0)
74
+ .within(() => {
75
+ listMatchingPage.dragHandleButton()
76
+ .verifyCSS(css.color.secondaryBtnActive, css.fontSize.normal, css.fontWeight.regular);
77
+ listMatchingPage.deleteOptionButton()
78
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
79
+ });
80
+ listMatchingPage.optionsInputField()
81
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
82
+ listMatchingPage.addOptionButton()
83
+ .verifyCSS(css.color.secondaryBtnActive, css.fontSize.normal, css.fontWeight.medium);
84
+
85
+ });
86
+ });
87
+
88
+ it('Accessibility of Options section', { tags: 'a11y' }, () => {
89
+ cy.checkAccessibility(listMatchingPage.optionWrapper().parents('.cloze-drag-and-drop-response-option-wrapper'));
90
+ });
91
+
92
+ it('When user adds an option using \'Add Option\' button then the added option input field should be displayed and option numeration should increment', () => {
93
+ listMatchingPage.steps.addOption();
94
+ listMatchingPage.steps.verifyOptionsForDragAndDropSectionOptionFieldContents();
95
+ });
96
+
97
+ it('When user focus in and out of any of the \'Options\' input field without typing anything, an error message should be thrown', () => {
98
+ listMatchingPage.steps.focusInAndFocusOutOfOptionInputField(2);
99
+ listMatchingPage.errorMessage()
100
+ .verifyInnerText('Error: Option is required.');
101
+ });
102
+
103
+ listMatchingPage.tests.verifyCSSAnda11yOfErrorMessage();
104
+
105
+ it('When user enters text in options input field then the error message \'Error: Option is required.\' should disappear', () => {
106
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(['Response 1', 'Response 2', 'Response 3']);
107
+ commonComponents.errorMessage()
108
+ .should('not.exist');
109
+ });
110
+
111
+ it('When the number of options are greater than 2 then the \'Delete\' icon buttons should get enabled', () => {
112
+ listMatchingPage.deleteOptionButton()
113
+ .should('be.enabled');
114
+ });
115
+
116
+ it('CSS of enabled \'Delete\' option button', { tags: 'css' }, () => {
117
+ listMatchingPage.deleteOptionButton()
118
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon)
119
+ .should('have.css', 'opacity', '1');
120
+ })
121
+
122
+ it('Accessibility of enabled \'Delete\' option button', { tags: 'a11y' }, () => {
123
+ cy.checkAccessibility(listMatchingPage.deleteOptionButton());
124
+ });
125
+
126
+ listMatchingPage.tests.verifyToolTipForEnabledDeleteOptionButton();
127
+
128
+ it('When user clicks on the \'Delete\' option button then the respective options input field should get deleted and option numeration should change accordingly', () => {
129
+ cy.log('Clicking the \'Delete\' icon button for the 2nd option input field')
130
+ listMatchingPage.steps.deleteResponseOptionInputField(1);
131
+ cy.log('Checking that the 3rd option input field should be deleted and option numeration and input field contents should update accordingly')
132
+ listMatchingPage.steps.verifyOptionInputFieldContentsInOptionsSection(['Response 1', 'Response 3']);
133
+ });
134
+
135
+ it('When only two options are present, the delete buttons should be in disabled state', () => {
136
+ listMatchingPage.steps.verifyDisabledStateOfOptionDeleteButton();
137
+ });
138
+ });
139
+
140
+ describe('\'Standard\' response options layout - Set correct answer section contents', () => {
141
+ abortEarlySetup();
142
+ before(() => {
143
+ cy.log('Navigating to List Matching question type');
144
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
145
+ cy.barsPreLoaderWait();
146
+ });
147
+
148
+ it(`When the user has not entered text in the options input field then three empty draggable options along with drag handles should be displayed in the response options container of the \'Set correct answer\' section`, () => {
149
+ listMatchingPage.steps.verifyCountOfDraggableOptionsInSetCorrectAnswerSection('List matching', 3);
150
+ for (let index = 0; index < 3; index++) {
151
+ listMatchingPage.steps.verifyDefaultStateOfDraggableOptionsInSetCorrectAnswerSection('List matching', index);
152
+ };
153
+ listMatchingPage.steps.verifyDragIconVisibleInOptionsInSetCorrectAnswerSection();
154
+ });
155
+
156
+ it('When the user enters text in options input fields then the entered text should be displayed in the respective draggable options in the response options container of the \'Set correct answer\' section', () => {
157
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
158
+ listMatchingPage.steps.verifyDraggableResponsesSetCorrectAnswer('List matching', optionsForThreeResponses);
159
+ });
160
+
161
+ it('When the user adds an option using \'Add Option\' button then the added option should be displayed along with drag handle in the response options container of the \'Set Correct Answer\' section', () => {
162
+ listMatchingPage.steps.addOption();
163
+ cy.log('Checking the added input field should be displayed along with its drag handle and be blank')
164
+ listMatchingPage.steps.verifyCountOfDraggableOptionsInSetCorrectAnswerSection('List matching', 4);
165
+ listMatchingPage.steps.verifyDefaultStateOfDraggableOptionsInSetCorrectAnswerSection('List matching', 3);
166
+ cy.log('Checking that input text to the newly added option is displayed in the response options container of the \'Set Correct Answer\' section')
167
+ listMatchingPage.steps.addInputToOptionForDragAndDropInputField(optionsForFourResponses[3], 3);
168
+ listMatchingPage.steps.verifyDraggableResponsesSetCorrectAnswer('List matching', optionsForFourResponses);
169
+ });
170
+
171
+ it('When the user deletes an option, then the deleted option should get removed from the response options container as well as from the response areas (if any) in the \'Set Correct Answer\' section', () => {
172
+ const optionsAfterDeleting = optionsForFourResponses.filter((el) => el !== 'Response 3');
173
+ cy.log('Setting a correct answer option')
174
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Response 3', 0);
175
+ listMatchingPage.steps.deleteResponseOptionInputField(2);
176
+ listMatchingPage.steps.verifyErroredStateOfEmptyResponseFieldInSetCorrectAnswerSection(0);
177
+ cy.log('Checking the deleted option should not exist within the draggable answer responses under \'Set Correct Answer\' section');
178
+ listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection(optionsAfterDeleting);
179
+ });
180
+ });
181
+
182
+ describe('\'Standard\' Response options layout - Preview tab contents', () => {
183
+ abortEarlySetup();
184
+ before(() => {
185
+ cy.log('Navigating to List Matching question type');
186
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
187
+ cy.barsPreLoaderWait();
188
+ listMatchingPage.steps.switchToPreviewTab();
189
+ });
190
+
191
+ it('When the user has not entered text in the options input field then three empty draggable options along with drag handles should be displayed in the response options container of the \'Preview tab\'', () => {
192
+ listMatchingPage.steps.verifyCountOfDraggableOptionsInPreviewTab('List matching', 3);
193
+ for (let index = 0; index < 2; index++) {
194
+ listMatchingPage.steps.verifyDefaultStateOfDraggableOptionsInPreviewTab('List matching', index);
195
+ }
196
+ });
197
+
198
+ it('When the user enters text in options input fields then the entered text should be displayed in the respective draggable options in the response options container of the \'Preview tab\'', () => {
199
+ cy.log('Pre-step : Switching to \'Edit\' tab')
200
+ listMatchingPage.steps.switchToEditTab();
201
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
202
+ cy.log('Switching to preview tab to check Preview tab draggable options')
203
+ listMatchingPage.steps.switchToPreviewTab();
204
+ listMatchingPage.steps.verifyDraggableResponsesPreviewTab('List matching', optionsForThreeResponses);
205
+ });
206
+
207
+ it('When the user adds an option using \'Add Option\' button then the added option should be displayed in the response options container of the \'Preview tab\'', () => {
208
+ cy.log('Pre-step : Switching to \'Edit\' tab')
209
+ listMatchingPage.steps.switchToEditTab();
210
+ listMatchingPage.steps.addOption();
211
+ cy.log('Checking the added input field should be displayed in the Preview tab along with its drag handle and be blank')
212
+ listMatchingPage.steps.switchToPreviewTab();
213
+ listMatchingPage.steps.verifyCountOfDraggableOptionsInPreviewTab('List matching', 4);
214
+ listMatchingPage.steps.verifyDefaultStateOfDraggableOptionsInPreviewTab('List matching', 3);
215
+ cy.log('Checking that input text to the newly added option is displayed in the option in Preview tab section')
216
+ listMatchingPage.steps.switchToEditTab();
217
+ listMatchingPage.steps.addInputToOptionForDragAndDropInputField(optionsForFourResponses[3], 3);
218
+ listMatchingPage.steps.switchToPreviewTab();
219
+ listMatchingPage.steps.verifyDraggableResponsesPreviewTab('List matching', optionsForFourResponses);
220
+ });
221
+
222
+ it('When the user deletes an option then the deleted option should get removed from the response options container of the \'Preview tab\'', () => {
223
+ const optionsAfterDeleting = optionsForFourResponses.filter((el) => el !== 'Response 4')
224
+ cy.log('Pre-step : Switching to \'Edit\' tab')
225
+ listMatchingPage.steps.switchToEditTab();
226
+ listMatchingPage.steps.deleteOption(3);
227
+ cy.log('Checking the deleted option should not exist in the Preview tab')
228
+ listMatchingPage.steps.switchToPreviewTab();
229
+ listMatchingPage.steps.verifyCountOfDraggableOptionsInPreviewTab('List matching', 3);
230
+ listMatchingPage.steps.verifyDraggableResponsesPreviewTab('List matching', optionsAfterDeleting);
231
+ });
232
+ });
233
+ });
@@ -0,0 +1,113 @@
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 edit tab', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Randomize options - Functionality : Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigating to List Matching question type');
16
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
17
+ cy.barsPreLoaderWait();
18
+ listMatchingPage.steps.addInputToAllStemFields(stems);
19
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
20
+ listMatchingPage.steps.allotPoints('10');
21
+ });
22
+
23
+ it('When the \'Randomize options\' functionality is disabled, 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', () => {
24
+ listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection(optionsForResponses);
25
+ });
26
+
27
+ it('When the \'Randomize options\' functionality is disabled, the stem fields in the set correct answer section should be displayed in the order in which the user has set them in the Stems section', () => {
28
+ listMatchingPage.steps.verifyStemFieldsInSetCorrectAnswerSection(stems)
29
+ });
30
+
31
+ it('When the user enables the \'Randomize options\' functionality, then the draggable options in the response container should be in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
32
+ listMatchingPage.steps.checkRandomizeOptionsCheckbox();
33
+ listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection(optionsForResponses);
34
+ });
35
+
36
+ it('When the user enables the \'Randomize options\' functionality, then the stem fields in the set correct answer section should be in the order in which the user has set them in the Stems section', () => {
37
+ listMatchingPage.steps.verifyStemFieldsInSetCorrectAnswerSection(stems)
38
+ });
39
+
40
+ listMatchingPage.tests.verifyCSSAndA11yOfCheckedStateOfRandomizeOptionsCheckbox();
41
+ });
42
+
43
+ describe('Reuse options - Functionality : Edit tab', () => {
44
+ abortEarlySetup();
45
+ before(() => {
46
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
47
+ cy.barsPreLoaderWait();
48
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
49
+ });
50
+
51
+ it('When the \'Reuse options\' functionality is disabled, then on setting correct answer in the response area, the draggable options should get removed from the response container', () => {
52
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
53
+ listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection([optionsForResponses[1], optionsForResponses[2]]);
54
+ });
55
+
56
+ it('When the user enables the \'Reuse options\' functionality, then on setting correct answer in the response area, the draggable options should persist in the response container', () => {
57
+ cy.log('Pre step: Removing the set correct answer option from the response area')
58
+ listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInSetCorrectAnswerSection(0);
59
+ listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection(optionsForResponses);
60
+ cy.log('Checking the reuse option checkbox and setting the correct answer option')
61
+ listMatchingPage.steps.checkReuseOptionsCheckbox();
62
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
63
+ listMatchingPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Correct answer for stem 1');
64
+ listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection(optionsForResponses);
65
+ });
66
+
67
+ listMatchingPage.tests.verifyCSSAndA11yOfCheckedStateOfReuseOptionsCheckbox();
68
+
69
+ it('The user should be able to use the same draggable option for multiple response areas', () => {
70
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 1);
71
+ listMatchingPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Correct answer for stem 1');
72
+ listMatchingPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(1, 'Correct answer for stem 1');
73
+ listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection(optionsForResponses);
74
+ });
75
+
76
+ it('When the user removes the option from the response area and moves it into the options container, only one option should be displayed in the respective group', () => {
77
+ listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInSetCorrectAnswerSection(0);
78
+ listMatchingPage.steps.clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInSetCorrectAnswerSection(1);
79
+ listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection(optionsForResponses);
80
+ });
81
+
82
+ it('When the user disables the \'Reuse options\' functionality, the duplicate answer set as correct answer should get removed from the response area and the draggable option should also not exist in the response container of the \'Set correct answer\' section', () => {
83
+ cy.log('Pre-step: Setting the same draggable option for multiple response areas');
84
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
85
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 1);
86
+ listMatchingPage.steps.uncheckReuseOptionsCheckbox();
87
+ listMatchingPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Correct answer for stem 1');
88
+ listMatchingPage.steps.verifyEmptyResponseAreaInSetCorrectAnswerSection(1);
89
+ listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection([optionsForResponses[1], optionsForResponses[2]]);
90
+ });
91
+ });
92
+
93
+ describe('Hide drag handle - Functionality: Edit tab', () => {
94
+ abortEarlySetup();
95
+ before(() => {
96
+ cy.log('Navigating to List Matching question type');
97
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
98
+ cy.barsPreLoaderWait();
99
+ });
100
+
101
+ it('When the \'Hide drag handle\' functionality is disabled, then the draggable options displayed in response container of the \'Set correct answer\' section should have a drag handle', () => {
102
+ listMatchingPage.steps.verifyDragIconVisibleInOptionsInSetCorrectAnswerSection('list matching')
103
+ });
104
+
105
+ it('When the user enables the \'Hide drag handle\' functionality, then the draggable options displayed in response container of the \'Set correct answer\' section should not have a drag handle', () => {
106
+ listMatchingPage.steps.switchToEditTab();
107
+ listMatchingPage.steps.checkHideDragHandleCheckbox();
108
+ listMatchingPage.steps.verifyDragIconNotVisibleInOptionsInSetCorrectAnswerSection('list matching');
109
+ });
110
+
111
+ listMatchingPage.tests.verifyCSSAndA11yOfCheckedStateOfHideDragHandleCheckbox();
112
+ });
113
+ });