itemengine-cypress-automation 1.0.86 → 1.0.87
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +30 -30
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +568 -0
- package/cypress/e2e/ILC/EssayResponse/editAndPreviewTabScoringSection.js +86 -0
- package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +389 -0
- package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +112 -0
- package/cypress/e2e/ILC/EssayResponse/headerSection.js +68 -0
- package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +290 -0
- package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +79 -0
- package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +379 -0
- package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
- package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +115 -0
- package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +79 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/partialDifferentWeightsBasic.js +159 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +507 -29
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +6 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +272 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +300 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +204 -0
- package/cypress/e2e/ILC/Protractor/protractorEditTabBasicsSection.js +4 -4
- package/cypress/e2e/ILC/Protractor/protractorEditTabFunctionality.js +1 -1
- package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +4 -4
- package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -1
- package/cypress/e2e/ILC/SingleSelection/editTabScoringSection.js +1 -3
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +205 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +259 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethods2.js +217 -0
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +202 -0
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +613 -0
- package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +71 -0
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +318 -318
- package/cypress/fixtures/theme/ilc.json +3 -0
- package/cypress/pages/components/backgroundImageUploadComponent.js +1 -2
- package/cypress/pages/components/colorPopupComponent.js +26 -3
- package/cypress/pages/components/createCustomCategoryFlyout.js +351 -46
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +165 -0
- package/cypress/pages/components/equationEditorFlyout.js +124 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +3 -0
- package/cypress/pages/components/figOverImageCanvasComponent.js +316 -7
- package/cypress/pages/components/index.js +3 -1
- package/cypress/pages/components/opacityComponent.js +31 -4
- package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +1 -0
- package/cypress/pages/components/specialCharactersFlyoutComponent.js +1 -0
- package/cypress/pages/drawingResponsePage.js +33 -138
- package/cypress/pages/essayResponsePage.js +612 -26
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +48 -7
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +267 -13
- package/package.json +1 -1
@@ -0,0 +1,379 @@
|
|
1
|
+
import { essayResponsePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Essay Response Preview: Edit Table functionality', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Edit Table flyout contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
cy.log('Navigating to Essay Response, switching to preview tab and adding table to response field.');
|
15
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
essayResponsePage.steps.switchToPreviewTab();
|
18
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Table');
|
19
|
+
essayResponsePage.steps.checkAddRowHeaderCheckbox();
|
20
|
+
essayResponsePage.steps.addTable();
|
21
|
+
});
|
22
|
+
|
23
|
+
it('When user right clicks on the added table, then \'Edit Table\' flyout should appear.', () => {
|
24
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
|
25
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'visible');
|
26
|
+
});
|
27
|
+
|
28
|
+
it('CSS of \'Edit table\' flyout', { tags: 'css' }, () => {
|
29
|
+
const buttonSelectors = [essayResponsePage.editTableDialogBoxInsertBeforeButton, essayResponsePage.editTableDialogBoxInsertAfterButton, essayResponsePage.editTableDialogBoxDeleteColumnButton, essayResponsePage.editTableDialogBoxInsertAboveButton, essayResponsePage.editTableDialogBoxInsertBelowButton, essayResponsePage.editTableDialogBoxDeleteRowButton];
|
30
|
+
const buttonLabelSelectors = [essayResponsePage.editTableDialogBoxColumnsLabel, essayResponsePage.editTableDialogBoxRowsLabel];
|
31
|
+
const customizationLabelSelectors = [essayResponsePage.editTableDialogBoxAddRowHeaderLabel, essayResponsePage.editTableDialogBoxHighlightFirstColumnLabel];
|
32
|
+
|
33
|
+
utilities.verifyCSS(essayResponsePage.editTableDialogBoxTitle(), {
|
34
|
+
'color': css.color.flyoutTitle,
|
35
|
+
'font-size': css.fontSize.heading,
|
36
|
+
'font-weight': css.fontWeight.semibold
|
37
|
+
});
|
38
|
+
buttonLabelSelectors.forEach((label) => {
|
39
|
+
utilities.verifyCSS(label(), {
|
40
|
+
'color': css.color.labels,
|
41
|
+
'font-size': css.fontSize.normal,
|
42
|
+
'font-weight': css.fontWeight.semibold
|
43
|
+
});
|
44
|
+
});
|
45
|
+
buttonSelectors.forEach((button) => {
|
46
|
+
utilities.verifyCSS(button().find('span'), {
|
47
|
+
'color': css.color.secondaryBtn,
|
48
|
+
'font-size': css.fontSize.normal,
|
49
|
+
'font-weight': css.fontWeight.regular,
|
50
|
+
'background-color': css.color.transparent
|
51
|
+
});
|
52
|
+
});
|
53
|
+
customizationLabelSelectors.forEach((label) => {
|
54
|
+
utilities.verifyCSS(label().find('label'), {
|
55
|
+
'color': css.color.labelText,
|
56
|
+
'font-size': css.fontSize.normal,
|
57
|
+
'font-weight': css.fontWeight.regular
|
58
|
+
});
|
59
|
+
});
|
60
|
+
utilities.verifyCSS(essayResponsePage.addTableDialogBoxButtonCancel(), {
|
61
|
+
'color': css.color.secondaryBtn,
|
62
|
+
'font-size': css.fontSize.heading,
|
63
|
+
'font-weight': css.fontWeight.regular,
|
64
|
+
'background-color': css.color.secondaryBtnBg
|
65
|
+
});
|
66
|
+
utilities.verifyCSS(essayResponsePage.editTableDialogBoxButtonDelete(), {
|
67
|
+
'color': css.color.primaryBtn,
|
68
|
+
'font-size': css.fontSize.default,
|
69
|
+
'font-weight': css.fontWeight.regular,
|
70
|
+
'background-color': css.color.editTableDeleteButton
|
71
|
+
});
|
72
|
+
utilities.verifyCSS(essayResponsePage.editTableDialogBoxButtonSave(), {
|
73
|
+
'color': css.color.primaryBtn,
|
74
|
+
'font-size': css.fontSize.default,
|
75
|
+
'font-weight': css.fontWeight.regular,
|
76
|
+
'background-color': css.color.primaryBtnBg
|
77
|
+
});
|
78
|
+
});
|
79
|
+
|
80
|
+
it('Accessibility of \'Edit table\' flyout.', { tags: 'a11y' }, () => {
|
81
|
+
cy.checkAccessibility(essayResponsePage.editTableDialogBox());
|
82
|
+
});
|
83
|
+
|
84
|
+
it('Title of the flyout should be \'Table\'.', () => {
|
85
|
+
utilities.verifyElementVisibilityState(essayResponsePage.addTableDialogBoxTitle(), 'visible');
|
86
|
+
utilities.verifyInnerText(essayResponsePage.addTableDialogBoxTitle(), 'Table');
|
87
|
+
});
|
88
|
+
|
89
|
+
it('\'Add Header Row\' and \'Highlight First Column\' label should be displayed in the flyout with a checkbox beside it.', () => {
|
90
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxAddRowHeaderLabel(), 'visible');
|
91
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxAddRowHeaderLabel(), 'Add header row');
|
92
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxHighlightFirstColumnLabel(), 'visible');
|
93
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxHighlightFirstColumnLabel(), 'Highlight first column');
|
94
|
+
});
|
95
|
+
|
96
|
+
it('State of the checkboxes in the \'Add table\' flyout while adding the table should persist in \'Edit table\' flyout.', () => {
|
97
|
+
essayResponsePage.steps.verifyCheckedStateOfEditTableAddRowHeaderCheckbox();
|
98
|
+
essayResponsePage.steps.verifyUncheckedStateOfEditTableHighlightFirstColumnCheckbox();
|
99
|
+
});
|
100
|
+
|
101
|
+
it('The labels \'Columns\' and \'Rows\' should be displayed in the flyout along with their buttons \'Insert Before\', \'Insert Above\', \'Insert After\', \'Insert Below\', \'Delete Column\' and \'Delete Row\'.', () => {
|
102
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxColumnsLabel(), 'visible');
|
103
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxColumnsLabel(), 'Columns');
|
104
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxInsertBeforeButton(), 'visible');
|
105
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxInsertBeforeButton(), 'Insert before');
|
106
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxInsertAfterButton(), 'visible');
|
107
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxInsertAfterButton(), 'Insert after');
|
108
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxDeleteColumnButton(), 'visible');
|
109
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxDeleteColumnButton(), 'Delete column');
|
110
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxRowsLabel(), 'visible');
|
111
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxRowsLabel(), 'Rows');
|
112
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxInsertAboveButton(), 'visible');
|
113
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxInsertAboveButton(), 'Insert above');
|
114
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxInsertBelowButton(), 'visible');
|
115
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxInsertBelowButton(), 'Insert below');
|
116
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxDeleteRowButton(), 'visible');
|
117
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxDeleteRowButton(), 'Delete row');
|
118
|
+
});
|
119
|
+
|
120
|
+
it('\'Delete\' button should be displayed in the flyout.', () => {
|
121
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxButtonDelete(), 'visible');
|
122
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxButtonDelete(), 'Delete');
|
123
|
+
});
|
124
|
+
|
125
|
+
it('\'Save\' button should be displayed in the flyout.', () => {
|
126
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxButtonSave(), 'visible');
|
127
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxButtonSave(), 'Save');
|
128
|
+
});
|
129
|
+
|
130
|
+
it('\'Cancel\' button should be displayed in the flyout and when user clicks on \'Cancel\' button, then the flyout should close.', () => {
|
131
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBoxButtonCancel(), 'visible');
|
132
|
+
utilities.verifyInnerText(essayResponsePage.editTableDialogBoxButtonCancel(), 'Cancel');
|
133
|
+
essayResponsePage.steps.clickOnEditTableFlyoutCancelButton();
|
134
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'hidden');
|
135
|
+
});
|
136
|
+
});
|
137
|
+
|
138
|
+
describe('Columns section \'Insert Before\', \'Insert After\' and \'Delete Column\' button functionality.', () => {
|
139
|
+
abortEarlySetup();
|
140
|
+
before(() => {
|
141
|
+
cy.log('Navigating to Essay Response and switching to preview tab.');
|
142
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
143
|
+
cy.barsPreLoaderWait();
|
144
|
+
essayResponsePage.steps.switchToPreviewTab();
|
145
|
+
});
|
146
|
+
|
147
|
+
beforeEach(() => {
|
148
|
+
cy.log('Pre-step: Selecting the table and pressing backspace to delete the table.');
|
149
|
+
essayResponsePage.steps.enterInputInResponseField('{selectAll}{backspace}');
|
150
|
+
cy.log('Adding table to response field, clicking on \'Add row header\' and \'Highlight first column\' checkboxes and adding input to the table.');
|
151
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Table');
|
152
|
+
utilities.verifyElementVisibilityState(essayResponsePage.addTableDialogBox(), 'visible');
|
153
|
+
essayResponsePage.steps.checkAddRowHeaderCheckbox();
|
154
|
+
essayResponsePage.steps.checkHighlightFirstColumnCheckbox()
|
155
|
+
essayResponsePage.steps.addTable();
|
156
|
+
essayResponsePage.steps.addInputToTableHeaderCell(0, 'Header cell');
|
157
|
+
essayResponsePage.steps.addInputToTableCell(1, 'Standard cell');
|
158
|
+
});
|
159
|
+
|
160
|
+
it('When user clicks on \'Insert Before\' button, then a new column should be inserted to the left of the column in which the user had focused. Also the newly inserted column should be identical to the column in which user had focused.', () => {
|
161
|
+
cy.log('Pre-step: Right click in the required cell to open edit table flyout.');
|
162
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
163
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'visible');
|
164
|
+
essayResponsePage.steps.clickOnEditTableInsertBeforeButton();
|
165
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(1);
|
166
|
+
essayResponsePage.steps.clickOnEditTableInsertBeforeButton();
|
167
|
+
essayResponsePage.steps.verifyTableHeaderRowCellCount(5);
|
168
|
+
essayResponsePage.steps.verifyContentOfTableHeaderCell(1, 'Header cell');
|
169
|
+
essayResponsePage.steps.verifyTableProperties(2, 3, 7);
|
170
|
+
essayResponsePage.steps.verifyContentOfTableStandardCell(2, 'Standard cell');
|
171
|
+
});
|
172
|
+
|
173
|
+
it('When user clicks on \'Insert After\' button, then a new column should be inserted to the right of the column in which the user had focused. Also the newly inserted column should be identical to the column in which user had focused.', () => {
|
174
|
+
cy.log('Pre-step: Right click in the required cell to open edit table flyout.');
|
175
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
176
|
+
essayResponsePage.steps.clickOnEditTableInsertAfterButton();
|
177
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(1);
|
178
|
+
essayResponsePage.steps.clickOnEditTableInsertAfterButton();
|
179
|
+
essayResponsePage.steps.verifyTableHeaderRowCellCount(5);
|
180
|
+
essayResponsePage.steps.verifyContentOfTableHeaderCell(0, 'Header cell');
|
181
|
+
essayResponsePage.steps.verifyTableProperties(2, 3, 7);
|
182
|
+
essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
|
183
|
+
});
|
184
|
+
|
185
|
+
it('When a new column is inserted in the table, the column width of all the columns should decrease to fit the table width accordingly.', () => {
|
186
|
+
essayResponsePage.steps.compareColumnWidthWhenNewColumnIsAddedToTheTable();
|
187
|
+
});
|
188
|
+
|
189
|
+
it('When user clicks on \'Delete Column\' button then, the column in which it had focused should be deleted. Also the width of the remaining columns should increase to fit the table width accordingly.', () => {
|
190
|
+
essayResponsePage.steps.compareColumnWidthWhenColumnIsDeletedFromTheTable();
|
191
|
+
});
|
192
|
+
|
193
|
+
it('When user deletes the first highlighted column by clicking on the \'Delete Column\' button, then in edit table flyout the \'Highlight First Column\' checkbox should be unchecked.', () => {
|
194
|
+
cy.log('Pre-step: Right click in the required cell to open edit table flyout and then click on Delete Column button.');
|
195
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
196
|
+
essayResponsePage.steps.clickOnEditTableDeleteColumnButton();
|
197
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
|
198
|
+
essayResponsePage.steps.verifyUncheckedStateOfEditTableHighlightFirstColumnCheckbox();
|
199
|
+
});
|
200
|
+
});
|
201
|
+
|
202
|
+
describe('Rows section \'Insert Above\', \'Insert Below\' and \'Delete Row\' button functionality.', () => {
|
203
|
+
abortEarlySetup();
|
204
|
+
before(() => {
|
205
|
+
cy.log('Navigating to Essay Response and switching to preview tab.');
|
206
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
207
|
+
cy.barsPreLoaderWait();
|
208
|
+
essayResponsePage.steps.switchToPreviewTab();
|
209
|
+
});
|
210
|
+
|
211
|
+
beforeEach(() => {
|
212
|
+
cy.log('Pre-step: Selecting the table and pressing backspace to delete the table.');
|
213
|
+
essayResponsePage.steps.enterInputInResponseField('{selectAll}{backspace}');
|
214
|
+
cy.log('Adding table to response field, clicking on \'Add header row\' and \'Highlight first column\' checkboxes and adding input to the table.');
|
215
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Table');
|
216
|
+
utilities.verifyElementVisibilityState(essayResponsePage.addTableDialogBox(), 'visible');
|
217
|
+
essayResponsePage.steps.checkAddRowHeaderCheckbox();
|
218
|
+
essayResponsePage.steps.checkHighlightFirstColumnCheckbox()
|
219
|
+
essayResponsePage.steps.addTable();
|
220
|
+
essayResponsePage.steps.addInputToTableHeaderCell(3, 'Header cell');
|
221
|
+
essayResponsePage.steps.addInputToTableCell(1, 'Standard cell');
|
222
|
+
});
|
223
|
+
|
224
|
+
it('When user clicks on \'Insert Above\' button, then a new row should be inserted above the row in which the user had focused. Also the newly inserted row should be identical to the row in which user had focused.', () => {
|
225
|
+
cy.log('Pre-step: Right click in the required cell to open edit table flyout.');
|
226
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
227
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'visible');
|
228
|
+
essayResponsePage.steps.clickOnEditTableInsertAboveButton();
|
229
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(1);
|
230
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'visible');
|
231
|
+
essayResponsePage.steps.clickOnEditTableInsertAboveButton();
|
232
|
+
essayResponsePage.steps.verifyTableHeaderRowCellCount(6);
|
233
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 3);
|
234
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(1, 3);
|
235
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(2, 1);
|
236
|
+
essayResponsePage.steps.verifyTableRowStandardCellCount(2, 2);
|
237
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(3, 1);
|
238
|
+
essayResponsePage.steps.verifyTableRowStandardCellCount(3, 2);
|
239
|
+
essayResponsePage.steps.verifyContentOfTableHeaderCell(7, 'Header cell');
|
240
|
+
essayResponsePage.steps.verifyContentOfTableStandardCell(3, 'Standard cell');
|
241
|
+
});
|
242
|
+
|
243
|
+
it('When user clicks on \'Insert Below\' button, then a new row should be inserted below the row in which the user had focused. Also the newly inserted row should be identical to the row in which user had focused.', () => {
|
244
|
+
cy.log('Pre-step: Right click in the required cell to open edit table flyout.');
|
245
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
246
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'visible');
|
247
|
+
essayResponsePage.steps.clickOnEditTableInsertBelowButton();
|
248
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(1);
|
249
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'visible');
|
250
|
+
essayResponsePage.steps.clickOnEditTableInsertBelowButton();
|
251
|
+
essayResponsePage.steps.verifyTableHeaderRowCellCount(6);
|
252
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 3);
|
253
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(1, 3);
|
254
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(2, 1);
|
255
|
+
essayResponsePage.steps.verifyTableRowStandardCellCount(2, 2);
|
256
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(3, 1);
|
257
|
+
essayResponsePage.steps.verifyTableRowStandardCellCount(3, 2);
|
258
|
+
essayResponsePage.steps.verifyContentOfTableHeaderCell(6, 'Header cell');
|
259
|
+
essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
|
260
|
+
});
|
261
|
+
|
262
|
+
it('When user clicks on \'Delete Row\' button then, the row in which it had focused should be deleted.', () => {
|
263
|
+
cy.log('Pre-step: Right click in the required cell to open edit table flyout.');
|
264
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
265
|
+
essayResponsePage.steps.clickOnEditTableDeleteRowButton();
|
266
|
+
essayResponsePage.steps.verifyTableRowCount(1);
|
267
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 1);
|
268
|
+
essayResponsePage.steps.verifyTableRowStandardCellCount(0, 2);
|
269
|
+
essayResponsePage.steps.verifyContentOfTableHeaderCell(0, 'Header cell');
|
270
|
+
essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
|
271
|
+
});
|
272
|
+
|
273
|
+
it('When user deletes the header row by clicking on the \'Delete Row\' button, then in edit table flyout the \'Add Header Row\' checkbox should be unchecked.', () => {
|
274
|
+
cy.log('Pre-step: Right click in the required cell to open edit table flyout and click on Delete Row button.');
|
275
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
276
|
+
essayResponsePage.steps.clickOnEditTableDeleteRowButton();
|
277
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
|
278
|
+
essayResponsePage.steps.verifyUncheckedStateOfEditTableAddRowHeaderCheckbox();
|
279
|
+
});
|
280
|
+
});
|
281
|
+
|
282
|
+
describe('Edit \'Add header row\' and \'Highlight first column\' checkboxes.', () => {
|
283
|
+
abortEarlySetup();
|
284
|
+
before(() => {
|
285
|
+
cy.log('Navigating to Essay Response and switching to preview tab.');
|
286
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
287
|
+
cy.barsPreLoaderWait();
|
288
|
+
essayResponsePage.steps.switchToPreviewTab();
|
289
|
+
});
|
290
|
+
|
291
|
+
beforeEach(() => {
|
292
|
+
cy.log('Pre-step: Selecting the table and pressing backspace to delete the table.');
|
293
|
+
essayResponsePage.steps.enterInputInResponseField('{selectAll}{backspace}');
|
294
|
+
cy.log('Adding table to response field and opening edit table flyout.');
|
295
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Table');
|
296
|
+
essayResponsePage.steps.addTable();
|
297
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
|
298
|
+
});
|
299
|
+
|
300
|
+
it('When user checks the \'Add header row\' and \'Highlight first column\' checkboxes, and then clicks on Cancel button, then the flyout should close and no changes should be applied to the table.', () => {
|
301
|
+
essayResponsePage.steps.clickOnEditTableAddRowHeaderCheckbox();
|
302
|
+
essayResponsePage.steps.clickOnEditTableHighlightFirstColumnCheckbox();
|
303
|
+
essayResponsePage.steps.clickOnEditTableFlyoutCancelButton();
|
304
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'hidden');
|
305
|
+
essayResponsePage.steps.verifyTableProperties(2, 6, 0);
|
306
|
+
});
|
307
|
+
|
308
|
+
it('When user checks the \'Add header row\' checkbox, and then clicks on Save button, then the flyout should close and first row of the table should be highlighted as header.', () => {
|
309
|
+
essayResponsePage.steps.clickOnEditTableAddRowHeaderCheckbox();
|
310
|
+
essayResponsePage.steps.clickOnEditTableFlyoutSaveButton();
|
311
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'hidden');
|
312
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 3);
|
313
|
+
essayResponsePage.steps.verifyTableHeaderCellsAreHighlighted();
|
314
|
+
});
|
315
|
+
|
316
|
+
it('When user checks the \'Highlight first column\' checkbox, and then clicks on Save button, then the flyout should close and first column of the table should be highlighted as header.', () => {
|
317
|
+
essayResponsePage.steps.clickOnEditTableHighlightFirstColumnCheckbox();
|
318
|
+
essayResponsePage.steps.clickOnEditTableFlyoutSaveButton();
|
319
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'hidden');
|
320
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 1);
|
321
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(1, 1);
|
322
|
+
essayResponsePage.steps.verifyTableHeaderCellsAreHighlighted();
|
323
|
+
});
|
324
|
+
|
325
|
+
it('When there are multiple header rows in the table, and the user unchecks the previously checked \'Add header row\' checkbox and clicks on Save, then all the previous header rows in the table should not be highlighted.', () => {
|
326
|
+
cy.log('Pre-step: Add multiple header rows to the table.');
|
327
|
+
essayResponsePage.steps.clickOnEditTableAddRowHeaderCheckbox();
|
328
|
+
essayResponsePage.steps.clickOnEditTableFlyoutSaveButton();
|
329
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
330
|
+
essayResponsePage.steps.clickOnEditTableInsertAboveButton();
|
331
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
|
332
|
+
essayResponsePage.steps.clickOnEditTableAddRowHeaderCheckbox();
|
333
|
+
essayResponsePage.steps.clickOnEditTableFlyoutSaveButton();
|
334
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 0);
|
335
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 0);
|
336
|
+
});
|
337
|
+
|
338
|
+
it('When there are multiple highlighted columns in the table, and the user unchecks the previously checked \'Highlight first column\' checkbox and clicks on Save, then only the first column in the table should not be highlighted.', () => {
|
339
|
+
cy.log('Pre-step: Add multiple header rows to the table.');
|
340
|
+
essayResponsePage.steps.clickOnEditTableHighlightFirstColumnCheckbox();
|
341
|
+
essayResponsePage.steps.clickOnEditTableFlyoutSaveButton();
|
342
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
343
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'visible');
|
344
|
+
essayResponsePage.steps.clickOnEditTableInsertBeforeButton();
|
345
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
|
346
|
+
essayResponsePage.steps.clickOnEditTableHighlightFirstColumnCheckbox();
|
347
|
+
essayResponsePage.steps.clickOnEditTableFlyoutSaveButton();
|
348
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 1);
|
349
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(1, 1);
|
350
|
+
});
|
351
|
+
});
|
352
|
+
|
353
|
+
describe('Delete Table', () => {
|
354
|
+
abortEarlySetup();
|
355
|
+
before(() => {
|
356
|
+
cy.log('Navigating to essay response, switching to preview tab, adding a table to the response field and opening edit table flyout.');
|
357
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
358
|
+
cy.barsPreLoaderWait();
|
359
|
+
essayResponsePage.steps.switchToPreviewTab();
|
360
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Table');
|
361
|
+
essayResponsePage.steps.addTable();
|
362
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
|
363
|
+
});
|
364
|
+
|
365
|
+
it('When user clicks on \'Delete\' button, then the flyout should close and the table should be deleted.', () => {
|
366
|
+
essayResponsePage.steps.clickOnEditTableFlyoutDeleteButton();
|
367
|
+
utilities.verifyElementVisibilityState(essayResponsePage.editTableDialogBox(), 'hidden');
|
368
|
+
utilities.verifyElementVisibilityState(essayResponsePage.previewInputFieldTable(), 'notExist');
|
369
|
+
});
|
370
|
+
|
371
|
+
it('When the user selects the table in the response field and presses backspace then the table should get deleted.', () => {
|
372
|
+
cy.log('Pre-step: Adding a table to the response field.');
|
373
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Table');
|
374
|
+
essayResponsePage.steps.addTable();
|
375
|
+
essayResponsePage.steps.enterInputInResponseField('{selectAll}{backspace}');
|
376
|
+
utilities.verifyElementVisibilityState(essayResponsePage.previewInputFieldTable(), 'notExist');
|
377
|
+
});
|
378
|
+
});
|
379
|
+
});
|
@@ -0,0 +1,207 @@
|
|
1
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
2
|
+
import { essayResponseBasicPage } from "../../../pages";
|
3
|
+
import { commonComponents } from "../../../pages/components";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const formattingOptions = [essayResponseBasicPage.cutCustomizeFormattingOption, essayResponseBasicPage.copyCustomizeFormattingOption, essayResponseBasicPage.pasteCustomizeFormattingOption, essayResponseBasicPage.specialCharacterCustomizeFormattingOption];
|
7
|
+
const formattingOptionLabel = ['Cut', 'Copy', 'Paste', 'Special characters'];
|
8
|
+
const stateOfFormattingOption = ['ngie-toggle-button-selected', 'ngie-toggle-button-selected', 'ngie-toggle-button-selected', 'ngie-toggle-button-not-selected'];
|
9
|
+
|
10
|
+
describe('Create question page - Essay Response - Basic: Customize formatting options (for student player) section contents, toolbar options', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('Customize formatting options (for student player) section contents', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
|
19
|
+
});
|
20
|
+
|
21
|
+
it('\'Customize formatting options (for student player)\' label should be displayed and expand collapse icon should not be displayed beside the label. By default, following options should be in selected state - \'Cut, Copy, Paste\'. Special characters option should be in unselected state', () => {
|
22
|
+
essayResponseBasicPage.customizeFormattingOptionsSectionLabel()
|
23
|
+
.verifyInnerText('Customize formatting options (for student player)');
|
24
|
+
essayResponseBasicPage.customizeFormattingOptionsSectionLabel()
|
25
|
+
.find('.MuiExpansionPanelSummary-expandIcon')
|
26
|
+
.should('not.exist');
|
27
|
+
formattingOptions.forEach((button, count) => {
|
28
|
+
button()
|
29
|
+
.verifyInnerText(formattingOptionLabel[count])
|
30
|
+
.and('have.class', stateOfFormattingOption[count]);
|
31
|
+
});
|
32
|
+
});
|
33
|
+
|
34
|
+
it('CSS of \'Customize formatting options (for student player)\' label and contents', { tags: 'css' }, () => {
|
35
|
+
cy.log('CSS of Customize formatting options (for student player) label');
|
36
|
+
essayResponseBasicPage.customizeFormattingOptionsSectionLabel()
|
37
|
+
.verifyCSS(css.color.sectionHeading, css.fontSize.default, css.fontWeight.semibold);//Issue posted- https://redmine.zeuslearning.com/issues/525805
|
38
|
+
cy.log('CSS of selected toolbar formatting option')
|
39
|
+
essayResponseBasicPage.cutCustomizeFormattingOption()
|
40
|
+
.should('have.css', 'background-color', css.color.activeButtons)
|
41
|
+
.within(() => {
|
42
|
+
commonComponents.tickIconForOptionButtons()
|
43
|
+
.should('have.css', 'color', css.color.defaultBackground);
|
44
|
+
essayResponseBasicPage.customizeFormattingOptionsIcon()
|
45
|
+
.should('have.css', 'color', css.color.defaultBackground);
|
46
|
+
essayResponseBasicPage.customizeFormattingOptionsLabel()
|
47
|
+
.verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.regular);
|
48
|
+
});
|
49
|
+
cy.log('CSS of unselected toolbar formatting option')
|
50
|
+
essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
|
51
|
+
.should('have.css', 'background-color', css.color.secondaryBtnBg)
|
52
|
+
.within(() => {
|
53
|
+
essayResponseBasicPage.customizeFormattingOptionsLabel()
|
54
|
+
.verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.regular);
|
55
|
+
});
|
56
|
+
});
|
57
|
+
|
58
|
+
it('Accessibility of \'Customize formatting options (for student player)\' label and contents', { tags: 'a11y' }, () => {
|
59
|
+
cy.checkAccessibility(essayResponseBasicPage.customizeFormattingOptionsWrapper());
|
60
|
+
});
|
61
|
+
});
|
62
|
+
|
63
|
+
describe('Customize formatting options (for student player) - Preview tab contents', () => {
|
64
|
+
abortEarlySetup();
|
65
|
+
before(() => {
|
66
|
+
essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
|
67
|
+
cy.barsPreLoaderWait();
|
68
|
+
essayResponseBasicPage.steps.switchToPreviewTab();
|
69
|
+
});
|
70
|
+
|
71
|
+
beforeEach(() => {
|
72
|
+
essayResponseBasicPage.steps.resetPreviewTabResponseField();
|
73
|
+
});
|
74
|
+
|
75
|
+
it('When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - \'Cut, Copy, Paste\'', () => {
|
76
|
+
essayResponseBasicPage.previewTabToolbarWrapper()
|
77
|
+
.within(() => {
|
78
|
+
formattingOptionLabel.slice(0, 2).forEach((optionName, count) => {
|
79
|
+
cy.get('.cke_button')
|
80
|
+
.eq(count)
|
81
|
+
.should('have.attr', 'title', optionName)
|
82
|
+
.and('be.visible');
|
83
|
+
});
|
84
|
+
essayResponseBasicPage.previewTabToolbarOption('Special Characters')
|
85
|
+
.should('not.exist');
|
86
|
+
});
|
87
|
+
});
|
88
|
+
|
89
|
+
it('When the user selects all formatting options from the \'Customize formatting options (for student player)\' section, all formatting options should appear in the preview tab and all options should be in enabled sate', () => {
|
90
|
+
cy.log('Switching to edit tab')
|
91
|
+
essayResponseBasicPage.steps.switchToEditTab()
|
92
|
+
essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
|
93
|
+
.click();
|
94
|
+
essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
|
95
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
96
|
+
essayResponseBasicPage.steps.switchToPreviewTab();
|
97
|
+
essayResponseBasicPage.previewTabToolbarWrapper()
|
98
|
+
.within(() => {
|
99
|
+
formattingOptionLabel.forEach((optionName, count) => {
|
100
|
+
cy.get('.cke_button')
|
101
|
+
.eq(count)
|
102
|
+
.should('have.attr', 'title', optionName)
|
103
|
+
.and('be.visible');
|
104
|
+
});
|
105
|
+
});
|
106
|
+
});
|
107
|
+
|
108
|
+
it('CSS of formatting options in Preview tab', { tags: 'css' }, () => {
|
109
|
+
essayResponseBasicPage.previewTabToolbarOption('Cut')
|
110
|
+
.find('.cke_button_icon')
|
111
|
+
.should('have.css', 'color', css.color.activeButtons);
|
112
|
+
});
|
113
|
+
|
114
|
+
it('Accessibility of formatting options in Preview tab', { tags: 'a11y' }, () => {
|
115
|
+
cy.checkAccessibility(essayResponseBasicPage.previewTabToolbarWrapper())
|
116
|
+
});
|
117
|
+
|
118
|
+
it('When the user deselects an option from \'Customize formatting options (for student player)\' section, then that option should not be displayed in the preview tab toolbar.', () => {
|
119
|
+
cy.log('Switching to edit tab')
|
120
|
+
essayResponseBasicPage.steps.switchToEditTab()
|
121
|
+
essayResponseBasicPage.cutCustomizeFormattingOption()
|
122
|
+
.click()
|
123
|
+
.should('have.class', 'ngie-toggle-button-not-selected');
|
124
|
+
essayResponseBasicPage.steps.switchToPreviewTab();
|
125
|
+
cy.barsPreLoaderWait();
|
126
|
+
essayResponseBasicPage.previewTabToolbarWrapper()
|
127
|
+
.within(() => {
|
128
|
+
essayResponseBasicPage.previewTabToolbarOption('Cut')
|
129
|
+
.should('not.exist');
|
130
|
+
});
|
131
|
+
});
|
132
|
+
});
|
133
|
+
|
134
|
+
describe('Cut, Copy, Paste formatting options - Preview tab', () => {
|
135
|
+
abortEarlySetup();
|
136
|
+
before(() => {
|
137
|
+
essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
|
138
|
+
cy.barsPreLoaderWait();
|
139
|
+
essayResponseBasicPage.steps.setWordLimit(5);
|
140
|
+
cy.log('Selecting \'Special Characters\' formatting option from Edit tab');
|
141
|
+
essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
|
142
|
+
.click()
|
143
|
+
essayResponseBasicPage.steps.switchToPreviewTab();
|
144
|
+
cy.barsPreLoaderWait();
|
145
|
+
});
|
146
|
+
|
147
|
+
afterEach(() => {
|
148
|
+
essayResponseBasicPage.steps.resetPreviewTabResponseField();
|
149
|
+
});
|
150
|
+
|
151
|
+
it('When the user selects the text from the response field and clicks on the \'Cut\', then the text should get removed from the field and word count should update accordingly', () => {
|
152
|
+
essayResponseBasicPage.responseField()
|
153
|
+
.type('Lorem Ipsum dolor');
|
154
|
+
essayResponseBasicPage.steps.cutTextFromResponseField();
|
155
|
+
essayResponseBasicPage.responseField()
|
156
|
+
.verifyInnerText('');
|
157
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('0/5');
|
158
|
+
});
|
159
|
+
|
160
|
+
it('When the user has cut some text from response and clicks on the \'Paste\' option, the text that was cut should get pasted in the response field and the word count should increase accordingly', () => {
|
161
|
+
essayResponseBasicPage.responseField()
|
162
|
+
.type('Lorem Ipsum dolor');
|
163
|
+
essayResponseBasicPage.steps.cutTextFromResponseField();
|
164
|
+
essayResponseBasicPage.previewTabToolbarOption('Paste')
|
165
|
+
.click();
|
166
|
+
essayResponseBasicPage.responseField()
|
167
|
+
.verifyInnerText('Lorem Ipsum dolor');
|
168
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('3/5');
|
169
|
+
});
|
170
|
+
|
171
|
+
it('When the user enters text in the response field, selects the text and then clicks on the \'Copy\', the text should get copied and when the user clicks on the \'Paste\' toolbar option, then the copied text should get pasted in response field and the word count should increase accordingly', () => {
|
172
|
+
essayResponseBasicPage.responseField()
|
173
|
+
.type('Lorem Ipsum ');
|
174
|
+
essayResponseBasicPage.steps.copyTextFromResponseField();
|
175
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('2/5');
|
176
|
+
essayResponseBasicPage.previewTabToolbarOption('Paste')
|
177
|
+
.click();
|
178
|
+
essayResponseBasicPage.responseField()
|
179
|
+
.verifyInnerText('Lorem Ipsum\u00a0Lorem Ipsum\u00a0');
|
180
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('4/5');
|
181
|
+
});
|
182
|
+
|
183
|
+
it('User should not be able to paste text more than max word limit.', () => {
|
184
|
+
essayResponseBasicPage.responseField()
|
185
|
+
.type('Lorem ipsum, dolor sit.');
|
186
|
+
essayResponseBasicPage.steps.copyTextFromResponseField();
|
187
|
+
essayResponseBasicPage.previewTabToolbarOption('Paste')
|
188
|
+
.click();
|
189
|
+
essayResponseBasicPage.responseField()
|
190
|
+
.verifyInnerText('Lorem ipsum, dolor sit.');
|
191
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('4/5');
|
192
|
+
});
|
193
|
+
|
194
|
+
it('When the user tries to paste a text and the word limit reaches after pasting, \'word limit reached\' warning message should be displayed beside word count.', () => {
|
195
|
+
essayResponseBasicPage.responseField()
|
196
|
+
.type('Lorem Ipsum dolor');
|
197
|
+
essayResponseBasicPage.steps.copyTextFromResponseField();
|
198
|
+
essayResponseBasicPage.previewTabToolbarOption('Paste')
|
199
|
+
.click();
|
200
|
+
essayResponseBasicPage.responseField()
|
201
|
+
.verifyInnerText('Lorem Ipsum dolorLorem Ipsum dolor');
|
202
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('5/5');
|
203
|
+
essayResponseBasicPage.wordLimitReachedWarningMessage();
|
204
|
+
});
|
205
|
+
});
|
206
|
+
//TO DO- Special characters flyout cases are pending
|
207
|
+
});
|