itemengine-cypress-automation 1.0.28 → 1.0.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +648 -0
  2. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropClickAndDrop.js +278 -0
  3. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropEditTabBasic.js +198 -0
  4. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropEditTabScoringTypes.js +107 -0
  5. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.js +76 -0
  6. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.js +240 -0
  7. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsManualAndNonScoredScoring.js +83 -0
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsPartialDifferentWeightsScoring.js +157 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsPartialEqualWeightsScoring.js +154 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedSetCorrectAnswerCheckboxes.js +282 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropHeaderSection.js +84 -0
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropScoringSectionBasic.js +21 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropSetCorrectAnswerCheckboxes.js +293 -0
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropSetCorrectAnswerSection.js +66 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionPartialDifferentWeightsScoring.js +129 -0
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsAutoScoredAllOrNothingScoring.js +200 -0
  17. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsManualAndNonScoredScoring.js +60 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsPartialEqualWeightsScoring.js +130 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsSection.js +66 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropSwitchingCases.js +54 -0
  21. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillIntheGapsDragAndDropAlternateAnswer.js +230 -0
  22. package/package.json +1 -1
@@ -0,0 +1,154 @@
1
+ import { fillInTheGapsDragAndDropPage, fillInTheGapsScoring } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create Item page - Fill in the Gaps: Drag and Drop - Grouped options layout - Partial equal weights scoring', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: AutoScored - Partial equal weights - grouped options layout', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ cy.log('Navigate to Fill in the gaps - drag and drop question type, fill the necessary details and points and switch to preview tab');
13
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
14
+ cy.barsPreLoaderWait();
15
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
16
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(0, 'Group title A');
17
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Incorrect answer 1']);
18
+ fillInTheGapsDragAndDropPage.addGroupButton()
19
+ .click();
20
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(1, 'Group title B');
21
+ fillInTheGapsDragAndDropPage.groupResponseContainer()
22
+ .eq(1)
23
+ .within(() => {
24
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 2', 'Incorrect answer 2']);
25
+ });
26
+ fillInTheGapsDragAndDropPage.steps.allotPoints('10');
27
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
28
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
29
+ fillInTheGapsDragAndDropPage.partialEqualWeightsCheckbox()
30
+ .click();
31
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
32
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
33
+ .click();
34
+ fillInTheGapsDragAndDropPage.rounddownScoreCheckbox()
35
+ .click();
36
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
37
+ });
38
+
39
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsScoring('fill in the gaps - drag and drop');
40
+ });
41
+
42
+ describe('Question Preview: AutoScored - Partial equal weights grouped options layout with alternate answer and \'Match from all responses property - \"false\"\'', () => {
43
+ abortEarlySetup();
44
+ before(() => {
45
+ cy.log('Navigate to Fill in the gaps - drag and drop question type, adding correct answer responses and alternate answer responses for autoscored - partial equal weights scoring, adding points and switch to preview tab');
46
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
47
+ cy.barsPreLoaderWait();
48
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
49
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(0, 'Group title A');
50
+ fillInTheGapsDragAndDropPage.addOptionButton()
51
+ .click();
52
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Alternate answer for response 1', 'Incorrect answer 1']);
53
+ fillInTheGapsDragAndDropPage.addGroupButton()
54
+ .click();
55
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(1, 'Group title B');
56
+ fillInTheGapsDragAndDropPage.groupResponseContainer()
57
+ .eq(1)
58
+ .within(() => {
59
+ fillInTheGapsDragAndDropPage.addOptionButton()
60
+ .click();
61
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 2', 'Alternate answer for response 2', 'Incorrect answer 2']);
62
+ });
63
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
64
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
65
+ fillInTheGapsDragAndDropPage.steps.allotPoints('10');
66
+ fillInTheGapsDragAndDropPage.alternateAnswerButton()
67
+ .click();
68
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 1', 0);
69
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 2', 1);
70
+ fillInTheGapsDragAndDropPage.steps.allotPoints('6');
71
+ fillInTheGapsDragAndDropPage.partialEqualWeightsCheckbox()
72
+ .click();
73
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
74
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
75
+ .click();
76
+ fillInTheGapsDragAndDropPage.rounddownScoreCheckbox()
77
+ .click();
78
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
79
+ });
80
+
81
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsWithAlternateAnswerAndMatchFromAllResponsesFalse('fill in the gaps - drag and drop')
82
+ });
83
+
84
+ describe('Question Preview: AutoScored - Partial equal weights grouped options layout with alternate answer with \'Match from all responses property - \"true\"\'', () => {
85
+ abortEarlySetup();
86
+ before(() => {
87
+ cy.log('Navigate to Fill in the gaps - drag and drop question type, adding correct answer responses and alternate answer responses for autoscored - partial equal weights scoring, adding points, check match for all responses checkbox and switch to preview tab');
88
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
89
+ cy.barsPreLoaderWait();
90
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
91
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(0, 'Group title A');
92
+ fillInTheGapsDragAndDropPage.addOptionButton()
93
+ .click();
94
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Alternate answer for response 1', 'Incorrect answer 1']);
95
+ fillInTheGapsDragAndDropPage.addGroupButton()
96
+ .click();
97
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(1, 'Group title B');
98
+ fillInTheGapsDragAndDropPage.groupResponseContainer()
99
+ .eq(1)
100
+ .within(() => {
101
+ fillInTheGapsDragAndDropPage.addOptionButton()
102
+ .click();
103
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 2', 'Alternate answer for response 2', 'Incorrect answer 2']);
104
+ });
105
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
106
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
107
+ fillInTheGapsDragAndDropPage.steps.allotPoints('10');
108
+ fillInTheGapsDragAndDropPage.alternateAnswerButton()
109
+ .click();
110
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 1', 0);
111
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 2', 1);
112
+ fillInTheGapsDragAndDropPage.steps.allotPoints('6');
113
+ fillInTheGapsDragAndDropPage.partialEqualWeightsCheckbox()
114
+ .click();
115
+ fillInTheGapsDragAndDropPage.matchFromAllResponsesCheckbox()
116
+ .click();
117
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
118
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
119
+ .click();
120
+ fillInTheGapsDragAndDropPage.rounddownScoreCheckbox()
121
+ .click();
122
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
123
+ });
124
+
125
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsWithAlternateAnswerAndMatchFromAllResponsesTrue('fill in the gaps - drag and drop')
126
+ });
127
+
128
+ describe('Partial Equal Weights: Round down score - grouped options layout', () => {
129
+ abortEarlySetup();
130
+ before(() => {
131
+ cy.log('Navigate to Fill in the gaps - drag and drop question type, adding question instructions and options, set correct answers, select partial - equal weights scoring and add points (in decimals) for correct answer options');
132
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
133
+ cy.barsPreLoaderWait();
134
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
135
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(0, 'Group title A');
136
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Incorrect answer 1']);
137
+ fillInTheGapsDragAndDropPage.addGroupButton()
138
+ .click();
139
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(1, 'Group title B');
140
+ fillInTheGapsDragAndDropPage.groupResponseContainer()
141
+ .eq(1)
142
+ .within(() => {
143
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 2', 'Incorrect answer 2']);
144
+ });
145
+ fillInTheGapsDragAndDropPage.partialEqualWeightsCheckbox()
146
+ .click();
147
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
148
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
149
+ fillInTheGapsDragAndDropPage.steps.allotPoints('8.5');
150
+ });
151
+
152
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsRoundDownScore('fill in the gaps - drag and drop');
153
+ });
154
+ });
@@ -0,0 +1,282 @@
1
+ import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ let optionsForResponses = [
6
+ ['Response 1', 'Response 2', 'Response 3', 'Response 4'],
7
+ ['Response 5', 'Response 6', 'Response 7', 'Response 8'],
8
+ ['Response 9', 'Response 10', 'Response 11', 'Response 12'],
9
+ ['Response 13', 'Response 14', 'Response 15', 'Response 16']
10
+ ];
11
+ let groupTitles = ['Group title A', 'Group title B', 'Group title C', 'Group title D']
12
+
13
+ describe('Create Item page - Fill in the gaps - drag and drop: Randomize options, Reuse options, Hide drag handle functionalities for \'Grouped\' response option layout', () => {
14
+ before(() => {
15
+ cy.loginAs('admin');
16
+ });
17
+
18
+ describe('Randomize options - Functionality : Edit tab', () => {
19
+ abortEarlySetup();
20
+ before(() => {
21
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
22
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
23
+ cy.barsPreLoaderWait();
24
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
25
+ cy.log('Adding two more option input fields')
26
+ fillInTheGapsDragAndDropPage.steps.addOption();
27
+ fillInTheGapsDragAndDropPage.steps.addOption();
28
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(0, groupTitles[0]);
29
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses[0]);
30
+ fillInTheGapsDragAndDropPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(1, groupTitles[1], optionsForResponses[1]);
31
+ fillInTheGapsDragAndDropPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(2, groupTitles[2], optionsForResponses[2]);
32
+ fillInTheGapsDragAndDropPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(3, groupTitles[3], optionsForResponses[3]);
33
+ });
34
+
35
+ it('When the \'Randomize options\' functionality is disabled, then the group container as well as the options inside the group should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
36
+ groupTitles.forEach((groupTitle, groupIndex) => {
37
+ fillInTheGapsDragAndDropPage.steps.verifyGroupTitleInSetCorrectAnswerSection(groupIndex, groupTitle);
38
+ });
39
+ optionsForResponses.forEach((options, index) => {
40
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(index, options);
41
+ });
42
+ });
43
+
44
+ it('When the user enables the \'Randomize options\' functionality, then the group container as well as the options inside the group should be in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
45
+ fillInTheGapsDragAndDropPage.steps.checkRandomizeOptionsCheckbox();
46
+ groupTitles.forEach((groupTitle, groupIndex) => {
47
+ fillInTheGapsDragAndDropPage.steps.verifyGroupTitleInSetCorrectAnswerSection(groupIndex, groupTitle);
48
+ });
49
+ optionsForResponses.forEach((options, index) => {
50
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(index, options);
51
+ });
52
+ });
53
+ });
54
+
55
+ describe('Randomize options - Functionality : Preview tab', () => {
56
+ let optionsArray = [];
57
+ let groupTitleArray = [];
58
+ abortEarlySetup();
59
+ before(() => {
60
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
61
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
62
+ cy.barsPreLoaderWait();
63
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
64
+ cy.log('Adding two more option input fields')
65
+ fillInTheGapsDragAndDropPage.steps.addOption();
66
+ fillInTheGapsDragAndDropPage.steps.addOption();
67
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(0, groupTitles[0]);
68
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses[0]);
69
+ fillInTheGapsDragAndDropPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(1, groupTitles[1], optionsForResponses[1]);
70
+ fillInTheGapsDragAndDropPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(2, groupTitles[2], optionsForResponses[2]);
71
+ fillInTheGapsDragAndDropPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(3, groupTitles[3], optionsForResponses[3]);
72
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
73
+ });
74
+
75
+ it('When the \'Randomize options\' functionality is disabled, then the group container as well as the options inside the group should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
76
+ groupTitles.forEach((groupTitle, groupIndex) => {
77
+ fillInTheGapsDragAndDropPage.steps.verifyGroupTitleInPreviewTab(groupIndex, groupTitle);
78
+ });
79
+ optionsForResponses.forEach((options, index) => {
80
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(index, options);
81
+ });
82
+ });
83
+
84
+ it('When the user enables the \'Randomize options\' functionality, then the group container as well as the options inside the group should be displayed in a random order', () => {
85
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
86
+ fillInTheGapsDragAndDropPage.steps.checkRandomizeOptionsCheckbox();
87
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
88
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizationOfGroupsInPreviewTab(groupTitles);
89
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizeOptionOrderInGroup(groupTitles[0], optionsForResponses[0]);
90
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizeOptionOrderInGroup(groupTitles[1], optionsForResponses[1]);
91
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizeOptionOrderInGroup(groupTitles[2], optionsForResponses[2]);
92
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizeOptionOrderInGroup(groupTitles[3], optionsForResponses[3]);
93
+ optionsArray = fillInTheGapsDragAndDropPage.steps.getOptionsArray('fill in the gaps - drag and drop');
94
+ groupTitleArray = fillInTheGapsDragAndDropPage.steps.getGroupTitleArray();
95
+ });
96
+
97
+ it('When the user switches to \'Edit tab\' and does not modify any question properties, then the order of group containers as well as the options inside the group should not change', () => {
98
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
99
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
100
+ groupTitleArray.forEach((groupTitle, groupIndex) => {
101
+ fillInTheGapsDragAndDropPage.steps.verifyGroupTitleInPreviewTab(groupIndex, groupTitle);
102
+ });
103
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesPreviewTab('fill in the gaps - drag and drop', optionsArray);
104
+ });
105
+
106
+ it('When the user switches to \'Edit tab\' and modifies any of question properties, then the order of group containers as well as the options inside the group should change', () => {
107
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
108
+ fillInTheGapsDragAndDropPage.steps.allotPoints(5);
109
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
110
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizationOfGroupsInPreviewTab(groupTitles);
111
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizeOptionOrderInGroup(groupTitles[0], optionsForResponses[0]);
112
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizeOptionOrderInGroup(groupTitles[1], optionsForResponses[1]);
113
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizeOptionOrderInGroup(groupTitles[2], optionsForResponses[2]);
114
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizeOptionOrderInGroup(groupTitles[3], optionsForResponses[3]);
115
+ fillInTheGapsDragAndDropPage.steps.verifyRerandomizedOptionsOrder(optionsArray, 'fill in the gaps - drag and drop');
116
+ fillInTheGapsDragAndDropPage.steps.verifyRerandomizedGroupOrder(groupTitleArray);
117
+ });
118
+
119
+ it('When the user disables the \'Randomize options\' functionality, then the order of group containers as well as the options inside the group should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
120
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
121
+ fillInTheGapsDragAndDropPage.steps.uncheckRandomizeOptionsCheckbox();
122
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
123
+ groupTitles.forEach((groupTitle, groupIndex) => {
124
+ fillInTheGapsDragAndDropPage.steps.verifyGroupTitleInPreviewTab(groupIndex, groupTitle);
125
+ });
126
+ optionsForResponses.forEach((options, index) => {
127
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(index, options);
128
+ });
129
+ });
130
+ });
131
+
132
+ describe('Reuse options - Functionality : Edit tab', () => {
133
+ abortEarlySetup();
134
+ before(() => {
135
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
136
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
137
+ cy.barsPreLoaderWait();
138
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
139
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(0, groupTitles[0]);
140
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Response 1', 'Response 2']);
141
+ fillInTheGapsDragAndDropPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(1, groupTitles[1], ['Response 3', 'Response 4']);
142
+ });
143
+
144
+ 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 respective group of the response container', () => {
145
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
146
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
147
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 2']);
148
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(1, ['Response 3', 'Response 4']);
149
+ });
150
+
151
+ it('When the user enables the \'Reuse options\' functionality, then on setting correct answer in the response area, the draggable options should persist in respective group of the response container', () => {
152
+ cy.log('Pre step: Removing the set correct answer option from the response area')
153
+ fillInTheGapsDragAndDropPage.steps.clickAndDropDraggableOptionInResponseContainerOfSetCorrectAnswerSection('Response 1');
154
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 1', 'Response 2']);
155
+ cy.log('Checking the reuse option checkbox and setting the correct answer option')
156
+ fillInTheGapsDragAndDropPage.steps.checkReuseOptionsCheckbox();
157
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
158
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
159
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 1', 'Response 2']);
160
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(1, ['Response 3', 'Response 4']);
161
+ });
162
+
163
+ it('The user should be able to use the same draggable option for multiple response areas', () => {
164
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 1);
165
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
166
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(1, 'Response 1');
167
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 1', 'Response 2']);
168
+ });
169
+
170
+ it('When the user removes the draggable option and moves it into the response container, only one option should be displayed in the respective group', () => {
171
+ fillInTheGapsDragAndDropPage.steps.clickAndDropDraggableOptionInResponseContainerOfSetCorrectAnswerSection('Response 1');
172
+ fillInTheGapsDragAndDropPage.steps.clickAndDropDraggableOptionInResponseContainerOfSetCorrectAnswerSection('Response 1');
173
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 1', 'Response 2']);
174
+ });
175
+
176
+ 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', () => {
177
+ cy.log('Pre step: Setting identical options as correct responses')
178
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
179
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 1);
180
+ fillInTheGapsDragAndDropPage.steps.uncheckReuseOptionsCheckbox();
181
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
182
+ fillInTheGapsDragAndDropPage.steps.verifyInactiveStateOfResponseAreaInSetCorrectAnswerSection(1);
183
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 2']);
184
+ });
185
+
186
+ //https://redmine.zeuslearning.com/issues/537351
187
+ });
188
+
189
+ describe('Reuse options - Functionality: Preview tab', () => {
190
+ abortEarlySetup();
191
+ before(() => {
192
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
193
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
194
+ cy.barsPreLoaderWait();
195
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
196
+ fillInTheGapsDragAndDropPage.steps.addGroupTitle(0, groupTitles[0]);
197
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Response 1', 'Response 2']);
198
+ fillInTheGapsDragAndDropPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(1, groupTitles[1], ['Response 3', 'Response 4']);
199
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
200
+ });
201
+
202
+ it('When the \'Reuse options\' functionality is disabled, then on attempting the question, the draggable options should get removed from the response container', () => {
203
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 1', 0);
204
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 1');
205
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 2']);
206
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(1, ['Response 3', 'Response 4']);
207
+ });
208
+
209
+ it('When the \'Reuse options\' functionality is enabled, then on attempting the question, the draggable options should persist in the response container', () => {
210
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
211
+ fillInTheGapsDragAndDropPage.steps.checkReuseOptionsCheckbox();
212
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
213
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 1', 0);
214
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 1');
215
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 1', 'Response 2']);
216
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(1, ['Response 3', 'Response 4']);
217
+ });
218
+
219
+ it('The user should be able to use the same draggable option for multiple response areas', () => {
220
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 1', 1);
221
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 1');
222
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(1, 'Response 1');
223
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 1', 'Response 2']);
224
+ });
225
+
226
+ it('When the user removes the draggable option and moves it into the response container, only one option should be displayed in the respective group', () => {
227
+ fillInTheGapsDragAndDropPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Response 1');
228
+ fillInTheGapsDragAndDropPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Response 1');
229
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 1', 'Response 2']);
230
+ });
231
+
232
+ it('When the user disables the \'Reuse options\' functionality, then on attempting the question, the draggable options should get removed from the response container', () => {
233
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
234
+ fillInTheGapsDragAndDropPage.steps.uncheckReuseOptionsCheckbox();
235
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
236
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 1', 0);
237
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 1');
238
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 2']);
239
+ });
240
+ });
241
+
242
+ describe('Reuse options - Scoring', () => {
243
+ before(() => {
244
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
245
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
246
+ cy.barsPreLoaderWait();
247
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
248
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses[0].slice(0, 2));
249
+ fillInTheGapsDragAndDropPage.reuseOptionsCheckbox()
250
+ .click();
251
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
252
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 1);
253
+ fillInTheGapsDragAndDropPage.steps.allotPoints(5);
254
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
255
+ });
256
+
257
+ fillInTheGapsDragAndDropPage.tests.verifyReuseOptionScoring();
258
+ });
259
+
260
+ describe('Hide drag handle - Functionality: Edit tab', () => {
261
+ before(() => {
262
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
263
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
264
+ cy.barsPreLoaderWait();
265
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
266
+ });
267
+
268
+ fillInTheGapsDragAndDropPage.tests.verifyHideDragHandleFunctionalityInSetCorrectAnswerSection();
269
+ });
270
+
271
+ describe('Hide drag handle - Functionality: Preview tab', () => {
272
+ before(() => {
273
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
274
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
275
+ cy.barsPreLoaderWait();
276
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
277
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
278
+ });
279
+
280
+ fillInTheGapsDragAndDropPage.tests.verifyHideDragHandleFunctionalityInPreviewTab();
281
+ });
282
+ });
@@ -0,0 +1,84 @@
1
+ import { dialogBoxBase, fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill in the gaps - drag and drop: Header section and saving question', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Header section contents', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ cy.log('Navigate to fill in the gaps - drag and drop question type');
13
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
14
+ cy.barsPreLoaderWait();
15
+ });
16
+
17
+ fillInTheGapsDragAndDropPage.tests.verifyCreateQuestionPageQuestionTypeHeader('Fill in the gaps with drag and drop');
18
+ });
19
+
20
+ describe('Tabs section', () => {
21
+ abortEarlySetup();
22
+ before(() => {
23
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
24
+ cy.barsPreLoaderWait();
25
+ });
26
+
27
+ fillInTheGapsDragAndDropPage.tests.verifyTabsSection();
28
+ });
29
+
30
+ describe('Cancel button', () => {
31
+ abortEarlySetup();
32
+ before(() => {
33
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
34
+ cy.barsPreLoaderWait();
35
+ });
36
+
37
+ fillInTheGapsDragAndDropPage.tests.verifyCancelButton('fill in the gaps with drag and drop');
38
+ });
39
+
40
+ describe('Save question button', () => {
41
+ abortEarlySetup();
42
+ before(() => {
43
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
44
+ cy.barsPreLoaderWait();
45
+ });
46
+
47
+ describe('Validation error messages', () => {
48
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
49
+
50
+ it('Validation error messages should be displayed below required input fields', () => {
51
+ fillInTheGapsDragAndDropPage.steps.verifyQuestionInstructionsErrorMessage();
52
+ for (let index = 0; index < 2; index++) {
53
+ fillInTheGapsDragAndDropPage.steps.verifyOptionsInputFieldErrorMessage(index)
54
+ }
55
+ fillInTheGapsDragAndDropPage.steps.verifyPointsFieldErrorMessage();
56
+ fillInTheGapsDragAndDropPage.steps.verifySetCorrectAnswerErrorIconIsDisplayed();
57
+ });
58
+
59
+ it('Validation error messages should disappear when required input fields are filled', () => {
60
+ fillInTheGapsDragAndDropPage.steps.addQuestionInstructions();
61
+ fillInTheGapsDragAndDropPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
62
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Cat', 'Dog']);
63
+ for (let index = 0; index < 2; index++) {
64
+ fillInTheGapsDragAndDropPage.steps.verifyOptionsInputFieldErrorMessageDoesNotExist(index);
65
+ }
66
+ fillInTheGapsDragAndDropPage.steps.allotPoints(20);
67
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Cat', 0);
68
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Dog', 1);
69
+ fillInTheGapsDragAndDropPage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
70
+ fillInTheGapsDragAndDropPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
71
+ });
72
+ });
73
+
74
+ describe('Saving a question', () => {
75
+ abortEarlySetup();
76
+
77
+ it('When user has filled all the mandatory fields then on clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
78
+ fillInTheGapsDragAndDropPage.steps.saveAQuestionAndVerifySnackbar();
79
+ });
80
+
81
+ fillInTheGapsDragAndDropPage.tests.verifySavedSuccessfullySnackbarCSSanda11y();
82
+ });
83
+ });
84
+ });
@@ -0,0 +1,21 @@
1
+ import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create Item page - Fill in the gaps - drag and drop: Scoring Section basic: Labels, dropdown, checkboxes', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Scoring Section contents', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ cy.log('Navigate to fill in the gaps - drag and drop question type');
13
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
14
+ cy.barsPreLoaderWait();
15
+ });
16
+
17
+ fillInTheGapsDragAndDropPage.tests.verifyScoringTypeLabelAndDropdown('autoScored');
18
+
19
+ fillInTheGapsDragAndDropPage.tests.verifyAutoScoredScoringTypeSectionWithCSSAnda11y();
20
+ });
21
+ });