itemengine-cypress-automation 1.0.45 → 1.0.47

Sign up to get free protection for your applications and to get access to all the features.
Files changed (19) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/groupedOptionsAllOrNothingAlternatePointsGreaterThanCorrectPoints.js +1 -1
  2. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/groupedOptionsAllOrNothingCorrectPointsEqualToAlternatePoints.js +1 -1
  3. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/standardAllOrNothingCorrectPointsEqualToAlternatePoints.js +1 -1
  4. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/standardAllOrNothingCorrectPointsGreaterThanAlternatePoints.js +1 -1
  5. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAddResponseContainer.js +221 -0
  6. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettings.js +1588 -0
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingScoring.js +950 -0
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextConditionalCheckboxes.js +357 -0
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +134 -0
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +208 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabScoringSection.js +227 -0
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextHeaderSection.js +109 -0
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextImageProperties.js +156 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextManualAndNonScored.js +157 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsScoring.js +1199 -0
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsScoring.js +1084 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPreviewTab.js +66 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSetCorrectAnswerSection.js +113 -0
  19. package/package.json +1 -1
@@ -22,7 +22,7 @@ describe('Create Item page - drag and drop into categories: Preview tab scoring
22
22
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
23
23
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Parrot', 2);
24
24
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Ostrich', 3);
25
- dragAndDropIntoCategoriesPage.steps.allotPoints(5);
25
+ dragAndDropIntoCategoriesPage.steps.allotPoints(15);
26
26
  dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
27
27
  dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
28
28
  dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
@@ -22,7 +22,7 @@ describe('Create Item page - drag and drop into categories: Preview tab scoring
22
22
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
23
23
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Parrot', 2);
24
24
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Ostrich', 3);
25
- dragAndDropIntoCategoriesPage.steps.allotPoints(5);
25
+ dragAndDropIntoCategoriesPage.steps.allotPoints(10);
26
26
  dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
27
27
  dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
28
28
  dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
@@ -22,7 +22,7 @@ describe('Create Item page - drag and drop into categories: Preview tab Scoring
22
22
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
23
23
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Parrot', 2);
24
24
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Ostrich', 3);
25
- dragAndDropIntoCategoriesPage.steps.allotPoints(5);
25
+ dragAndDropIntoCategoriesPage.steps.allotPoints(15);
26
26
  dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
27
27
  dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
28
28
  dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
@@ -22,7 +22,7 @@ describe('Create Item page - drag and drop into categories: Preview tab Scoring
22
22
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Whale', 2);
23
23
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Parrot', 2);
24
24
  dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Ostrich', 3);
25
- dragAndDropIntoCategoriesPage.steps.allotPoints(5);
25
+ dragAndDropIntoCategoriesPage.steps.allotPoints(10);
26
26
  dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
27
27
  dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
28
28
  dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
@@ -0,0 +1,221 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import { uploadImageSectionComponent } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+ describe('Create item page - Fill in the gaps over image - text: Add response container, response container', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Add response container button', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigating to Fill in the gaps over image - text question type');
16
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
17
+ cy.barsPreLoaderWait();
18
+ });
19
+
20
+ it('By default the \'Add response container\' button should not exist', () => {
21
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.addResponseContainerButton(), 'notExist');
22
+ });
23
+
24
+ it('When the user has uploaded an image in image section, then \'Add response container\' button should be displayed', () => {
25
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
26
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
27
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.addResponseContainerButton(), 'visible');
28
+ });
29
+
30
+ it('When the user clicks on \'Add response container\' button, then response container should be added over the uploaded image with numeration', () => {
31
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
32
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerIsDisplayedInImageSection(0);
33
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerNumerationInImageSection(0);
34
+ });
35
+
36
+ it('When the user clicks on add \'Add response container\' button a second response container in image section should be displayed with proper numeration', () => {
37
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
38
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerNumerationInImageSection(1);
39
+ });
40
+
41
+ it('When the user clicks on the close button on the response container, then the response container should be removed from the image', () => {
42
+ fillInTheGapsOverImageTextPage.steps.clickOnResponseContainerCloseButton(0);
43
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.responseContainer(), 1);
44
+ });
45
+
46
+ it('The remaining response container and its options for response section should be displayed with proper updated numeration', () => {
47
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerIsDisplayedInImageSection(0);
48
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerNumerationInImageSection(0);
49
+ });
50
+ });
51
+
52
+ describe('Add response container - set correct answer section', () => {
53
+ abortEarlySetup();
54
+ before(() => {
55
+ cy.log('Navigating to Fill in the gaps over image - text question type');
56
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
57
+ cy.barsPreLoaderWait();
58
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
59
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
60
+ });
61
+
62
+ it('When the user has not added any response container over the uploaded image, response label and response fields should not be displayed in the set correct answer section', () => {
63
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.setCorrectAnswerResponseFieldLabel(), 'notExist');
64
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseFieldSetCorrectAnswerSection(), 'notExist');
65
+ });
66
+
67
+ it('When the user adds a response container over the uploaded image, then a label \'Response #\' and its respective response field should be displayed in the set correct answer section', () => {
68
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
69
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldLabelInSetCorrectAnswerSection(0);
70
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldIsDisplayedInSetCorrectAnswerSection(0);
71
+ });
72
+
73
+ it('When the user adds second response container in image section, then a label \'Response #\' and its respective response field should be displayed in the set correct answer section for the newly added response container with appropriate numeration', () => {
74
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
75
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldLabelInSetCorrectAnswerSection(1);
76
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldIsDisplayedInSetCorrectAnswerSection(1);
77
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.setCorrectAnswerResponseFieldLabel(), 2);
78
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.responseFieldSetCorrectAnswerSection(), 2);
79
+ });
80
+
81
+ it('When the user removes a response container in the image section, then the label and response field for the removed response container should also be removed in the set correct answer section and the remaining label and response field in the set correct answer section should be displayed with proper updated numeration', () => {
82
+ fillInTheGapsOverImageTextPage.steps.clickOnResponseContainerCloseButton(0);
83
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.setCorrectAnswerResponseFieldLabel(), 1);
84
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.responseFieldSetCorrectAnswerSection(), 1);
85
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldLabelInSetCorrectAnswerSection(0);
86
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldIsDisplayedInSetCorrectAnswerSection(0);
87
+ });
88
+ });
89
+
90
+ describe('Add response container - preview tab', () => {
91
+ abortEarlySetup();
92
+ before(() => {
93
+ cy.log('Navigating to fill in the gaps over image - text question type');
94
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
95
+ cy.barsPreLoaderWait();
96
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
97
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
98
+ });
99
+
100
+ it('When the user has not added any response container over the uploaded image, then response field should not be displayed in preview tab', () => {
101
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
102
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseFieldPreviewTab(), 'notExist');
103
+ });
104
+
105
+ it('When the user adds a response container over the uploaded image, then a response field should be displayed in preview tab', () => {
106
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
107
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
108
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
109
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldIsDisplayedInPreviewTab(0);
110
+ });
111
+
112
+ it('When the user adds a second response container in image section, then a second response field should also be displayed in preview tab', () => {
113
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
114
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
115
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
116
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldIsDisplayedInPreviewTab(1);
117
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.responseFieldPreviewTab(), 2);
118
+ });
119
+
120
+ it('When the user removes a response container in image section, then the respective response field should also be removed from the image in preview tab', () => {
121
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
122
+ fillInTheGapsOverImageTextPage.steps.clickOnResponseContainerCloseButton(0);
123
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
124
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.responseFieldPreviewTab(), 1);
125
+ });
126
+
127
+ it('When the user has added response container in edit tab, then in preview tab it should be positioned in the same way as it is positioned in edit tab', () => {
128
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
129
+ let coordinatesOfResponse1 = fillInTheGapsOverImageTextPage.steps.getResponseContainerPositionCoordinates(0);
130
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
131
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldPositionCoordinatesInPreviewTab(0, coordinatesOfResponse1);
132
+ });
133
+ });
134
+
135
+ describe('Response container', () => {
136
+ abortEarlySetup();
137
+ before(() => {
138
+ cy.log('fill in the gaps over image - text');
139
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
140
+ cy.barsPreLoaderWait();
141
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
142
+ uploadImageSectionComponent.steps.unlockAspectRatio();
143
+ fillInTheGapsOverImageTextPage.steps.updateImageHeight(300);
144
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
145
+ });
146
+
147
+ it('When the user adds response container over the image, response container should be displayed with pointer, numeric count and close button', () => {
148
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
149
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerPointerInImageSection(0);
150
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerNumerationInImageSection(0);
151
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerCloseButtonInImageSection(0);
152
+ });
153
+
154
+ //Failing due to https://redmine.zeuslearning.com/issues/547543
155
+ it('CSS of \'Response container\' in image section', { tags: 'css' }, () => {
156
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.responseContainerPointer().find('circle'), {
157
+ 'fill': css.color.responseContainerPointer
158
+ });
159
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.responseContainerNumeration(), {
160
+ 'color': css.color.text,
161
+ 'font-size': css.fontSize.default,
162
+ 'font-weight': css.fontWeight.semibold
163
+ });
164
+ fillInTheGapsOverImageTextPage.responseContainerChevronDownArrow()
165
+ .verifyPseudoClassBeforeProperty('color', css.color.secondaryBtn);
166
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.responseContainerCloseButton(), {
167
+ 'background-color': css.color.secondaryBtnBg,
168
+ 'border': `1px solid ${css.color.activeComponentBorder}`
169
+ });
170
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.responseContainerCloseButton().find('.X-mark-icon'), {
171
+ 'fill': css.color.activeButtons,
172
+ });
173
+ });
174
+
175
+ it('Accessibility of \'Response container\' in image section', { tags: 'a11y' }, () => {
176
+ cy.checkAccessibility(fillInTheGapsOverImageTextPage.responseContainer().parents('.image-container'));
177
+ });
178
+
179
+ it('When the user adds multiple response containers such that their combined width(including padding around the response containers) is less than the width of the uploaded image i.e. in this case 2 response containers, then the response containers should be displayed in the same line', () => {
180
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
181
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerVerticalPosition(1, 0);
182
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerVerticalPosition(1, 1);
183
+ });
184
+
185
+ it('When the user adds multiple response containers such that their combined width(including padding around the response containers) is more than the width of the uploaded image i.e. in this case 3 response containers, then the response container which exceeds the image width(3rd response container) should be displayed below the previously added response containers', () => {
186
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
187
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerVerticalPosition(1, 0);
188
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerVerticalPosition(1, 1);
189
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerVerticalPosition(2, 2);
190
+ });
191
+
192
+ it('When the user removes a response container using the close button, then the position of the remaining response containers should not be changed', () => {
193
+ let coordinatesOfResponse1 = fillInTheGapsOverImageTextPage.steps.getResponseContainerPositionCoordinates(0);
194
+ let coordinatesOfResponse2 = fillInTheGapsOverImageTextPage.steps.getResponseContainerPositionCoordinates(2);
195
+ fillInTheGapsOverImageTextPage.steps.clickOnResponseContainerCloseButton(1);
196
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerPositionCoordinates(0, coordinatesOfResponse1);
197
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerPositionCoordinates(1, coordinatesOfResponse2);
198
+ });
199
+
200
+ //Failing due to - https://redmine.zeuslearning.com/issues/547537
201
+ it('When the user adds 15 response containers in the image section, then a snackbar with text \'You have reached the maximum number of tokens that can be added\' and a \'CLOSE\' button should be displayed', () => {
202
+ for (let numeration = 3; numeration < 16; numeration++) {
203
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
204
+ };
205
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.snackbar(), 'You have reached the maximum number of tokens that can be added.');
206
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.snackbarCloseButton(), 'CLOSE');
207
+ });
208
+
209
+ fillInTheGapsOverImageTextPage.tests.verifyMaximumNumberOfTokensSnackbarCSSandA11y();
210
+
211
+ it('When the user clicks on snackbar \'CLOSE\' button, the snackbar should disappear', () => {
212
+ //Add pre-step to remove and add response container
213
+ cy.log('Pre-step: Remove and add a response container to make the snackbar appear again');
214
+ fillInTheGapsOverImageTextPage.steps.clickOnResponseContainerCloseButton(14);
215
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
216
+ fillInTheGapsOverImageTextPage.steps.closeSnackBar();
217
+ });
218
+
219
+ fillInTheGapsOverImageTextPage.tests.verifyDisabledStateOfAddResponseContainerButton();
220
+ });
221
+ });