itemengine-cypress-automation 1.0.553-IEI-3480-e6afc10.0 → 1.0.553-IEI-7000-main-8cb7c78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettings.js +120 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettingsBasic.js +27 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -5
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +29 -21
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +140 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/pagination.js +16 -14
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +71 -3
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationAllViews.js +230 -0
- package/cypress/pages/components/additionalSettingsPanel.js +18 -0
- package/cypress/pages/components/draggableOptionsSectionComponent.js +1 -1
- package/cypress/pages/components/maximumCapacityPerDropzoneComponent.js +1 -1
- package/cypress/pages/components/optionsWrapperComponent.js +2 -2
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +197 -81
- package/package.json +1 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { dragAndDropIntoCategoriesPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
|
4
|
+
import { colorPopupComponent } from "../../../pages/components";
|
|
5
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
|
6
|
+
const views = utilities.getViews(correctAnswerViews);
|
|
7
|
+
const css = Cypress.env('css');
|
|
8
|
+
let itemReferenceID = "";
|
|
9
|
+
const modifiedColor = 'rgb(121, 60, 60)';
|
|
10
|
+
|
|
11
|
+
describe('Create Item page - Drag and drop into categories: Style and layout customization', () => {
|
|
12
|
+
before(() => {
|
|
13
|
+
cy.loginAs('admin');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
views.forEach((view) => {
|
|
17
|
+
describe(`${view}: Style and Layout Customization - Default State`, () => {
|
|
18
|
+
abortEarlySetup();
|
|
19
|
+
before(() => {
|
|
20
|
+
switch (view) {
|
|
21
|
+
case 'Question preview':
|
|
22
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
|
23
|
+
cy.barsPreLoaderWait();
|
|
24
|
+
dragAndDropIntoCategoriesPage.steps.addTextInQuestionInstructionsInputField('Navigating to drag and drop into categories');
|
|
25
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
|
26
|
+
break;
|
|
27
|
+
case 'Item preview':
|
|
28
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
29
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
30
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
|
31
|
+
break;
|
|
32
|
+
case 'Grading view':
|
|
33
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
34
|
+
break;
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
beforeEach(() => {
|
|
39
|
+
switch (view) {
|
|
40
|
+
case 'Question preview':
|
|
41
|
+
break;
|
|
42
|
+
case 'Item preview':
|
|
43
|
+
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
44
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
|
45
|
+
break;
|
|
46
|
+
case 'Grading view':
|
|
47
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
if (view === 'Question preview') {
|
|
53
|
+
after(() => {
|
|
54
|
+
dragAndDropIntoCategoriesPage.steps.clickOnSaveQuestionButton();
|
|
55
|
+
dragAndDropIntoCategoriesPage.steps.clickOnConfirmButton();
|
|
56
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
57
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
if (view === 'Grading view') {
|
|
62
|
+
it(`\'Row spacing\' no spacing option is selected then no spacing should be displayed between the row options${view}`, () => {
|
|
63
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowSpacingStudentView('No spacing');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it(`Options should have default alignment in ${view}`, () => {
|
|
67
|
+
dragAndDropIntoCategoriesPage.steps.verifyOptionAlignmentInPanelInStudentView();
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (view !== 'Grading view') {
|
|
72
|
+
it(`\'Row spacing\' no spacing option is selected then no spacing should be displayed between the row options${view}`, () => {
|
|
73
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowSpacingPreviewTab('No spacing');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it(`Options should have default alignment in ${view}`, () => {
|
|
77
|
+
dragAndDropIntoCategoriesPage.steps.verifyOptionAlignmentInPanelInPreviewTab('Left');
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
it(`\'Column spacing\' no spacing option is selected then no spacing should be displayed between column options${view}`, () => {
|
|
82
|
+
dragAndDropIntoCategoriesPage.steps.verifyColumnSpacingPreviewTab('No spacing');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it(`Dropzone should have default border color, fill color, and border style in ${view}`, () => {
|
|
86
|
+
dragAndDropIntoCategoriesPage.steps.verifyDropzoneBorderStylePreviewTab('dashed');
|
|
87
|
+
dragAndDropIntoCategoriesPage.steps.verifyFillColorPreviewTab(css.color.matrixDropzoneCellBg);
|
|
88
|
+
dragAndDropIntoCategoriesPage.steps.verifyBorderColorPreviewTab(css.color.activeComponentBorder);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it(`Draggable options should have default fill color, border color, and border style in ${view}`, () => {
|
|
92
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionsBorderStylePreviewTab('solid');
|
|
93
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionsFillColorPreviewTab(css.color.defaultBackground);
|
|
94
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionsBorderColorPreviewTab(css.color.figDefaultComponentBorder);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it(`Drag handle icon should be displayed in default state in ${view}`, () => {
|
|
98
|
+
dragAndDropIntoCategoriesPage.steps.verifyDragHandleIconPreviewTab('drag icon');
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it(`Draggable option panel should have default placement in ${view}`, () => {
|
|
102
|
+
dragAndDropIntoCategoriesPage.steps.verifyPanelPlacementPreviewTab('Bottom');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it(`Dropzone dimensions should be default state in ${view}`, () => {
|
|
106
|
+
dragAndDropIntoCategoriesPage.steps.verifyDropzoneDimensionsPreviewTab('Auto');
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
views.forEach((view) => {
|
|
112
|
+
describe(`${view}: Style and Layout Customization - modified State`, () => {
|
|
113
|
+
abortEarlySetup();
|
|
114
|
+
before(() => {
|
|
115
|
+
switch (view) {
|
|
116
|
+
case 'Question preview':
|
|
117
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
|
118
|
+
cy.barsPreLoaderWait();
|
|
119
|
+
dragAndDropIntoCategoriesPage.steps.addTextInQuestionInstructionsInputField('Navigating to drag and drop into categories');
|
|
120
|
+
dragAndDropIntoCategoriesPage.steps.expandStyleAndLayoutCustomizationAccordion();
|
|
121
|
+
dragAndDropIntoCategoriesPage.steps.expandRowSpacingDropdown();
|
|
122
|
+
dragAndDropIntoCategoriesPage.steps.selectRowSpacingDropdownOption('Small');
|
|
123
|
+
dragAndDropIntoCategoriesPage.steps.expandColumnSpacingDropdown();
|
|
124
|
+
dragAndDropIntoCategoriesPage.steps.selectColumnSpacingDropdownOption('Wide');
|
|
125
|
+
dragAndDropIntoCategoriesPage.steps.editColor(0);
|
|
126
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
|
127
|
+
colorPopupComponent.steps.clickOnOkButton();
|
|
128
|
+
dragAndDropIntoCategoriesPage.steps.editColor(1);
|
|
129
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
|
130
|
+
colorPopupComponent.steps.clickOnOkButton();
|
|
131
|
+
dragAndDropIntoCategoriesPage.steps.editColor(2);
|
|
132
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
|
133
|
+
colorPopupComponent.steps.clickOnOkButton();
|
|
134
|
+
dragAndDropIntoCategoriesPage.steps.editColor(3);
|
|
135
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
|
136
|
+
colorPopupComponent.steps.clickOnOkButton();
|
|
137
|
+
dragAndDropIntoCategoriesPage.steps.selectDragHandleOption(1);
|
|
138
|
+
dragAndDropIntoCategoriesPage.steps.selectDraggableOptionsBorderStyleOption('dotted');
|
|
139
|
+
dragAndDropIntoCategoriesPage.steps.selectDropzoneBorderStyleOption('solid');
|
|
140
|
+
dragAndDropIntoCategoriesPage.steps.selectPanelPlacementOption('Top');
|
|
141
|
+
dragAndDropIntoCategoriesPage.steps.selectOptionAlignmentInPanelOption('right');
|
|
142
|
+
dragAndDropIntoCategoriesPage.steps.expandDropzoneDimensionsDropdown();
|
|
143
|
+
dragAndDropIntoCategoriesPage.steps.selectDropzoneDimensionsDropdownOption('Custom');
|
|
144
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInDropzoneWidthInputField(0, 160);
|
|
145
|
+
dragAndDropIntoCategoriesPage.steps.verifyDropzoneWidthInputField(0, '160');
|
|
146
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
|
147
|
+
break;
|
|
148
|
+
case 'Item preview':
|
|
149
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
150
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
151
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
|
152
|
+
break;
|
|
153
|
+
case 'Grading view':
|
|
154
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
155
|
+
break;
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
beforeEach(() => {
|
|
160
|
+
switch (view) {
|
|
161
|
+
case 'Question preview':
|
|
162
|
+
break;
|
|
163
|
+
case 'Item preview':
|
|
164
|
+
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
165
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
|
166
|
+
break;
|
|
167
|
+
case 'Grading view':
|
|
168
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
if (view === 'Question preview') {
|
|
174
|
+
after(() => {
|
|
175
|
+
dragAndDropIntoCategoriesPage.steps.clickOnSaveQuestionButton();
|
|
176
|
+
dragAndDropIntoCategoriesPage.steps.clickOnConfirmButton();
|
|
177
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
178
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
if (view === 'Grading view') {
|
|
183
|
+
it(`\'Row spacing\' no spacing option is selected then small spacing should be displayed between the row options${view}`, () => {
|
|
184
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowSpacingStudentView('Small');
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (view !== 'Grading view') {
|
|
189
|
+
it(`\'Row spacing\' no spacing option is selected then small spacing should be displayed between the row options${view}`, () => {
|
|
190
|
+
dragAndDropIntoCategoriesPage.steps.verifyRowSpacingPreviewTab('Small');
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
it(`\'Column spacing\' no spacing option is selected then wide spacing should be displayed between column options${view}`, () => {
|
|
195
|
+
dragAndDropIntoCategoriesPage.steps.verifyColumnSpacingPreviewTab('Wide');
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it(`Dropzone should have modified border color, fill color, and border style in ${view}`, () => {
|
|
199
|
+
dragAndDropIntoCategoriesPage.steps.verifyDropzoneBorderStylePreviewTab('solid');
|
|
200
|
+
dragAndDropIntoCategoriesPage.steps.verifyBorderColorPreviewTab(modifiedColor);
|
|
201
|
+
dragAndDropIntoCategoriesPage.steps.verifyFillColorPreviewTab(modifiedColor);
|
|
202
|
+
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it(`Draggable options should have modified fill color, border color, and border style in ${view}`, () => {
|
|
206
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionsBorderStylePreviewTab('dotted');
|
|
207
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionsBorderColorAllView(modifiedColor);
|
|
208
|
+
dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionsFillColorPreviewTab(modifiedColor);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it(`Drag handle icon should be displayed in modified state in ${view}`, () => {
|
|
212
|
+
dragAndDropIntoCategoriesPage.steps.verifyDragHandleIconPreviewTab('arrow icon');
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it(`Draggable option panel should have modified placement in ${view}`, () => {
|
|
216
|
+
dragAndDropIntoCategoriesPage.steps.verifyPanelPlacementPreviewTab('Top');
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it(`Dropzone dimensions should be customized state in ${view}`, () => {
|
|
220
|
+
dragAndDropIntoCategoriesPage.steps.verifyDropzoneWidthPreviewTab(0, 160);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it(`Options should have modified alignment in ${view}`, () => {
|
|
224
|
+
dragAndDropIntoCategoriesPage.steps.verifyOptionAlignmentInPanelInPreviewTab('Right');
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
});
|
|
@@ -25,6 +25,8 @@ const selectors = {
|
|
|
25
25
|
},
|
|
26
26
|
fontSizeListOptionLabels: () => cy.get('[aria-labelledby*="Font-Size-dropdown-label"] li[role="option"] .dropdown-label-text'),
|
|
27
27
|
fontSizesLabels: () => cy.get('[aria-labelledby*="Font-Size-dropdown-label"] li[role="option"] .dropdown-post-label-text'),
|
|
28
|
+
teacherGuidelinesLabelInGradingView: () => cy.get('[class*="GradingViewstyles__GuidelineTitle"]'),
|
|
29
|
+
teacherGuidelinesDescriptionInGradingView: () => cy.get('[class*="GradingViewstyles__GuideLineDescription"] [data-testid*="question-instruction-element"]'),
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
const steps = {
|
|
@@ -71,6 +73,22 @@ const steps = {
|
|
|
71
73
|
additionalSettingsPanel.fontSizeDropdown()
|
|
72
74
|
.trigger('mouseover')
|
|
73
75
|
.click();
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* This function verifies 'Teacher guidelines' label
|
|
80
|
+
* @param {string} expectedText expected text for the label
|
|
81
|
+
*/
|
|
82
|
+
verifyTeacherGuidelinesLabelInGradingView: (expectedText) => {
|
|
83
|
+
utilities.verifyInnerText(additionalSettingsPanel.teacherGuidelinesLabelInGradingView(), expectedText);
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* This function verifies 'Teacher guidelines' description text
|
|
88
|
+
* @param {string} expectedText expected text for the description
|
|
89
|
+
*/
|
|
90
|
+
verifyTeacherGuidelinesDescriptionInGradingView: (expectedText) => {
|
|
91
|
+
utilities.verifyInnerText(additionalSettingsPanel.teacherGuidelinesDescriptionInGradingView(), expectedText);
|
|
74
92
|
}
|
|
75
93
|
}
|
|
76
94
|
|
|
@@ -245,7 +245,7 @@ const tests = {
|
|
|
245
245
|
utilities.verifyCSS(draggableOptionsSectionComponent.addGroupButton(), {
|
|
246
246
|
'color': css.color.secondaryBtnActive,
|
|
247
247
|
'font-size': css.fontSize.default,
|
|
248
|
-
'font-weight': css.fontWeight.
|
|
248
|
+
'font-weight': css.fontWeight.regular
|
|
249
249
|
});
|
|
250
250
|
});
|
|
251
251
|
|
|
@@ -5,7 +5,7 @@ const selectors = {
|
|
|
5
5
|
maxCapacityPerDropzoneDropdown: () => cy.get('#Maximum-capacity-per-dropzone-select'),
|
|
6
6
|
maxCapacityPerDropzoneDropdownListOptions: (ariaLabel = null) => {
|
|
7
7
|
if (ariaLabel) {
|
|
8
|
-
return cy.get(`[aria-labelledby*="Maximum-capacity-per-dropzone-dropdown-label"] [role="option"][aria-label
|
|
8
|
+
return cy.get(`[aria-labelledby*="Maximum-capacity-per-dropzone-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
|
|
9
9
|
} else {
|
|
10
10
|
return cy.get('[aria-labelledby*="Maximum-capacity-per-dropzone-dropdown-label"] [role="option"]')
|
|
11
11
|
}
|
|
@@ -343,7 +343,7 @@ const tests = {
|
|
|
343
343
|
utilities.verifyCSS(optionsWrapperComponent.addOptionButton(), {
|
|
344
344
|
'color': css.color.secondaryBtnActive,
|
|
345
345
|
'font-size': css.fontSize.default,
|
|
346
|
-
'font-weight': css.fontWeight.
|
|
346
|
+
'font-weight': css.fontWeight.regular
|
|
347
347
|
});
|
|
348
348
|
});
|
|
349
349
|
},
|
|
@@ -477,7 +477,7 @@ const tests = {
|
|
|
477
477
|
utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'visible')
|
|
478
478
|
utilities.verifyCSS(commonComponents.tooltipText(), {
|
|
479
479
|
'color': css.color.whiteText,
|
|
480
|
-
'font-size': css.fontSize.
|
|
480
|
+
'font-size': css.fontSize.small,
|
|
481
481
|
'font-weight': css.fontWeight.regular
|
|
482
482
|
});
|
|
483
483
|
utilities.getNthElement(optionsWrapperComponent.deleteOptionButton(), 0)
|