itemengine-cypress-automation 1.0.19 → 1.0.21
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.js +932 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.js +333 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEditCategoryFlyout.js +402 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEditTabBasicSections.js +558 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.js +572 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditorCategories1.js +290 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditorCategories2.js +514 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseHeaderSection.js +80 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponsePreviewAddTable.js +412 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponsePreviewEditTable.js +659 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponsePreviewHyperlink.js +318 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseScoringSection.js +59 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +33 -0
- package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
- package/cypress/e2e/ILC/EssayResponseMath/essayResponseMathCharacters.js +38 -0
- package/cypress/e2e/ILC/EssayResponseMath/essayResponseMathCreateItem.js +243 -0
- package/package.json +1 -1
@@ -0,0 +1,318 @@
|
|
1
|
+
import { essayResponsePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
|
5
|
+
describe('Essay Response Preview: Hyperlink', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Hyperlink popup contents', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
cy.log('Navigate to Essay Response question type and switching to preview tab.');
|
14
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
15
|
+
essayResponsePage.steps.switchToPreviewTab();
|
16
|
+
});
|
17
|
+
|
18
|
+
it('Hyperlink option should be displayed in the preview tab toolbar', () => {
|
19
|
+
essayResponsePage.previewTabToolbarOption('Insert Hyperlink')
|
20
|
+
.should('be.visible');
|
21
|
+
});
|
22
|
+
|
23
|
+
it('When user clicks on Hyperlink option, then the Hyperlink popup should appear and by default the cursor should be focused inside the \'Display text\' input field', () => {
|
24
|
+
essayResponsePage.previewTabToolbarOption('Insert Hyperlink')
|
25
|
+
.click();
|
26
|
+
essayResponsePage.hyperlinkDialogBox()
|
27
|
+
.should('be.visible');
|
28
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
29
|
+
.should('have.css', 'border-color', css.color.activeButtons); //To check that focus is inside input field
|
30
|
+
});
|
31
|
+
|
32
|
+
it('Title of the popup should be \'Hyperlink\'', () => {
|
33
|
+
essayResponsePage.hyperlinkDialogBoxTitle()
|
34
|
+
.verifyInnerText('Hyperlink');
|
35
|
+
});
|
36
|
+
|
37
|
+
it('CSS of the \'Hyperlink\' popup', { tags: 'css' }, () => {
|
38
|
+
essayResponsePage.hyperlinkDialogBoxTitle()
|
39
|
+
.verifyCSS(css.color.questionHeading, css.fontSize.heading, css.fontWeight.bold);
|
40
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
41
|
+
.verifyCSS(css.color.standardTableCellText, css.fontSize.heading, css.fontWeight.regular)
|
42
|
+
.and('have.css', 'background-color', css.color.defaultBackground);
|
43
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
44
|
+
.verifyCSS(css.color.standardTableCellText, css.fontSize.heading, css.fontWeight.regular)
|
45
|
+
.and('have.css', 'background-color', css.color.defaultBackground);
|
46
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextLabel()
|
47
|
+
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
48
|
+
essayResponsePage.hyperlinkDialogboxURLLabel()
|
49
|
+
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
50
|
+
essayResponsePage.hyperlinkDialogboxButtonOk()
|
51
|
+
.verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.regular)
|
52
|
+
.should('have.css', 'background-color', css.color.primaryBtnBg);
|
53
|
+
essayResponsePage.hyperlinkDialogboxButtonCancel()
|
54
|
+
.should('have.css', 'background-color', css.color.secondaryBtnBg)
|
55
|
+
.find('.cke_dialog_ui_button')
|
56
|
+
.verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.regular);
|
57
|
+
});
|
58
|
+
|
59
|
+
it('Accessibility of the \'Hyperlink\' popup', { tags: 'a11y' }, () => {
|
60
|
+
cy.checkAccessibility(essayResponsePage.hyperlinkDialogBox());
|
61
|
+
});
|
62
|
+
|
63
|
+
it('\'Display text\' and \'URL\' labels and input fields should be displayed in the Hyperlink popup and the input fields should be blank by default', () => {
|
64
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextLabel()
|
65
|
+
.should('be.visible');
|
66
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
67
|
+
.should('be.visible')
|
68
|
+
.and('have.value', '');
|
69
|
+
essayResponsePage.hyperlinkDialogboxURLLabel()
|
70
|
+
.should('be.visible');
|
71
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
72
|
+
.should('be.visible')
|
73
|
+
.and('have.value', '');
|
74
|
+
});
|
75
|
+
|
76
|
+
it('\'Ok\' button should be displayed in the popup', () => {
|
77
|
+
essayResponsePage.hyperlinkDialogboxButtonOk()
|
78
|
+
.should('be.visible');
|
79
|
+
});
|
80
|
+
|
81
|
+
it('\'Cancel\' button should be displayed in the popup and when user clicks on it then the popup should close', () => {
|
82
|
+
essayResponsePage.hyperlinkDialogboxButtonCancel()
|
83
|
+
.should('be.visible')
|
84
|
+
.click();
|
85
|
+
essayResponsePage.hyperlinkDialogBox()
|
86
|
+
.should('not.be.visible');
|
87
|
+
});
|
88
|
+
});
|
89
|
+
|
90
|
+
describe('Add a Hyperlink to the response field', () => {
|
91
|
+
abortEarlySetup()
|
92
|
+
before(() => {
|
93
|
+
cy.log('Navigate to Essay Response question type and switching to preview tab and opening Hyperlink popup.');
|
94
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
95
|
+
essayResponsePage.steps.switchToPreviewTab();
|
96
|
+
essayResponsePage.previewTabToolbarOption('Insert Hyperlink')
|
97
|
+
.click();
|
98
|
+
});
|
99
|
+
|
100
|
+
it('When user keeps the URL input field empty and clicks on \'Ok\' button, then a browser alert popup should be displayed with the message "Please type the link URL" and the hyperlink popup should remain open', () => {
|
101
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
102
|
+
.type('lorem')
|
103
|
+
.should('have.value', 'lorem');
|
104
|
+
essayResponsePage.hyperlinkDialogboxButtonOk()
|
105
|
+
.click();
|
106
|
+
cy.on('window:alert', (alert) => {
|
107
|
+
expect(alert).to.deep.eq('Please type the link URL');
|
108
|
+
});
|
109
|
+
essayResponsePage.hyperlinkDialogBox()
|
110
|
+
.should('be.visible');
|
111
|
+
});
|
112
|
+
|
113
|
+
it('When user gives input only to \'URL\' input field and clicks on \'Ok\' button, then the \'Hyperlink\' popup should close, hyperlink should be displayed in the response field and in the added hyperlink\'s popup, the display text input field should be prefilled with the previously added URL', () => {
|
114
|
+
cy.log('Pre-step: Clear display text input field.');
|
115
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
116
|
+
.clear();
|
117
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
118
|
+
.type(`${Cypress.config().baseUrl}`);
|
119
|
+
essayResponsePage.hyperlinkDialogboxButtonOk()
|
120
|
+
.click();
|
121
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
122
|
+
.verifyInnerText(`${Cypress.config().baseUrl}`)
|
123
|
+
.and('have.attr', 'href', `${Cypress.config().baseUrl}`);
|
124
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
125
|
+
.rightclick();
|
126
|
+
essayResponsePage.hyperlinkDialogBox()
|
127
|
+
.should('exist');
|
128
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
129
|
+
.should('have.value', `${Cypress.config().baseUrl}`);
|
130
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
131
|
+
.should('have.value', `${Cypress.config().baseUrl}`);
|
132
|
+
cy.log('Post-step: Click on cancel button to close popup');
|
133
|
+
essayResponsePage.hyperlinkDialogboxButtonCancel()
|
134
|
+
.click();
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When the user has added a hyperlink to the response area then the word count should be increased by 1', () => {
|
138
|
+
essayResponsePage.responseFieldWordCount()
|
139
|
+
.verifyInnerText('1/10000');
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When user removes the added hyperlink, then the word count should be decreased by 1', () => {
|
143
|
+
essayResponsePage.responseField()
|
144
|
+
.clear();
|
145
|
+
essayResponsePage.responseFieldWordCount()
|
146
|
+
.verifyInnerText('0/10000');
|
147
|
+
});
|
148
|
+
|
149
|
+
it('When user gives a normal text input to the URL input field in the hyper link popup and clicks on Ok button, then \'https://\' should be appended to the given input in the hyperlink text displayed in the response field', () => {
|
150
|
+
cy.log('Switching to edit tab')
|
151
|
+
essayResponsePage.steps.switchToEditTab();
|
152
|
+
essayResponsePage.steps.switchToPreviewTab();
|
153
|
+
essayResponsePage.previewTabToolbarOption('Insert Hyperlink')
|
154
|
+
.click();
|
155
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
156
|
+
.type('lorem');
|
157
|
+
essayResponsePage.hyperlinkDialogboxButtonOk()
|
158
|
+
.click();
|
159
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
160
|
+
.verifyInnerText('https://lorem')
|
161
|
+
.and('have.attr', 'href', 'https://lorem');
|
162
|
+
});
|
163
|
+
|
164
|
+
it('When user shifts the cursor away from the hyperlink and clicks on \'Hyperlink\' option in the toolbar, then the Hyperlink popup should appear again in its default state', () => {
|
165
|
+
essayResponsePage.responseField()
|
166
|
+
.click()
|
167
|
+
.type(' ');
|
168
|
+
essayResponsePage.previewTabToolbarOption('Insert Hyperlink')
|
169
|
+
.click();
|
170
|
+
essayResponsePage.hyperlinkDialogBox()
|
171
|
+
.should('be.visible');
|
172
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
173
|
+
.should('have.value', '');
|
174
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
175
|
+
.should('have.value', '');
|
176
|
+
});
|
177
|
+
|
178
|
+
it('When user adds both \'Display text\' as well as \'URL\' in the hyperlink popup and clicks on Ok button, then the hyperlink with the added display text and URL should be displayed in the response field', () => {
|
179
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
180
|
+
.type('Link');
|
181
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
182
|
+
.type(`${Cypress.config().baseUrl}`);
|
183
|
+
essayResponsePage.hyperlinkDialogboxButtonOk()
|
184
|
+
.click();
|
185
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
186
|
+
.eq(1)
|
187
|
+
.verifyInnerText('Link')
|
188
|
+
.and('have.attr', 'href', `${Cypress.config().baseUrl}`);
|
189
|
+
});
|
190
|
+
|
191
|
+
it('CSS of the hyperlink in response field', { tags: 'css' }, () => {
|
192
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
193
|
+
.eq(1)
|
194
|
+
.verifyCSS(css.color.linkText, css.fontSize.default, css.fontWeight.regular);
|
195
|
+
});
|
196
|
+
|
197
|
+
it('Accessibility of the hyperlink in response field', { tags: 'a11y' }, () => {
|
198
|
+
cy.checkAccessibility(essayResponsePage.previewInputFieldHyperlinkText());
|
199
|
+
});
|
200
|
+
});
|
201
|
+
|
202
|
+
describe('Edit a previously added hyperlink', () => {
|
203
|
+
abortEarlySetup()
|
204
|
+
before(() => {
|
205
|
+
cy.log('Navigate to Essay Response question type and switching to preview tab and adding Hyperlink to response area.');
|
206
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
207
|
+
essayResponsePage.steps.switchToPreviewTab();
|
208
|
+
essayResponsePage.previewTabToolbarOption('Insert Hyperlink')
|
209
|
+
.click();
|
210
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
211
|
+
.type('Link');
|
212
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
213
|
+
.type(`${Cypress.config().baseUrl}`);
|
214
|
+
essayResponsePage.hyperlinkDialogboxButtonOk()
|
215
|
+
.click();
|
216
|
+
});
|
217
|
+
|
218
|
+
it('When the added hyperlink is in focus and user clicks on \'Hyperlink\' toolbar option then \'Hyperlink\' popup should appear with the details of the focused hyperlink', () => {
|
219
|
+
essayResponsePage.previewTabToolbarOption('Insert Hyperlink')
|
220
|
+
.click();
|
221
|
+
essayResponsePage.hyperlinkDialogBox()
|
222
|
+
.should('be.visible');
|
223
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
224
|
+
.should('have.value', 'Link');
|
225
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
226
|
+
.should('have.value', `${Cypress.config().baseUrl}`);
|
227
|
+
cy.log('Post-step: Click on cancel button to close hyperlink popup');
|
228
|
+
essayResponsePage.hyperlinkDialogboxButtonCancel()
|
229
|
+
.click();
|
230
|
+
});
|
231
|
+
|
232
|
+
it('When the user double clicks on the added hyperlink then \'Hyperlink\' popup should appear with the details of the focused hyperlink', () => {
|
233
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
234
|
+
.dblclick();
|
235
|
+
essayResponsePage.hyperlinkDialogBox()
|
236
|
+
.should('be.visible');
|
237
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
238
|
+
.should('have.value', 'Link');
|
239
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
240
|
+
.should('have.value', `${Cypress.config().baseUrl}`);
|
241
|
+
cy.log('Post-step: Click on cancel button to close hyperlink popup');
|
242
|
+
essayResponsePage.hyperlinkDialogboxButtonCancel()
|
243
|
+
.click();
|
244
|
+
});
|
245
|
+
|
246
|
+
it('When the added hyperlink is in focus and user right clicks on it, then \'Hyperlink\' popup should appear with the details of the focused hyperlink', () => {
|
247
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
248
|
+
.rightclick();
|
249
|
+
essayResponsePage.hyperlinkDialogBox()
|
250
|
+
.should('be.visible');
|
251
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
252
|
+
.should('have.value', 'Link');
|
253
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
254
|
+
.should('have.value', `${Cypress.config().baseUrl}`);
|
255
|
+
});
|
256
|
+
|
257
|
+
it('When user updates the details of a pre-existing hyperlink in its hyperlink popup and clicks on \'Cancel\' button, then the updated details should not be reflected in the displayed hyperlink', () => {
|
258
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
259
|
+
.clear()
|
260
|
+
.type('Edited');
|
261
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
262
|
+
.clear()
|
263
|
+
.type('https://www.google.com');
|
264
|
+
essayResponsePage.hyperlinkDialogboxButtonCancel()
|
265
|
+
.click();
|
266
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
267
|
+
.verifyInnerText('Link')
|
268
|
+
.and('have.attr', 'href', `${Cypress.config().baseUrl}`);
|
269
|
+
});
|
270
|
+
|
271
|
+
it('When user updates the details of a pre-existing hyperlink in its hyperlink popup and clicks on \'Ok\' button, then the updated details should be reflected in the displayed hyperlink', () => {
|
272
|
+
cy.log('Pre-step: Right click on the hyperlink to open its hyperlink popup');
|
273
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
274
|
+
.rightclick();
|
275
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
276
|
+
.clear()
|
277
|
+
.type('Edited');
|
278
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
279
|
+
.clear()
|
280
|
+
.type('https://www.google.com');
|
281
|
+
essayResponsePage.hyperlinkDialogboxButtonOk()
|
282
|
+
.click();
|
283
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
284
|
+
.verifyInnerText('Edited')
|
285
|
+
.and('have.attr', 'href', 'https://www.google.com');
|
286
|
+
});
|
287
|
+
|
288
|
+
it('When the user right clicks on automatically hyperlinked text then the hyperlink popup should open and the details should be correctly displayed in the popup, and the user should be able to edit the details of the automatically hyperlinked text', () => {
|
289
|
+
cy.log('Pre-step: Clearing the response area and typing a link in the response area for automatic hyperlinking');
|
290
|
+
essayResponsePage.responseField()
|
291
|
+
.type(`{selectAll}{backspace}${Cypress.config().baseUrl} `);
|
292
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
293
|
+
.rightclick();
|
294
|
+
essayResponsePage.hyperlinkDialogboxDisplayTextInputField()
|
295
|
+
.should('have.value', `${Cypress.config().baseUrl}`)
|
296
|
+
.clear()
|
297
|
+
.type('Google')
|
298
|
+
.should('have.value', 'Google'); //Editing automatically hyperlinked text
|
299
|
+
essayResponsePage.hyperlinkDialogboxURLInputField()
|
300
|
+
.should('have.value', `${Cypress.config().baseUrl}`)
|
301
|
+
.clear()
|
302
|
+
.type('https://www.google.com')
|
303
|
+
.should('have.value', 'https://www.google.com');
|
304
|
+
essayResponsePage.hyperlinkDialogboxButtonOk()
|
305
|
+
.click();
|
306
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
307
|
+
.verifyInnerText('Google')
|
308
|
+
.and('have.attr', 'href', `https://www.google.com`);
|
309
|
+
});
|
310
|
+
|
311
|
+
it('When the user selects the added hyperlink and clicks on any formatting option, then the formatting should be applied to the displayed hyperlink.', () => {
|
312
|
+
essayResponsePage.previewTabToolbarOption('Bold (Ctrl+B)')
|
313
|
+
.click();
|
314
|
+
essayResponsePage.previewInputFieldHyperlinkText()
|
315
|
+
.should('have.css', 'font-weight', css.fontWeight.bold);
|
316
|
+
});
|
317
|
+
});
|
318
|
+
});
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
2
|
+
import { essayResponsePage } from "../../../pages";
|
3
|
+
|
4
|
+
describe('Create question page - Essay response: Scoring', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Scoring Section contents', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
13
|
+
});
|
14
|
+
|
15
|
+
essayResponsePage.tests.verifyScoringTypeLabelAndDropdown('manuallyScored');
|
16
|
+
});
|
17
|
+
|
18
|
+
describe('Manually scored scoring type - Question creation page', () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
22
|
+
});
|
23
|
+
|
24
|
+
it('When the user selects \'Manually scored\' option from the Scoring Type dropdown, then the \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed', () => {
|
25
|
+
cy.log('Pre-step: Opening the scoring type dropdown.');
|
26
|
+
essayResponsePage.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored');
|
27
|
+
essayResponsePage.steps.verifyDefaultPointsLabelAndInputField();
|
28
|
+
essayResponsePage.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField();
|
29
|
+
});
|
30
|
+
|
31
|
+
essayResponsePage.tests.verifyPointsFieldErrorState(10);
|
32
|
+
essayResponsePage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
|
33
|
+
|
34
|
+
it('Pre step: Switching to Preview tab', () => {
|
35
|
+
essayResponsePage.steps.switchToPreviewTab();
|
36
|
+
});
|
37
|
+
|
38
|
+
essayResponsePage.tests.verifyShowCorrectAnswerAndPointsNotDisplayedInPreviewTab()
|
39
|
+
});
|
40
|
+
|
41
|
+
describe('Non Scored scoring type - Question creation page', () => {
|
42
|
+
abortEarlySetup();
|
43
|
+
before(() => {
|
44
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
45
|
+
});
|
46
|
+
|
47
|
+
it('When the user selects \'Non Scored\' option from the Scoring Type dropdown, then the \'Points\' input field should be displayed in disabled state with prefilled \'0\' points and \'Minimum score awarded (if attempted)\' input field should not be displayed', () => {
|
48
|
+
cy.log('Pre-step: Opening the scoring type dropdown.');
|
49
|
+
essayResponsePage.steps.selectAScoringTypeFromScoringTypeDropdown('Non scored');
|
50
|
+
essayResponsePage.steps.verifyNonScoredPointsField();
|
51
|
+
});
|
52
|
+
|
53
|
+
it('Pre step: Switching to Preview tab', () => {
|
54
|
+
essayResponsePage.steps.switchToPreviewTab();
|
55
|
+
});
|
56
|
+
|
57
|
+
essayResponsePage.tests.verifyShowCorrectAnswerAndPointsNotDisplayedInPreviewTab()
|
58
|
+
});
|
59
|
+
});
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { essayResponsePage } from "../../../pages";
|
2
|
+
import { createQuestionBasePage } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
|
5
|
+
describe('Essay Response: Special Characters popup', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Special Characters popup contents', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
cy.log('Navigate to Essay Response question type and switching to preview tab.');
|
14
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
15
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
16
|
+
});
|
17
|
+
|
18
|
+
essayResponsePage.tests.verifySpecialOrMathCharactersPopup('specialCharacters');
|
19
|
+
});
|
20
|
+
|
21
|
+
describe('Add special character symbols to the response field', () => {
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
cy.log('Navigate to Essay Response question type, switching to preview tab and clicking on special characters toolbar option.');
|
25
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
26
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
27
|
+
essayResponsePage.previewTabToolbarOption('Special characters')
|
28
|
+
.click();
|
29
|
+
});
|
30
|
+
|
31
|
+
essayResponsePage.tests.addSpecialOrMathCharactersToResponseField('specialCharacters');
|
32
|
+
});
|
33
|
+
});
|
@@ -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
|
+
});
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { essayResponsePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Essay Response: Math Characters popup', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Math Characters popup contents', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
cy.log('Navigate to Essay Response question type, selecting math characters from customize formatting options accordion and then switching to preview tab.');
|
13
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
14
|
+
cy.barsPreLoaderWait();
|
15
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
16
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Math characters']);
|
17
|
+
essayResponsePage.steps.switchToPreviewTab();
|
18
|
+
});
|
19
|
+
|
20
|
+
essayResponsePage.tests.verifySpecialOrMathCharactersPopup('mathCharacters');
|
21
|
+
});
|
22
|
+
|
23
|
+
describe('Add math character symbols to the response field', () => {
|
24
|
+
abortEarlySetup();
|
25
|
+
before(() => {
|
26
|
+
cy.log('Navigate to Essay Response question type, selecting math characters from customize formatting options accordion, switching to preview tab and clicking on math characters toolbar option.');
|
27
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
28
|
+
cy.barsPreLoaderWait();
|
29
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
30
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Math characters']);
|
31
|
+
essayResponsePage.steps.switchToPreviewTab();
|
32
|
+
essayResponsePage.previewTabToolbarOption('Math characters')
|
33
|
+
.click();
|
34
|
+
});
|
35
|
+
|
36
|
+
essayResponsePage.tests.addSpecialOrMathCharactersToResponseField('mathCharacters');
|
37
|
+
});
|
38
|
+
});
|