itemengine-cypress-automation 1.0.573-IEI-7011-f5bd0d2.0 → 1.0.573-IEI-7065-Improve-test-coverage-for-essay-response-c25d1ee.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/EssayResponse/additionalSettings.js +8 -2
- package/cypress/e2e/ILC/EssayResponse/additionalSettingsBasic.js +15 -0
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +14 -1
- package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +155 -5
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +116 -4
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +93 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +114 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +11 -1
- package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +29 -2
- package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +11 -1
- package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +75 -0
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +13 -0
- package/cypress/e2e/ILC/EssayResponse/studentViewSettings.js +71 -0
- package/cypress/pages/components/equationEditorSectionCommonComponent.js +21 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +20 -1
- package/cypress/pages/essayResponsePage.js +2 -0
- package/package.json +1 -1
|
@@ -72,12 +72,18 @@ describe('Create item - Essay response - Additional settings - Student response
|
|
|
72
72
|
essayResponsePage.steps.verifyPlaceholderTextPreviewTab('Lorem Ipsum');
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
it('
|
|
75
|
+
it('The user should be able to add \'Placeholder text\' and the \'Placeholder text\' added by the user should be displayed in the response field in item preview', () => {
|
|
76
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
77
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
78
|
+
essayResponsePage.steps.verifyPlaceholderTextPreviewTab('Lorem Ipsum');
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('When the user starts typing in the response field in the item preview, then the placeholder text should disappear', () => {
|
|
76
82
|
essayResponsePage.steps.enterTextInResponseField('dolor sit amet');
|
|
77
83
|
essayResponsePage.steps.verifyPlaceholderTextNotPresentInPreviewTab();
|
|
78
84
|
});
|
|
79
85
|
|
|
80
|
-
it('When the user clears the entered text in the response field, then the placeholder text should appear again', () => {
|
|
86
|
+
it('When the user clears the entered text in the response field, then the placeholder text should appear again in item preview', () => {
|
|
81
87
|
essayResponsePage.steps.clearResponseField();
|
|
82
88
|
essayResponsePage.steps.focusOutOfResponseField();
|
|
83
89
|
essayResponsePage.steps.verifyPlaceholderTextPreviewTab('Lorem Ipsum');
|
|
@@ -57,6 +57,21 @@ describe('Essay response - Additional settings', () => {
|
|
|
57
57
|
essayResponsePage.steps.switchToEditTab();
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
|
+
|
|
61
|
+
it('Verify \'Tiny\' font size option functionality again after saving the question', () => {
|
|
62
|
+
essayResponsePage.steps.selectFontSizeOptionFromFontSizeDropdown('Tiny');
|
|
63
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
64
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
65
|
+
utilities.verifyCSS(essayResponsePage.questionInstructionsText(), {
|
|
66
|
+
'font-size': fontSizes['Tiny']
|
|
67
|
+
});
|
|
68
|
+
utilities.verifyCSS(essayResponsePage.previewTabToolbarOption(), {
|
|
69
|
+
'font-size': fontSizes['Tiny']
|
|
70
|
+
});
|
|
71
|
+
utilities.verifyCSS(essayResponsePage.responseField(), {
|
|
72
|
+
'font-size': fontSizes['Tiny']
|
|
73
|
+
});
|
|
74
|
+
});
|
|
60
75
|
});
|
|
61
76
|
|
|
62
77
|
describe('Additional settings: Accessibility section', () => {
|
|
@@ -356,7 +356,7 @@ describe('Create question page - Essay Response: Create custom category', () =>
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
if (!grepTags || !grepTags.includes('smoke')) {
|
|
359
|
-
describe('Create custom category: Preview tab', () => {
|
|
359
|
+
describe.only('Create custom category: Preview tab', () => {
|
|
360
360
|
abortEarlySetup();
|
|
361
361
|
before(() => {
|
|
362
362
|
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
|
@@ -382,12 +382,25 @@ describe('Create question page - Essay Response: Create custom category', () =>
|
|
|
382
382
|
equationEditorFlyout.steps.verifyCategoryIsNotDisplayedInEquationEditorPreviewTab('Custom category without characters');
|
|
383
383
|
});
|
|
384
384
|
|
|
385
|
+
it('The category with no added characters should not be displayed in the preview tab equation editor in item preview', () => {
|
|
386
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
387
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
388
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Equation Editor');
|
|
389
|
+
equationEditorFlyout.steps.clickOnEquationEditorButtonNext();
|
|
390
|
+
equationEditorFlyout.steps.verifyCategoryIsNotDisplayedInEquationEditorPreviewTab('Custom category without characters');
|
|
391
|
+
essayResponsePage.steps.switchToEditTab();
|
|
392
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
393
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
394
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Equation Editor');
|
|
395
|
+
});
|
|
396
|
+
|
|
385
397
|
it('The category with only category name should be displayed in the preview tab equation editor', () => {
|
|
386
398
|
equationEditorFlyout.steps.clickOnEquationEditorButtonNext();
|
|
387
399
|
equationEditorFlyout.steps.verifyCategoryInEquationEditorPreviewTab('Custom category with name.', '');
|
|
388
400
|
});
|
|
389
401
|
|
|
390
402
|
it('The category with category name and icon should be displayed in the preview tab equation editor', () => {
|
|
403
|
+
equationEditorFlyout.steps.clickOnEquationEditorButtonNext();
|
|
391
404
|
equationEditorFlyout.steps.verifyCategoryInEquationEditorPreviewTab('Custom category with name and icon.', '#');
|
|
392
405
|
});
|
|
393
406
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
2
2
|
import { essayResponsePage } from "../../../pages";
|
|
3
3
|
import utilities from "../../../support/helpers/utilities";
|
|
4
|
+
import { essayResponseCommonComponents } from "../../../pages/components/essayResponseCommonComponents";
|
|
4
5
|
const css = Cypress.env('css');
|
|
5
6
|
|
|
6
7
|
describe('Create question page - Essay Response: Question Instructions, Set limit', () => {
|
|
@@ -238,11 +239,34 @@ describe('Create question page - Essay Response: Question Instructions, Set limi
|
|
|
238
239
|
essayResponsePage.steps.verifyWordLimitInPreviewTab(1000);
|
|
239
240
|
});
|
|
240
241
|
|
|
241
|
-
it('When
|
|
242
|
+
it('When user switched to the preview tab then \'Maximum 1000 words\' should be displayed in the preview tab in item preview', () => {
|
|
243
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
244
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
245
|
+
utilities.verifyElementVisibilityState(essayResponsePage.responseFieldWordCount(), 'visible');
|
|
246
|
+
essayResponsePage.steps.verifyWordLimitInPreviewTab(1000);
|
|
247
|
+
essayResponsePage.steps.switchToEditTab();
|
|
248
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
it('When the user unchecked the \Always show maximum limit\ checkbox then no message should be displayed at the bottom of the response field in the question preview.', () => {
|
|
252
|
+
essayResponsePage.steps.uncheckAlwaysShowMaximumLimitCheckbox();
|
|
253
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
254
|
+
utilities.verifyElementVisibilityState(essayResponsePage.wordCharacterLimitWrapper(), 'notExist');
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('When the user unchecked the \Always show maximum limit\ checkbox then no message should be displayed at the bottom of the response field in the item preview.', () => {
|
|
258
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
259
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
260
|
+
utilities.verifyElementVisibilityState(essayResponsePage.wordCharacterLimitWrapper(), 'notExist');
|
|
242
261
|
essayResponsePage.steps.switchToEditTab();
|
|
262
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
it('When the user updates the maximum word limit input field value then updated maximum word limit value should be displayed in the preview tab', () => {
|
|
266
|
+
essayResponsePage.steps.checkAlwaysShowMaximumLimitCheckbox();
|
|
243
267
|
essayResponsePage.steps.setMaximumLimit(5);
|
|
244
268
|
essayResponsePage.steps.switchToPreviewTab();
|
|
245
|
-
essayResponsePage.
|
|
269
|
+
utilities.verifyElementVisibilityState(essayResponsePage.wordCharacterLimitWrapper(), 'visible');
|
|
246
270
|
});
|
|
247
271
|
|
|
248
272
|
it('When the user updates the minimum word limit input field value and checks the \'Always show minimum limit\' checkbox then \'Minimum value - Maximum value words required\' should be displayed in the preview tab', () => {
|
|
@@ -253,7 +277,16 @@ describe('Create question page - Essay Response: Question Instructions, Set limi
|
|
|
253
277
|
essayResponsePage.steps.verifyWordLimitInPreviewTab(5, 3);
|
|
254
278
|
});
|
|
255
279
|
|
|
280
|
+
it('When the user updates the minimum word limit input field value and checks the \'Always show minimum limit\' checkbox then \'Minimum value - Maximum value words required\' should be displayed in the preview tab in item preview', () => {
|
|
281
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
282
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
283
|
+
essayResponsePage.steps.verifyWordLimitInPreviewTab(5, 3);
|
|
284
|
+
essayResponsePage.steps.switchToEditTab();
|
|
285
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
286
|
+
});
|
|
287
|
+
|
|
256
288
|
it('User should able to enter text in the response field', () => {
|
|
289
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
257
290
|
essayResponsePage.steps.enterTextInResponseField('Lorem Ipsum');
|
|
258
291
|
});
|
|
259
292
|
|
|
@@ -263,10 +296,22 @@ describe('Create question page - Essay Response: Question Instructions, Set limi
|
|
|
263
296
|
essayResponsePage.steps.verifyLimitReachedWarningMessage('Maximum 5 words have been entered.')
|
|
264
297
|
});
|
|
265
298
|
|
|
299
|
+
it('When the user reaches the word limit, then the warning message \'Maximum 5 words have been entered\' should be displayed in item preview', () => {
|
|
300
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
301
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
302
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum dolor sit amet');
|
|
303
|
+
essayResponsePage.steps.verifyResponseFieldInput('Lorem Ipsum dolor sit amet')
|
|
304
|
+
essayResponsePage.steps.verifyLimitReachedWarningMessage('Maximum 5 words have been entered.')
|
|
305
|
+
essayResponsePage.steps.switchToEditTab();
|
|
306
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
307
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
308
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum dolor sit amet');
|
|
309
|
+
});
|
|
310
|
+
|
|
266
311
|
it('CSS of \'word limit reached\' warning message and container', { tags: 'css' }, () => {
|
|
267
312
|
utilities.verifyCSS(essayResponsePage.limitReachedWarningMessage(), {
|
|
268
313
|
'color': css.color.warningMessage,
|
|
269
|
-
'font-size': css.fontSize.
|
|
314
|
+
'font-size': css.fontSize.default,
|
|
270
315
|
'font-weight': css.fontWeight.regular
|
|
271
316
|
});
|
|
272
317
|
utilities.verifyCSS(essayResponsePage.limitReachedWarningMessageContainer().find('svg'), {
|
|
@@ -298,11 +343,45 @@ describe('Create question page - Essay Response: Question Instructions, Set limi
|
|
|
298
343
|
essayResponsePage.steps.verifyLimitReachedWarningMessage('Minimum 3 words are required.');
|
|
299
344
|
});
|
|
300
345
|
|
|
346
|
+
it('When the user enters the word less than the minimum word limit value set by the user and focus out of response field, then the warning message \'Minimum 3 words are required\' should be displayed in item preview', () => {
|
|
347
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
348
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
349
|
+
essayResponsePage.steps.clearResponseField();
|
|
350
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
351
|
+
essayResponsePage.steps.focusOutOfResponseField();
|
|
352
|
+
essayResponsePage.steps.verifyLimitReachedWarningMessage('Minimum 3 words are required.');
|
|
353
|
+
essayResponsePage.steps.switchToEditTab();
|
|
354
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
355
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
356
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
357
|
+
});
|
|
358
|
+
|
|
301
359
|
it('When the user enters the word greater than the minimum word limit value set by the user, then the warning message should disappear', () => {
|
|
302
360
|
essayResponsePage.steps.enterInputInResponseField(' dolor sit');
|
|
303
361
|
essayResponsePage.steps.verifyResponseFieldInput('Lorem Ipsum dolor sit');
|
|
304
362
|
essayResponsePage.steps.verifyLimitReachedWarningMessageNotExist();
|
|
305
363
|
});
|
|
364
|
+
|
|
365
|
+
it("When the user unchecks both 'Always show maximum limit' and 'Always show minimum limit' checkboxes then no limit message should be displayed in preview and item preview", () => {
|
|
366
|
+
// Ensure we are on edit tab and both checkboxes are currently checked from prior tests
|
|
367
|
+
essayResponsePage.steps.switchToEditTab();
|
|
368
|
+
// Uncheck maximum limit checkbox using existing step
|
|
369
|
+
essayResponsePage.steps.uncheckAlwaysShowMaximumLimitCheckbox();
|
|
370
|
+
// Uncheck minimum limit checkbox directly (no dedicated step defined yet)
|
|
371
|
+
essayResponsePage.alwaysShowMinLimitCheckBox()
|
|
372
|
+
.click()
|
|
373
|
+
.should('not.be.checked');
|
|
374
|
+
// Preview tab should not show limit banner
|
|
375
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
376
|
+
utilities.verifyElementVisibilityState(essayResponsePage.wordCharacterLimitWrapper(), 'notExist');
|
|
377
|
+
// Item preview validation
|
|
378
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
379
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
380
|
+
utilities.verifyElementVisibilityState(essayResponsePage.wordCharacterLimitWrapper(), 'notExist');
|
|
381
|
+
// Return to edit state for subsequent tests (if any added later)
|
|
382
|
+
essayResponsePage.steps.switchToEditTab();
|
|
383
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
384
|
+
});
|
|
306
385
|
});
|
|
307
386
|
|
|
308
387
|
describe('Essay response: Set limit section: Character, None: Edit tab functionality', () => {
|
|
@@ -333,7 +412,43 @@ describe('Create question page - Essay Response: Question Instructions, Set limi
|
|
|
333
412
|
essayResponsePage.steps.verifyCharacterLimitInPreviewTab(10, 6);
|
|
334
413
|
});
|
|
335
414
|
|
|
415
|
+
it('When user switched to the preview tab then \'Maximum 20000 characters\' should be displayed in the preview tab in item preview', () => {
|
|
416
|
+
essayResponsePage.steps.switchToEditTab();
|
|
417
|
+
essayResponsePage.steps.setMaximumLimit(20000);
|
|
418
|
+
essayResponsePage.steps.unCheckAlwaysShowMinimumLimitCheckbox();
|
|
419
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
420
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
421
|
+
essayResponsePage.steps.verifyCharacterLimitInPreviewTab(20000);
|
|
422
|
+
essayResponsePage.steps.switchToEditTab();
|
|
423
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
it('When the user unchecked the \\Always show maximum limit\\ checkbox then no message should be displayed at the bottom of the response field in the question preview for characters.', () => {
|
|
427
|
+
essayResponsePage.steps.uncheckAlwaysShowMaximumLimitCheckbox();
|
|
428
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
429
|
+
utilities.verifyElementVisibilityState(essayResponsePage.wordCharacterLimitWrapper(), 'notExist');
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
it('When the user unchecked the \\Always show maximum limit\\ checkbox then no message should be displayed at the bottom of the response field in the item preview for characters.', () => {
|
|
433
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
434
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
435
|
+
utilities.verifyElementVisibilityState(essayResponsePage.wordCharacterLimitWrapper(), 'notExist');
|
|
436
|
+
essayResponsePage.steps.switchToEditTab();
|
|
437
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
it('When the user updates the maximum character limit input field value then updated maximum character limit value should be displayed in the preview tab in item preview', () => {
|
|
441
|
+
essayResponsePage.steps.checkAlwaysShowMaximumLimitCheckbox();
|
|
442
|
+
essayResponsePage.steps.setMaximumLimit(10);
|
|
443
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
444
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
445
|
+
essayResponsePage.steps.verifyCharacterLimitInPreviewTab(10);
|
|
446
|
+
essayResponsePage.steps.switchToEditTab();
|
|
447
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
448
|
+
});
|
|
449
|
+
|
|
336
450
|
it('User should able to enter characters in the response field', () => {
|
|
451
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
337
452
|
essayResponsePage.steps.enterTextInResponseField('Lorem');
|
|
338
453
|
});
|
|
339
454
|
|
|
@@ -343,8 +458,19 @@ describe('Create question page - Essay Response: Question Instructions, Set limi
|
|
|
343
458
|
essayResponsePage.steps.verifyLimitReachedWarningMessage('Maximum 10 characters have been entered.')
|
|
344
459
|
});
|
|
345
460
|
|
|
461
|
+
it('When the user reaches the character limit, then the warning message \'Maximum 10 characters have been entered\' should be displayed in item preview', () => {
|
|
462
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
463
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
464
|
+
essayResponsePage.steps.enterInputInResponseField('Loremdolar');
|
|
465
|
+
essayResponsePage.steps.verifyResponseFieldInput('Loremdolar');
|
|
466
|
+
essayResponsePage.steps.verifyLimitReachedWarningMessage('Maximum 10 characters have been entered.');
|
|
467
|
+
essayResponsePage.steps.switchToEditTab();
|
|
468
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
469
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
470
|
+
});
|
|
471
|
+
|
|
346
472
|
it('When the user removes/deletes some characters, the warning message should disappear', () => {
|
|
347
|
-
essayResponsePage.steps.enterInputInResponseField('
|
|
473
|
+
essayResponsePage.steps.enterInputInResponseField('Loremdola');
|
|
348
474
|
essayResponsePage.steps.verifyResponseFieldInput('Loremdola');
|
|
349
475
|
essayResponsePage.steps.verifyLimitReachedWarningMessageNotExist();
|
|
350
476
|
});
|
|
@@ -357,12 +483,36 @@ describe('Create question page - Essay Response: Question Instructions, Set limi
|
|
|
357
483
|
essayResponsePage.steps.verifyLimitReachedWarningMessage('Minimum 6 characters are required.');
|
|
358
484
|
});
|
|
359
485
|
|
|
486
|
+
it('When the user enters the character less than the minimum character limit value set by the user and focus out of response field, then the warning message \'Minimum 6 characters are required\' should be displayed in item preview', () => {
|
|
487
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
488
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
489
|
+
essayResponsePage.steps.clearResponseField();
|
|
490
|
+
essayResponsePage.steps.enterInputInResponseField('Lore');
|
|
491
|
+
essayResponsePage.steps.focusOutOfResponseField();
|
|
492
|
+
essayResponsePage.steps.verifyLimitReachedWarningMessage('Minimum 6 characters are required.');
|
|
493
|
+
essayResponsePage.steps.switchToEditTab();
|
|
494
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
495
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
496
|
+
});
|
|
497
|
+
|
|
360
498
|
it('When the user enters the character greater than the minimum character limt value set by the user, then the warning message should disappear', () => {
|
|
361
|
-
essayResponsePage.steps.enterInputInResponseField('
|
|
499
|
+
essayResponsePage.steps.enterInputInResponseField('Loremdola');
|
|
362
500
|
essayResponsePage.steps.verifyResponseFieldInput('Loremdola');
|
|
363
501
|
essayResponsePage.steps.verifyLimitReachedWarningMessageNotExist();
|
|
364
502
|
});
|
|
365
503
|
|
|
504
|
+
it("When the user unchecks both 'Always show maximum limit' and 'Always show minimum limit' checkboxes then no character limit message should be displayed in preview and item preview", () => {
|
|
505
|
+
essayResponsePage.steps.switchToEditTab();
|
|
506
|
+
essayResponsePage.steps.uncheckAlwaysShowMaximumLimitCheckbox();
|
|
507
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
508
|
+
utilities.verifyElementVisibilityState(essayResponsePage.wordCharacterLimitWrapper(), 'notExist');
|
|
509
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
510
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
511
|
+
utilities.verifyElementVisibilityState(essayResponsePage.wordCharacterLimitWrapper(), 'notExist');
|
|
512
|
+
essayResponsePage.steps.switchToEditTab();
|
|
513
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
514
|
+
});
|
|
515
|
+
|
|
366
516
|
it('When the user selects \'None\' radio button then maximum and minimum limits should not be displayed in the preview tab and when user types anything in the response field then error message should not be displayed', () => {
|
|
367
517
|
essayResponsePage.steps.switchToEditTab();
|
|
368
518
|
essayResponsePage.steps.checkNoneRadioButton();
|
|
@@ -25,7 +25,7 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
25
25
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert/Remove Bulleted List');
|
|
26
26
|
|
|
27
27
|
//Comment: Here we are unable to verify the bullet point marker that appears since it is displayed using ::marker
|
|
28
|
-
it('When the user selects the \'Bulleted list\' toolbar option in an empty response field, then a bulleted list with \'1 bullet point\' should be displayed in the response field and when the user enters text, then that text should appear as a bulleted list', () => {
|
|
28
|
+
it('When the user selects the \'Bulleted list\' toolbar option in an empty response field, then a bulleted list with \'1 bullet point\' should be displayed in the response field and when the user enters text, then that text should appear as a bulleted list in question preview', () => {
|
|
29
29
|
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
30
30
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Bulleted List');
|
|
31
31
|
essayResponsePage.steps.verifyResponseFieldHTML('<ul><li><br></li></ul>');
|
|
@@ -33,6 +33,18 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
33
33
|
essayResponsePage.steps.verifyResponseFieldHTML('<ul><li>Lorem Ipsum</li></ul>');
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
+
it('When the user selects the \'Bulleted list\' toolbar option in an empty response field, then a bulleted list with \'1 bullet point\' should be displayed in the response field and when the user enters text, then that text should appear as a bulleted list in item preview', () => {
|
|
37
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
38
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
39
|
+
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
40
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Bulleted List');
|
|
41
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<ul><li><br></li></ul>');
|
|
42
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
43
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<ul><li>Lorem Ipsum</li></ul>');
|
|
44
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
45
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
46
|
+
});
|
|
47
|
+
|
|
36
48
|
it('When the user presses the \'Enter\' key, another bullet point should appear below the first point and user should be able to enter text to the 2nd list item', () => {
|
|
37
49
|
essayResponsePage.steps.enterInputInResponseField('{enter}');
|
|
38
50
|
essayResponsePage.steps.verifyListItemLengthInResponseField(2);
|
|
@@ -57,7 +69,7 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
57
69
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert/Remove Numbered List');
|
|
58
70
|
|
|
59
71
|
//Comment: Here we are unable to verify the number of the list item that appears since it is displayed using ::marker
|
|
60
|
-
it('When the user selects the \'Numbered list\' toolbar option in an empty response field, then a numbered list with \'1. list item\' should be displayed in the response field and when the user enters text, then that text should appear as a numbered list', () => {
|
|
72
|
+
it('When the user selects the \'Numbered list\' toolbar option in an empty response field, then a numbered list with \'1. list item\' should be displayed in the response field and when the user enters text, then that text should appear as a numbered list in question preview', () => {
|
|
61
73
|
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
62
74
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
|
|
63
75
|
essayResponsePage.steps.verifyResponseFieldHTML('<ol><li><br></li></ol>');
|
|
@@ -65,6 +77,18 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
65
77
|
essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li></ol>');
|
|
66
78
|
});
|
|
67
79
|
|
|
80
|
+
it('When the user selects the \'Numbered list\' toolbar option in an empty response field, then a numbered list with \'1. list item\' should be displayed in the response field and when the user enters text, then that text should appear as a numbered list in item preview', () => {
|
|
81
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
82
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
83
|
+
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
84
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
|
|
85
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<ol><li><br></li></ol>');
|
|
86
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
87
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li></ol>');
|
|
88
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
89
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
90
|
+
});
|
|
91
|
+
|
|
68
92
|
it('When the user presses the \'Enter\' key, \'2. list item\' should appear below the first list item and user should be able to enter text to the 2nd list item', () => {
|
|
69
93
|
essayResponsePage.steps.enterInputInResponseField('{enter}');
|
|
70
94
|
essayResponsePage.steps.verifyListItemLengthInResponseField(2);
|
|
@@ -228,6 +252,64 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
228
252
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Align Right');
|
|
229
253
|
});
|
|
230
254
|
|
|
255
|
+
describe('Align left, Center, Align right, Justify formatting options - Item preview', () => {
|
|
256
|
+
abortEarlySetup();
|
|
257
|
+
before(() => {
|
|
258
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
|
259
|
+
cy.barsPreLoaderWait();
|
|
260
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
|
261
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Align Left', 'Align Center', 'Align Right', 'Align Justify']);
|
|
262
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
263
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it('When the user focuses in the response field, then none of the options should be displayed in selected state and the text in the response field should be displayed as normal text without any alignment in item preview', () => {
|
|
267
|
+
essayResponsePage.steps.focusInResponseField();
|
|
268
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left');
|
|
269
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Center');
|
|
270
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Right');
|
|
271
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Justify');
|
|
272
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
273
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it('When the user selects the \'Center\' toolbar option, then text in the response field should get aligned to the center and \'Align left\' toolbar option should get deselected in item preview', () => {
|
|
277
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Align Center');
|
|
278
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: center;\">Lorem Ipsum</p>')
|
|
279
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left')
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it('When the user selects the \'Align Left\' toolbar option, then text in the response field should get aligned to the left and \'Center\' toolbar option should get deselected in item preview', () => {
|
|
283
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Align Left');
|
|
284
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style="text-align: left;">Lorem Ipsum</p>');
|
|
285
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Center')
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it('When the user selects the \'Align Right\' toolbar option, then text in the response field should get aligned to the right and \'Align left\' toolbar option should get deselected in item preview', () => {
|
|
289
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Align Right');
|
|
290
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: right;\">Lorem Ipsum</p>');
|
|
291
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left')
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
it('When the user deselects \'Align Right\' toolbar option, then the text in the response field should be displayed as normal text without any alignment in item preview', () => {
|
|
295
|
+
essayResponsePage.steps.deselectPreviewTabToolbarOption('Align Right');
|
|
296
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
it('When the user selects the \'Justify\' toolbar option, then text in the response field should get justified alignment and \'Align right\' toolbar option should get deselected in item preview', () => {
|
|
300
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Align Justify');
|
|
301
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style="text-align: justify;">Lorem Ipsum</p>');
|
|
302
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Right')
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
it('When the user switches to the next line, \'Justify\' toolbar option should persist in item preview', () => {
|
|
306
|
+
essayResponsePage.steps.enterInputInResponseField('{enter}');
|
|
307
|
+
utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarOption('Align Justify'), 'visible');
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Align Right');
|
|
311
|
+
});
|
|
312
|
+
|
|
231
313
|
describe('Increase indent, Decrease indent formatting options - Preview tab', () => {
|
|
232
314
|
abortEarlySetup();
|
|
233
315
|
before(() => {
|
|
@@ -242,15 +324,29 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
242
324
|
essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Decrease Indent')
|
|
243
325
|
});
|
|
244
326
|
|
|
245
|
-
it('When the user selects the \'Increase indent\' toolbar option, then indentation of text in the response field should increase and the \'Decrease indent\' toolbar option should get enabled', () => {
|
|
327
|
+
it('When the user selects the \'Increase indent\' toolbar option, then indentation of text in the response field should increase and the \'Decrease indent\' toolbar option should get enabled in question preview', () => {
|
|
246
328
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
247
329
|
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
|
|
248
330
|
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Decrease Indent')
|
|
249
331
|
});
|
|
250
332
|
|
|
333
|
+
it('When the user selects the \'Increase indent\' toolbar option, then indentation of text in the response field should increase and the \'Decrease indent\' toolbar option should get enabled in item preview', () => {
|
|
334
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
335
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
336
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
337
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
338
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
|
|
339
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Decrease Indent')
|
|
340
|
+
essayResponsePage.steps.switchToEditTab();
|
|
341
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
342
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
343
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
344
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
345
|
+
});
|
|
346
|
+
|
|
251
347
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Increase Indent');
|
|
252
348
|
|
|
253
|
-
it('When the user selects the \'Decrease indent\' toolbar option, then the indentation of text in the response field should decrease', () => {
|
|
349
|
+
it('When the user selects the \'Decrease indent\' toolbar option, then the indentation of text in the response field should decrease in question', () => {
|
|
254
350
|
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
255
351
|
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
256
352
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
@@ -259,6 +355,22 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
259
355
|
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
260
356
|
});
|
|
261
357
|
|
|
358
|
+
it('When the user selects the \'Decrease indent\' toolbar option, then the indentation of text in the response field should decrease in question', () => {
|
|
359
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
360
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
361
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
362
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
363
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
|
|
364
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Decrease Indent');
|
|
365
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
366
|
+
essayResponsePage.steps.switchToEditTab();
|
|
367
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
368
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
369
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
370
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
371
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Decrease Indent');
|
|
372
|
+
});
|
|
373
|
+
|
|
262
374
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Decrease Indent');
|
|
263
375
|
});
|
|
264
376
|
});
|
|
@@ -33,6 +33,31 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
33
33
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert Horizontal Line');
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
+
describe('Horizontal line formatting option - Item preview', () => {
|
|
37
|
+
abortEarlySetup();
|
|
38
|
+
before(() => {
|
|
39
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
|
40
|
+
cy.barsPreLoaderWait();
|
|
41
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
|
42
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Insert Horizontal Line']);
|
|
43
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
44
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
45
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
46
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('When the user selects the \'Insert horizontal line\' toolbar option, a horizontal line should be inserted below from where the cursor is pointing in the response field, the \'Insert horizontal line\' toolbar option should not stay in selected state in item preview', () => {
|
|
50
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Horizontal Line');
|
|
51
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p><hr><p><br></p>');
|
|
52
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Insert Horizontal Line')
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('When the user hits \'backspace\', then the horizontal line should get removed in item preview', () => {
|
|
56
|
+
essayResponsePage.steps.enterInputInResponseField('{backspace}')
|
|
57
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p><p><br></p>');
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
36
61
|
describe('Blockquote formatting option - Preview tab', () => {
|
|
37
62
|
abortEarlySetup();
|
|
38
63
|
before(() => {
|
|
@@ -49,6 +74,17 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
49
74
|
essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p></blockquote>')
|
|
50
75
|
});
|
|
51
76
|
|
|
77
|
+
it('When the user selects the \'Blockquote\' toolbar option, then the text in the response field should appear as a block quote in item preview', () => {
|
|
78
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
79
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
80
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Block Quote');
|
|
81
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p></blockquote>');
|
|
82
|
+
essayResponsePage.steps.switchToEditTab();
|
|
83
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
84
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
85
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p></blockquote>')
|
|
86
|
+
});
|
|
87
|
+
|
|
52
88
|
it('When the user presses the \'Enter\' key and switches to a new line, then the \'Blockquote\' toolbar option should be in selected state and the block quote formatting should persist and user should be able to enter text in the next line', () => {
|
|
53
89
|
essayResponsePage.steps.enterInputInResponseField('{enter}dolor sit amet');
|
|
54
90
|
essayResponsePage.steps.verifyPreviewTabToolbarOptionSelected('Block Quote')
|
|
@@ -85,6 +121,24 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
85
121
|
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotDisabled('Bold (Ctrl+B)');
|
|
86
122
|
});
|
|
87
123
|
|
|
124
|
+
it('When the user selects the \'Code inline\' toolbar option, then the text entered in the response field should appear as a highlighted inline code text, the word count should also update and all the toolbar formatting options should be in enabled state in item preview', () => {
|
|
125
|
+
cy.log('Saving question to switch to item preview context.');
|
|
126
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
127
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
128
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
|
|
129
|
+
essayResponsePage.steps.enterInputInResponseField('console.log()')
|
|
130
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p><code>console.log()</code><br></p>');
|
|
131
|
+
essayResponsePage.steps.verifyWordCount('1');
|
|
132
|
+
//Just checking if Bold option is disabled or not, no need to check for all toolbar options
|
|
133
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotDisabled('Bold (Ctrl+B)');
|
|
134
|
+
cy.log('Returning to edit mode.');
|
|
135
|
+
essayResponsePage.steps.switchToEditTab();
|
|
136
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
137
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
138
|
+
essayResponsePage.steps.enterInputInResponseField('console.log()')
|
|
139
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p><code>console.log()</code><br></p>');
|
|
140
|
+
});
|
|
141
|
+
|
|
88
142
|
//Comment: exceptional assertion of font size since in code inline font size is 14.4px
|
|
89
143
|
it('CSS of \'highlighted inline code text\'', { tags: 'css' }, () => {
|
|
90
144
|
utilities.verifyCSS(essayResponsePage.responseField().find('code'), {
|
|
@@ -203,6 +257,27 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
203
257
|
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
204
258
|
});
|
|
205
259
|
|
|
260
|
+
it('When the user applies Bold, Italic, Underline, Strikethrough and removes formatting in item preview, text should revert to default format', () => {
|
|
261
|
+
cy.log('Saving question to switch to item preview context.');
|
|
262
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
263
|
+
essayResponsePage.steps.switchToPreviewTab(); // item preview
|
|
264
|
+
// Recreate initial content
|
|
265
|
+
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
266
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
|
|
267
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
|
|
268
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
|
|
269
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
|
|
270
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Strikethrough');
|
|
271
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p><s><u><em><strong>Lorem Ipsum</strong></em></u></s></p>');
|
|
272
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format');
|
|
273
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
274
|
+
cy.log('Returning to edit mode.');
|
|
275
|
+
essayResponsePage.steps.switchToEditTab();
|
|
276
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
277
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
278
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
|
|
279
|
+
});
|
|
280
|
+
|
|
206
281
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Remove Format');
|
|
207
282
|
|
|
208
283
|
it('When the user has selected text in the response field and applies text formatting options - Superscript, Subscript and clicks on the \'Remove format\' toolbar option, then all the text formatting should get removed and the text should be displayed in default format', () => {
|
|
@@ -215,6 +290,24 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
215
290
|
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum<br></p>');
|
|
216
291
|
});
|
|
217
292
|
|
|
293
|
+
it('When the user applies Superscript & Subscript and removes formatting in item preview, text should revert to default format', () => {
|
|
294
|
+
cy.log('Saving question to switch to item preview context for superscript/subscript removal.');
|
|
295
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
296
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
297
|
+
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
298
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Subscript');
|
|
299
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Superscript');
|
|
300
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
|
|
301
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p><sub><sup>Lorem Ipsum</sup></sub><br></p>');
|
|
302
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format');
|
|
303
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum<br></p>');
|
|
304
|
+
cy.log('Returning to edit mode after item preview test.');
|
|
305
|
+
essayResponsePage.steps.switchToEditTab();
|
|
306
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
307
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
308
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
|
|
309
|
+
});
|
|
310
|
+
|
|
218
311
|
it('When the user has selected text in the response field and applies text formatting option - Align right/Center/Justify and clicks on the \'Remove format\' toolbar option, then all the text formatting should get removed and the text should be displayed in default format', () => {
|
|
219
312
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Align Right');
|
|
220
313
|
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: right;\">Lorem Ipsum<br></p>');
|
|
@@ -108,6 +108,44 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
+
describe('Font Size formatting option - Item preview', () => {
|
|
112
|
+
abortEarlySetup();
|
|
113
|
+
before(() => {
|
|
114
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
|
115
|
+
cy.barsPreLoaderWait();
|
|
116
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
|
117
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Font size']);
|
|
118
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
119
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
120
|
+
essayResponsePage.steps.enterInputInResponseField('{selectAll}');
|
|
121
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
122
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('By default fontsize of response filed text is 16 px ', () => {
|
|
126
|
+
essayResponsePage.steps.verifyResponseFieldTextFontSizeNew(16);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it(`When the user selects the \'Font size\' toolbar option,then open a list of ${Object.keys(fontSizes).length} options - ${Object.keys(fontSizes).join(',')} is should be display and by default \'Default\' option should be selected`, () => {
|
|
130
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Font Size');
|
|
131
|
+
Object.values(fontSizes).forEach((option) => {
|
|
132
|
+
essayResponsePage.steps.verifyFontSizeListContent(option);
|
|
133
|
+
});
|
|
134
|
+
essayResponsePage.steps.selectFontSizeOption(16);
|
|
135
|
+
essayResponsePage.steps.clearResponseField();
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
Object.values(fontSizes).forEach((option) => {
|
|
139
|
+
it(`When the user selects \'${option}\' option from the font size list, then font size of the response field text should be change to ${fontSizes[option]} accordingly`, () => {
|
|
140
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Font Size');
|
|
141
|
+
essayResponsePage.steps.selectFontSizeOption(`${option}`);
|
|
142
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
143
|
+
essayResponsePage.steps.verifyResponseFieldTextFontSize(`${option}`);
|
|
144
|
+
essayResponsePage.steps.clearResponseField();
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
111
149
|
describe('Highlight Text formatting option - Preview tab', () => {
|
|
112
150
|
abortEarlySetup();
|
|
113
151
|
before(() => {
|
|
@@ -218,6 +256,39 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
218
256
|
});
|
|
219
257
|
});
|
|
220
258
|
|
|
259
|
+
describe('Clear All Controls - Item preview', () => {
|
|
260
|
+
abortEarlySetup();
|
|
261
|
+
before(() => {
|
|
262
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
|
263
|
+
cy.barsPreLoaderWait();
|
|
264
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
|
265
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Clear All']);
|
|
266
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
267
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
268
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
269
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it('When the user select the \'Highlight Text\' toolbar option,then a pop up should be display in item preview', () => {
|
|
273
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Clear all');
|
|
274
|
+
utilities.verifyElementVisibilityState(essayResponsePage.dialogBox(), 'visible');
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it('\'Are you sure you want to clear all text?\' message,\'Clear all\' title,\'Cancel\' and \'Clear all\' button should be visible in item preview', () => {
|
|
278
|
+
utilities.verifyTextContent(essayResponsePage.clearTextMessage(), 'Are you sure you want to clear all text?');
|
|
279
|
+
utilities.verifyElementVisibilityState(essayResponsePage.clearTextMessage(), 'visible');
|
|
280
|
+
utilities.verifyTextContent(essayResponsePage.clearAllLabel(), 'Clear all');
|
|
281
|
+
utilities.verifyElementVisibilityState(essayResponsePage.clearAllLabel(), 'visible');
|
|
282
|
+
utilities.verifyElementVisibilityState(essayResponsePage.cancelButton(), 'visible');
|
|
283
|
+
utilities.verifyElementVisibilityState(essayResponsePage.clearAllButton(), 'visible');
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it('When the user click on \'Clear All\' button,no text should be display in item preview', () => {
|
|
287
|
+
essayResponsePage.steps.clickOnClearAllButton();
|
|
288
|
+
utilities.verifyTextContent(essayResponsePage.responseField(), '');
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
|
|
221
292
|
describe('enable color picker - Preview tab', () => {
|
|
222
293
|
abortEarlySetup();
|
|
223
294
|
before(() => {
|
|
@@ -258,4 +329,47 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
258
329
|
essayResponsePage.steps.verifyResponseFieldTextColor(`${css.color.newResponseFieldColor}`);
|
|
259
330
|
});
|
|
260
331
|
});
|
|
332
|
+
|
|
333
|
+
describe('enable color picker - Item preview', () => {
|
|
334
|
+
abortEarlySetup();
|
|
335
|
+
before(() => {
|
|
336
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
|
337
|
+
cy.barsPreLoaderWait();
|
|
338
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
|
339
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Font Color']);
|
|
340
|
+
essayResponsePage.steps.clickOnEnableColorPickerCheckbox();
|
|
341
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
342
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
343
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
344
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
it('When the user checked \'Enable color picker\' checkbox,then \'Select color\' label, \'Selected color\' label,\'Cancel\' button and \'ok\' button should be display,and by default color option \'rgb(0, 0, 0)\' is selected in item preview', () => {
|
|
348
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Text Color');
|
|
349
|
+
utilities.verifyInnerText(utilities.getNthElement(essayResponsePage.selectColorLabel(), 0), 'Select color');
|
|
350
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(essayResponsePage.selectColorLabel(), 0), 'visible');
|
|
351
|
+
utilities.verifyInnerText(utilities.getNthElement(essayResponsePage.selectColorLabel(), 1), 'Selected color');
|
|
352
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(essayResponsePage.selectColorLabel(), 1), 'visible');
|
|
353
|
+
utilities.verifyElementVisibilityState(colorPopupComponent.cancelButton(), 'visible');
|
|
354
|
+
utilities.verifyInnerText(colorPopupComponent.cancelButton(), 'Cancel');
|
|
355
|
+
utilities.verifyElementVisibilityState(colorPopupComponent.okButton(), 'visible');
|
|
356
|
+
utilities.verifyInnerText(colorPopupComponent.okButton(), 'Ok');
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
colorPopupComponent.tests.verifySaturationAndOpacityGradientPalette('rgb(0, 0, 0)');
|
|
360
|
+
|
|
361
|
+
it('When the user click \'Cancel\' button,then response field text color should not be change in item preview', () => {
|
|
362
|
+
colorPopupComponent.steps.clickOnCancelButton();
|
|
363
|
+
essayResponsePage.steps.verifyResponseFieldTextNewColor(`${css.color.text}`);
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
it('When the user select color using color palate and click on \'Ok\' button,then response field text color should change accordingly in item preview', () => {
|
|
367
|
+
essayResponsePage.steps.enterInputInResponseField(`{selectAll}{backspace}`);
|
|
368
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Text Color');
|
|
369
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
|
370
|
+
colorPopupComponent.steps.clickOnOkButton();
|
|
371
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
372
|
+
essayResponsePage.steps.verifyResponseFieldTextColor(`${css.color.newResponseFieldColor}`);
|
|
373
|
+
});
|
|
374
|
+
});
|
|
261
375
|
});
|
|
@@ -150,7 +150,7 @@ describe('Essay response: Customize math characters', () => {
|
|
|
150
150
|
essayResponsePage.steps.closeWarningPopup();
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
-
it('When the user has specified custom special characters and opens the special characters popup in the preview tab, then only the specified custom special characters should be displayed in the popup', () => {
|
|
153
|
+
it('When the user has specified custom special characters and opens the special characters popup in the preview tab, then only the specified custom special characters should be displayed in the popup in question preview', () => {
|
|
154
154
|
essayResponsePage.steps.switchToPreviewTab();
|
|
155
155
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Special characters');
|
|
156
156
|
essayResponsePage.steps.verifyCustomSpecialCharactersDisplayedInPreviewTab(customSpecialCharacters);
|
|
@@ -158,6 +158,16 @@ describe('Essay response: Customize math characters', () => {
|
|
|
158
158
|
essayResponsePage.steps.switchToEditTab();
|
|
159
159
|
});
|
|
160
160
|
|
|
161
|
+
it('When the user has specified custom special characters and opens the special characters popup in the preview tab, then only the specified custom special characters should be displayed in the popup in item preview', () => {
|
|
162
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
163
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
164
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Special characters');
|
|
165
|
+
essayResponsePage.steps.verifyCustomSpecialCharactersDisplayedInPreviewTab(customSpecialCharacters);
|
|
166
|
+
cy.log('Post-step: Switching to edit tab');
|
|
167
|
+
essayResponsePage.steps.switchToEditTab();
|
|
168
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
169
|
+
});
|
|
170
|
+
|
|
161
171
|
it('CSS of Customize special characters', { tags: 'css' }, () => {
|
|
162
172
|
utilities.verifyCSS(essayResponsePage.customizeSpecialCharactersLabel(), {
|
|
163
173
|
'color': css.color.labels,
|
|
@@ -235,7 +235,7 @@ describe('Essay Response Preview: Add Table Functionality', () => {
|
|
|
235
235
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Table');
|
|
236
236
|
});
|
|
237
237
|
|
|
238
|
-
it('When user checks the \'Add header row\' checkbox and then clicks on \'Add table\' button, the first row of the added table should be highlighted as table header', () => {
|
|
238
|
+
it('When user checks the \'Add header row\' checkbox and then clicks on \'Add table\' button, the first row of the added table should be highlighted as table header in question preview', () => {
|
|
239
239
|
cy.log('Check the \'Add header row\' checkbox.');
|
|
240
240
|
essayResponsePage.steps.checkAddRowHeaderCheckbox();
|
|
241
241
|
essayResponsePage.steps.addTable();
|
|
@@ -245,7 +245,20 @@ describe('Essay Response Preview: Add Table Functionality', () => {
|
|
|
245
245
|
essayResponsePage.steps.verifyTableNormalCellsAreNotHighlighted();
|
|
246
246
|
});
|
|
247
247
|
|
|
248
|
-
it('When user checks the \'
|
|
248
|
+
it('When user checks the \'Add header row\' checkbox and then clicks on \'Add table\' button, the first row of the added table should be highlighted as table header in item preview', () => {
|
|
249
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
250
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
251
|
+
essayResponsePage.steps.checkAddRowHeaderCheckbox();
|
|
252
|
+
essayResponsePage.steps.addTable();
|
|
253
|
+
essayResponsePage.steps.verifyTableHeaderRowCellCount(3);
|
|
254
|
+
essayResponsePage.steps.verifyTableProperties(2, 3, 3);
|
|
255
|
+
essayResponsePage.steps.verifyTableHeaderCellsAreHighlighted();
|
|
256
|
+
essayResponsePage.steps.verifyTableNormalCellsAreNotHighlighted();
|
|
257
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
258
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
it('When user checks the \'Highlight first column\' checkbox and then clicks on \'Add table\' button, the first column of the added table should be highlighted in question preview.', () => {
|
|
249
262
|
cy.log('Check the \'Highlight first column\' checkbox.');
|
|
250
263
|
essayResponsePage.steps.checkHighlightFirstColumnCheckbox();
|
|
251
264
|
essayResponsePage.steps.addTable();
|
|
@@ -255,6 +268,20 @@ describe('Essay Response Preview: Add Table Functionality', () => {
|
|
|
255
268
|
essayResponsePage.steps.verifyTableNormalCellsAreNotHighlighted();
|
|
256
269
|
});
|
|
257
270
|
|
|
271
|
+
it('When user checks the \'Highlight first column\' checkbox and then clicks on \'Add table\' button, the first column of the added table should be highlighted in item preview.', () => {
|
|
272
|
+
cy.log('Check the \'Highlight first column\' checkbox.');
|
|
273
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
274
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
275
|
+
essayResponsePage.steps.checkHighlightFirstColumnCheckbox();
|
|
276
|
+
essayResponsePage.steps.addTable();
|
|
277
|
+
essayResponsePage.steps.verifyFirstColumnsIsHighlighted(2);
|
|
278
|
+
essayResponsePage.steps.verifyTableProperties(2, 4, 2);
|
|
279
|
+
essayResponsePage.steps.verifyTableHeaderCellsAreHighlighted();
|
|
280
|
+
essayResponsePage.steps.verifyTableNormalCellsAreNotHighlighted();
|
|
281
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
282
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
283
|
+
});
|
|
284
|
+
|
|
258
285
|
it('When user checks both \'Add header row\' and \'Highlight first column\' checkboxes and then clicks on \'Add table\' button, the first column and first row of the added table should be highlighted.', () => {
|
|
259
286
|
cy.log('Check both \'Add header row\' and \'Highlight first column\' checkboxes.');
|
|
260
287
|
essayResponsePage.steps.checkAddRowHeaderCheckbox();
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { essayResponsePage, itemPreviewPage } from "../../../pages";
|
|
2
|
+
import { gradingViewPage } from "../../../pages/gradingViewPage";
|
|
2
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
3
4
|
import utilities from "../../../support/helpers/utilities";
|
|
4
5
|
const css = Cypress.env('css');
|
|
5
|
-
let previewContentViews = ['Question preview', 'Item preview', 'Student view'];
|
|
6
|
+
let previewContentViews = ['Question preview', 'Item preview', 'Student view', 'Grading view'];
|
|
6
7
|
const views = utilities.getViews(previewContentViews);
|
|
7
8
|
let itemReferenceID = "";
|
|
8
9
|
|
|
@@ -48,6 +49,15 @@ describe('Create item page - Essay response: Preview contents', () => {
|
|
|
48
49
|
});
|
|
49
50
|
};
|
|
50
51
|
|
|
52
|
+
if (view === 'Item view') {
|
|
53
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
54
|
+
essayResponsePage.steps.checkManuallyScoredScoringLabel();
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
if (view === 'Grading view') {
|
|
58
|
+
gradingViewPage.steps.verifyGradingViewScore('', 10);
|
|
59
|
+
};
|
|
60
|
+
|
|
51
61
|
it(`When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - ${defaultFormattingOptionsPreviewTab.join('')} along with a separator after ${defaultFormattingOptionsPreviewTab[7]} option`, () => {
|
|
52
62
|
essayResponsePage.steps.verifyDefaultToolbarOptions(defaultFormattingOptionsPreviewTab, defaultFormattingOptionsPreviewTab[7]);
|
|
53
63
|
});
|
|
@@ -240,6 +240,30 @@ describe('Essay Response Preview: Edit Table functionality', () => {
|
|
|
240
240
|
essayResponsePage.steps.verifyContentOfTableStandardCell(3, 'Standard cell');
|
|
241
241
|
});
|
|
242
242
|
|
|
243
|
+
it('When user clicks on \'Insert Above\' button then a new identical row should be inserted above (item preview)', () => {
|
|
244
|
+
cy.log('Saving question to switch to item preview context.');
|
|
245
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
246
|
+
essayResponsePage.steps.switchToPreviewTab(); // Item preview context
|
|
247
|
+
cy.log('Right clicking in header cell to open edit table flyout.');
|
|
248
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
|
249
|
+
essayResponsePage.steps.clickOnEditTableInsertAboveButton();
|
|
250
|
+
cy.log('Opening flyout through a standard cell to insert another row above it.');
|
|
251
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(1);
|
|
252
|
+
essayResponsePage.steps.clickOnEditTableInsertAboveButton();
|
|
253
|
+
essayResponsePage.steps.verifyTableHeaderRowCellCount(6);
|
|
254
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 3);
|
|
255
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(1, 3);
|
|
256
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(2, 1);
|
|
257
|
+
essayResponsePage.steps.verifyTableRowStandardCellCount(2, 2);
|
|
258
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(3, 1);
|
|
259
|
+
essayResponsePage.steps.verifyTableRowStandardCellCount(3, 2);
|
|
260
|
+
essayResponsePage.steps.verifyContentOfTableHeaderCell(7, 'Header cell');
|
|
261
|
+
essayResponsePage.steps.verifyContentOfTableStandardCell(3, 'Standard cell');
|
|
262
|
+
cy.log('Returning to edit mode for subsequent tests.');
|
|
263
|
+
essayResponsePage.steps.switchToEditTab();
|
|
264
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
265
|
+
});
|
|
266
|
+
|
|
243
267
|
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
268
|
cy.log('Pre-step: Right click in the required cell to open edit table flyout.');
|
|
245
269
|
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
|
@@ -259,6 +283,28 @@ describe('Essay Response Preview: Edit Table functionality', () => {
|
|
|
259
283
|
essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
|
|
260
284
|
});
|
|
261
285
|
|
|
286
|
+
it('When user clicks on \'Insert Below\' button then a new identical row should be inserted below (item preview)', () => {
|
|
287
|
+
cy.log('Saving question to switch to item preview context.');
|
|
288
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
289
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
290
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
|
291
|
+
essayResponsePage.steps.clickOnEditTableInsertBelowButton();
|
|
292
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(1);
|
|
293
|
+
essayResponsePage.steps.clickOnEditTableInsertBelowButton();
|
|
294
|
+
essayResponsePage.steps.verifyTableHeaderRowCellCount(6);
|
|
295
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 3);
|
|
296
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(1, 3);
|
|
297
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(2, 1);
|
|
298
|
+
essayResponsePage.steps.verifyTableRowStandardCellCount(2, 2);
|
|
299
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(3, 1);
|
|
300
|
+
essayResponsePage.steps.verifyTableRowStandardCellCount(3, 2);
|
|
301
|
+
essayResponsePage.steps.verifyContentOfTableHeaderCell(6, 'Header cell');
|
|
302
|
+
essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
|
|
303
|
+
cy.log('Returning to edit mode for subsequent tests.');
|
|
304
|
+
essayResponsePage.steps.switchToEditTab();
|
|
305
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
306
|
+
});
|
|
307
|
+
|
|
262
308
|
it('When user clicks on \'Delete Row\' button then, the row in which it had focused should be deleted.', () => {
|
|
263
309
|
cy.log('Pre-step: Right click in the required cell to open edit table flyout.');
|
|
264
310
|
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
|
@@ -270,6 +316,22 @@ describe('Essay Response Preview: Edit Table functionality', () => {
|
|
|
270
316
|
essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
|
|
271
317
|
});
|
|
272
318
|
|
|
319
|
+
it('When user clicks on \'Delete Row\' button then the focused row should be deleted (item preview)', () => {
|
|
320
|
+
cy.log('Saving question to switch to item preview context.');
|
|
321
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
322
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
323
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
|
324
|
+
essayResponsePage.steps.clickOnEditTableDeleteRowButton();
|
|
325
|
+
essayResponsePage.steps.verifyTableRowCount(1);
|
|
326
|
+
essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 1);
|
|
327
|
+
essayResponsePage.steps.verifyTableRowStandardCellCount(0, 2);
|
|
328
|
+
essayResponsePage.steps.verifyContentOfTableHeaderCell(0, 'Header cell');
|
|
329
|
+
essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
|
|
330
|
+
cy.log('Returning to edit mode for subsequent tests.');
|
|
331
|
+
essayResponsePage.steps.switchToEditTab();
|
|
332
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
333
|
+
});
|
|
334
|
+
|
|
273
335
|
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
336
|
cy.log('Pre-step: Right click in the required cell to open edit table flyout and click on Delete Row button.');
|
|
275
337
|
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
|
@@ -277,6 +339,19 @@ describe('Essay Response Preview: Edit Table functionality', () => {
|
|
|
277
339
|
essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
|
|
278
340
|
essayResponsePage.steps.verifyUncheckedStateOfEditTableAddRowHeaderCheckbox();
|
|
279
341
|
});
|
|
342
|
+
|
|
343
|
+
it('When header row is deleted then the Add Header Row checkbox should be unchecked (item preview)', () => {
|
|
344
|
+
cy.log('Saving question to switch to item preview context.');
|
|
345
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
346
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
347
|
+
essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
|
|
348
|
+
essayResponsePage.steps.clickOnEditTableDeleteRowButton();
|
|
349
|
+
essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
|
|
350
|
+
essayResponsePage.steps.verifyUncheckedStateOfEditTableAddRowHeaderCheckbox();
|
|
351
|
+
cy.log('Returning to edit mode for subsequent tests.');
|
|
352
|
+
essayResponsePage.steps.switchToEditTab();
|
|
353
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
354
|
+
});
|
|
280
355
|
});
|
|
281
356
|
|
|
282
357
|
describe('Edit \'Add header row\' and \'Highlight first column\' checkboxes.', () => {
|
|
@@ -161,6 +161,19 @@ describe('Essay Response Preview: Hyperlink', () => {
|
|
|
161
161
|
utilities.verifyInnerText(essayResponsePage.previewInputFieldHyperlinkText(), 'Link')
|
|
162
162
|
});
|
|
163
163
|
|
|
164
|
+
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 of item preview', () => {
|
|
165
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
166
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
167
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogboxDisplayTextInputField('Link');
|
|
168
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogBoxURLInputField(`${Cypress.config().baseUrl}`);
|
|
169
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxOkButton();
|
|
170
|
+
utilities.verifyInnerText(essayResponsePage.previewInputFieldHyperlinkText(), 'Link')
|
|
171
|
+
essayResponsePage.steps.switchToEditTab();
|
|
172
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
173
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
174
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogboxDisplayTextInputField('Link');
|
|
175
|
+
});
|
|
176
|
+
|
|
164
177
|
it('CSS of the hyperlink in response field', { tags: 'css' }, () => {
|
|
165
178
|
utilities.verifyCSS(essayResponsePage.previewInputFieldHyperlinkText(), {
|
|
166
179
|
'color': css.color.linkText,
|
|
@@ -123,6 +123,53 @@ describe('Create Item page - Short text response : Student view settings', () =>
|
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
+
describe('Student view settings : Display character count, Display word count - Item preview functionality', () => {
|
|
127
|
+
abortEarlySetup();
|
|
128
|
+
before(() => {
|
|
129
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
|
130
|
+
cy.barsPreLoaderWait();
|
|
131
|
+
essayResponsePage.steps.checkCharacterRadioButton();
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('When \'Display character count\' checkbox is unchecked, then \'Character\' label and count should not be displayed in item preview', () => {
|
|
135
|
+
essayResponsePage.steps.verifyDisplayCharacterCountCheckboxUnchecked();
|
|
136
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
137
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
138
|
+
utilities.verifyElementVisibilityState(essayResponsePage.characterWordCountLabelPreviewTab(), 'hidden');
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('When \'Display character count\' checkbox is checked, then on switching to preview tab \'Character\' label and count should be displayed and count should be zero by default in item preview', () => {
|
|
142
|
+
essayResponsePage.steps.switchToEditTab();
|
|
143
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
144
|
+
essayResponsePage.steps.checkDisplayCharacterCountCheckbox();
|
|
145
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
146
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
147
|
+
utilities.verifyInnerText(essayResponsePage.characterWordCountLabelPreviewTab(), 'Characters: 0');
|
|
148
|
+
utilities.verifyElementVisibilityState(essayResponsePage.characterWordCountLabelPreviewTab(), 'visible');
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('When user enters text in response field, then character count should be updated in item preview', () => {
|
|
152
|
+
essayResponsePage.steps.enterTextInResponseField('Flowers are blooming');
|
|
153
|
+
utilities.verifyInnerText(essayResponsePage.characterWordCountLabelPreviewTab(), 'Characters: 18');
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('When user selects word in set limit section and checks \'Display word count\' checkbox , then \'Word\' label and count should be displayed in item preview', () => {
|
|
157
|
+
essayResponsePage.steps.switchToEditTab();
|
|
158
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
159
|
+
essayResponsePage.steps.selectWordRadioButton();
|
|
160
|
+
essayResponsePage.steps.checkDisplayWordCountCheckbox();
|
|
161
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
162
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
163
|
+
utilities.verifyInnerText(essayResponsePage.characterWordCountLabelPreviewTab(), 'Words: 0');
|
|
164
|
+
utilities.verifyElementVisibilityState(essayResponsePage.characterWordCountLabelPreviewTab(), 'visible');
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it('When user enters text in response field, then character count should be updated in item preview', () => {
|
|
168
|
+
essayResponsePage.steps.enterTextInResponseField('Flowers are blooming');
|
|
169
|
+
utilities.verifyInnerText(essayResponsePage.characterWordCountLabelPreviewTab(), 'Words: 3');
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
126
173
|
describe('Student view settings : Spell check - Preview tab functionality', () => {
|
|
127
174
|
abortEarlySetup();
|
|
128
175
|
before(() => {
|
|
@@ -143,4 +190,28 @@ describe('Create Item page - Short text response : Student view settings', () =>
|
|
|
143
190
|
essayResponsePage.steps.verifySpellCheckOfResponseFieldPreviewTabEnabled();
|
|
144
191
|
});
|
|
145
192
|
});
|
|
193
|
+
|
|
194
|
+
describe('Student view settings : Spell check - Item preview', () => {
|
|
195
|
+
abortEarlySetup();
|
|
196
|
+
before(() => {
|
|
197
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
|
198
|
+
cy.barsPreLoaderWait();
|
|
199
|
+
essayResponsePage.steps.uncheckSpellCheckCheckbox();
|
|
200
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
201
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it('When the \'Spell check\' checkbox is unchecked, the response field should have \'spellcheck\' attribute set as \'false\' in item preview', () => {
|
|
205
|
+
essayResponsePage.steps.verifySpellCheckOfResponseFieldPreviewTabDisabled();
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it('When the \'Spell check\' checkbox is checked, the response field should have \'spellcheck\' attribute set as \'true\' in item preview', () => {
|
|
209
|
+
essayResponsePage.steps.switchToEditTab();
|
|
210
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
211
|
+
essayResponsePage.steps.checkSpellCheckCheckbox();
|
|
212
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
213
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
214
|
+
essayResponsePage.steps.verifySpellCheckOfResponseFieldPreviewTabEnabled();
|
|
215
|
+
});
|
|
216
|
+
});
|
|
146
217
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import utilities from "../../support/helpers/utilities";
|
|
2
2
|
import { equationEditorCategoriesAndSymbols } from "../../fixtures/equationEditorCategoriesAndSymbols ";
|
|
3
3
|
import { equationEditorFlyout, commonComponents, essayResponseCommonComponents, createQuestionBasePage, autoScoredScoringPreviewTab } from "../components";
|
|
4
|
+
//import { essayResponsePage } from "../essayResponsePage";
|
|
4
5
|
const css = Cypress.env('css');
|
|
5
6
|
const allCategories = Object.values(equationEditorCategoriesAndSymbols)
|
|
6
7
|
const defaultSelectedCategories = ['Numpad', 'Keypad', 'Intermediate', 'Primary', 'General', 'Common', 'Algebra', 'Geo', 'Compare', 'Matrices'];
|
|
@@ -333,6 +334,26 @@ const tests = {
|
|
|
333
334
|
equationEditorSectionCommonComponent.steps.verifyResponseFieldEquationTextNew(0, 'x+5×0');
|
|
334
335
|
}
|
|
335
336
|
});
|
|
337
|
+
|
|
338
|
+
it('When user edits the added equation and clicks on Ok button, the edited equation should be displayed in the preview input field in item preview', () => {
|
|
339
|
+
if (questionType === 'essay response') {
|
|
340
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
341
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
342
|
+
equationEditorSectionCommonComponent.steps.openResponseFieldEquationContainerEquationEditor(0);
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
equationEditorSectionCommonComponent.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
|
346
|
+
}
|
|
347
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('{backspace}{backspace}');
|
|
348
|
+
equationEditorFlyout.steps.enterEquation([{ categoryName: 'numPad', symbolName: ['multiply', 'zero'] }]);
|
|
349
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
|
350
|
+
if (questionType === 'essay response') {
|
|
351
|
+
equationEditorSectionCommonComponent.steps.verifyResponseFieldEquationText(0, 'x+5×0');
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
equationEditorSectionCommonComponent.steps.verifyResponseFieldEquationTextNew(0, 'x+5×0');
|
|
355
|
+
}
|
|
356
|
+
});
|
|
336
357
|
},
|
|
337
358
|
|
|
338
359
|
/**
|
|
@@ -96,7 +96,8 @@ const selectors = {
|
|
|
96
96
|
customSpecialCharacterLabel: () => cy.get('[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]').eq(1),
|
|
97
97
|
customSpecialCharacterInputField: () => cy.get('input[aria-label="Custom Special Characters"]'),
|
|
98
98
|
limitReachedWarningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
|
|
99
|
-
limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]')
|
|
99
|
+
limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
|
|
100
|
+
wordCharacterLimitWrapper: () => cy.get('.essay-character-view-wrapper')
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
const steps = {
|
|
@@ -202,6 +203,24 @@ const steps = {
|
|
|
202
203
|
.should('be.checked');
|
|
203
204
|
},
|
|
204
205
|
|
|
206
|
+
unCheckAlwaysShowMinimumLimitCheckbox: () => {
|
|
207
|
+
essayResponseCommonComponents.alwaysShowMinLimitCheckBox()
|
|
208
|
+
.click()
|
|
209
|
+
.should('not.be.checked');
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
checkAlwaysShowMaximumLimitCheckbox: () => {
|
|
213
|
+
essayResponseCommonComponents.alwaysShowMaxLimitCheckbox()
|
|
214
|
+
.click()
|
|
215
|
+
.should('be.checked');
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
uncheckAlwaysShowMaximumLimitCheckbox: () => {
|
|
219
|
+
essayResponseCommonComponents.alwaysShowMaxLimitCheckbox()
|
|
220
|
+
.click()
|
|
221
|
+
.should('not.be.checked');
|
|
222
|
+
},
|
|
223
|
+
|
|
205
224
|
verifyListItemLengthInResponseField: (length) => {
|
|
206
225
|
essayResponseCommonComponents.responseField()
|
|
207
226
|
.find('li')
|
|
@@ -19,6 +19,7 @@ const selectors = {
|
|
|
19
19
|
...customizeSpecialCharacterComponent,
|
|
20
20
|
...dialogBoxBase,
|
|
21
21
|
...equationEditorSectionCommonComponent,
|
|
22
|
+
...autoScoredScoringPreviewTab,
|
|
22
23
|
//Basic section
|
|
23
24
|
displayWordLimitLabel: () => cy.get('#Display-word-limit-dropdown-label'),
|
|
24
25
|
displayWordLimitDropdown: () => cy.get('#Display-word-limit-select'),
|
|
@@ -142,6 +143,7 @@ const steps = {
|
|
|
142
143
|
...dialogBoxBase.steps,
|
|
143
144
|
...equationEditorSectionCommonComponent.steps,
|
|
144
145
|
...createItemPage.steps,
|
|
146
|
+
...autoScoredScoringPreviewTab.steps,
|
|
145
147
|
|
|
146
148
|
clickOnSpecialCharactersPopupCloseButton: () => {
|
|
147
149
|
essayResponsePage.specialCharactersPopupCloseButton()
|