itemengine-cypress-automation 1.0.574-IEI-7071-main-96a7dd4.0 → 1.0.574-IEI-7065-Improve-test-coverage-for-essay-response-1a8de95.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 +13 -0
- package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +155 -5
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +117 -4
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +101 -4
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +114 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +12 -2
- package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +38 -3
- package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +41 -23
- package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +78 -3
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +15 -0
- package/cypress/e2e/ILC/EssayResponse/studentViewSettings.js +71 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +8 -123
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +8 -123
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +8 -123
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +6 -93
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +2 -23
- package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +2 -99
- package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +1 -55
- package/cypress/e2e/ILC/ShortTextResponseNew/{Scoring/manuallyAndNonScoredScoring.js → manuallyAndNonScoredScoring.js} +18 -6
- package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +1 -151
- package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +3 -3
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -129
- package/cypress/pages/components/equationEditorSectionCommonComponent.js +20 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +29 -1
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +0 -36
- package/cypress/pages/components/printPreviewComponent.js +1 -8
- package/cypress/pages/essayResponsePage.js +3 -1
- package/cypress/pages/shortTextResponsePage.js +6 -195
- package/package.json +1 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -63
- package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -63
- package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -87
- package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingWeightsBasic.js +0 -163
|
@@ -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', () => {
|
|
@@ -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,19 @@ 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.switchToEditTab();
|
|
45
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
46
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
47
|
+
});
|
|
48
|
+
|
|
36
49
|
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
50
|
essayResponsePage.steps.enterInputInResponseField('{enter}');
|
|
38
51
|
essayResponsePage.steps.verifyListItemLengthInResponseField(2);
|
|
@@ -57,7 +70,7 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
57
70
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert/Remove Numbered List');
|
|
58
71
|
|
|
59
72
|
//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', () => {
|
|
73
|
+
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
74
|
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
62
75
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
|
|
63
76
|
essayResponsePage.steps.verifyResponseFieldHTML('<ol><li><br></li></ol>');
|
|
@@ -65,6 +78,18 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
65
78
|
essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li></ol>');
|
|
66
79
|
});
|
|
67
80
|
|
|
81
|
+
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', () => {
|
|
82
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
83
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
84
|
+
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
85
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
|
|
86
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<ol><li><br></li></ol>');
|
|
87
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
88
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li></ol>');
|
|
89
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
90
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
91
|
+
});
|
|
92
|
+
|
|
68
93
|
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
94
|
essayResponsePage.steps.enterInputInResponseField('{enter}');
|
|
70
95
|
essayResponsePage.steps.verifyListItemLengthInResponseField(2);
|
|
@@ -228,6 +253,64 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
228
253
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Align Right');
|
|
229
254
|
});
|
|
230
255
|
|
|
256
|
+
describe('Align left, Center, Align right, Justify formatting options - Item preview', () => {
|
|
257
|
+
abortEarlySetup();
|
|
258
|
+
before(() => {
|
|
259
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
|
260
|
+
cy.barsPreLoaderWait();
|
|
261
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
|
262
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Align Left', 'Align Center', 'Align Right', 'Align Justify']);
|
|
263
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
264
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
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', () => {
|
|
268
|
+
essayResponsePage.steps.focusInResponseField();
|
|
269
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left');
|
|
270
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Center');
|
|
271
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Right');
|
|
272
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Justify');
|
|
273
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
274
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
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', () => {
|
|
278
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Align Center');
|
|
279
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: center;\">Lorem Ipsum</p>')
|
|
280
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left')
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
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', () => {
|
|
284
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Align Left');
|
|
285
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style="text-align: left;">Lorem Ipsum</p>');
|
|
286
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Center')
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
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', () => {
|
|
290
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Align Right');
|
|
291
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: right;\">Lorem Ipsum</p>');
|
|
292
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left')
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
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', () => {
|
|
296
|
+
essayResponsePage.steps.deselectPreviewTabToolbarOption('Align Right');
|
|
297
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
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', () => {
|
|
301
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Align Justify');
|
|
302
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style="text-align: justify;">Lorem Ipsum</p>');
|
|
303
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Right')
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
it('When the user switches to the next line, \'Justify\' toolbar option should persist in item preview', () => {
|
|
307
|
+
essayResponsePage.steps.enterInputInResponseField('{enter}');
|
|
308
|
+
utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarOption('Align Justify'), 'visible');
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Align Right');
|
|
312
|
+
});
|
|
313
|
+
|
|
231
314
|
describe('Increase indent, Decrease indent formatting options - Preview tab', () => {
|
|
232
315
|
abortEarlySetup();
|
|
233
316
|
before(() => {
|
|
@@ -242,15 +325,29 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
242
325
|
essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Decrease Indent')
|
|
243
326
|
});
|
|
244
327
|
|
|
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', () => {
|
|
328
|
+
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
329
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
247
330
|
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
|
|
248
331
|
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Decrease Indent')
|
|
249
332
|
});
|
|
250
333
|
|
|
334
|
+
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', () => {
|
|
335
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
336
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
337
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
338
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
339
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
|
|
340
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Decrease Indent')
|
|
341
|
+
essayResponsePage.steps.switchToEditTab();
|
|
342
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
343
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
344
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
345
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
346
|
+
});
|
|
347
|
+
|
|
251
348
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Increase Indent');
|
|
252
349
|
|
|
253
|
-
it('When the user selects the \'Decrease indent\' toolbar option, then the indentation of text in the response field should decrease', () => {
|
|
350
|
+
it('When the user selects the \'Decrease indent\' toolbar option, then the indentation of text in the response field should decrease in question', () => {
|
|
254
351
|
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
255
352
|
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
256
353
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
@@ -259,6 +356,22 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
259
356
|
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
260
357
|
});
|
|
261
358
|
|
|
359
|
+
it('When the user selects the \'Decrease indent\' toolbar option, then the indentation of text in the response field should decrease in question', () => {
|
|
360
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
361
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
362
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
363
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
364
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
|
|
365
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Decrease Indent');
|
|
366
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
367
|
+
essayResponsePage.steps.switchToEditTab();
|
|
368
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
369
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
370
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
371
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
|
|
372
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Decrease Indent');
|
|
373
|
+
});
|
|
374
|
+
|
|
262
375
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Decrease Indent');
|
|
263
376
|
});
|
|
264
377
|
});
|
|
@@ -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.saveAQuestionAndVerifySnackbar();
|
|
45
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
46
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
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,20 @@ 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.enterInputInResponseField('Lorem Ipsum');
|
|
82
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p></blockquote>');
|
|
83
|
+
essayResponsePage.steps.switchToEditTab();
|
|
84
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
85
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
86
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Block Quote');
|
|
87
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
|
|
88
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p></blockquote>')
|
|
89
|
+
});
|
|
90
|
+
|
|
52
91
|
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
92
|
essayResponsePage.steps.enterInputInResponseField('{enter}dolor sit amet');
|
|
54
93
|
essayResponsePage.steps.verifyPreviewTabToolbarOptionSelected('Block Quote')
|
|
@@ -85,6 +124,25 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
85
124
|
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotDisabled('Bold (Ctrl+B)');
|
|
86
125
|
});
|
|
87
126
|
|
|
127
|
+
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', () => {
|
|
128
|
+
cy.log('Saving question to switch to item preview context.');
|
|
129
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
130
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
131
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
|
|
132
|
+
essayResponsePage.steps.enterInputInResponseField('console.log()')
|
|
133
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p><code>console.log()</code><br></p>');
|
|
134
|
+
essayResponsePage.steps.verifyWordCount('1');
|
|
135
|
+
//Just checking if Bold option is disabled or not, no need to check for all toolbar options
|
|
136
|
+
essayResponsePage.steps.verifyPreviewTabToolbarOptionNotDisabled('Bold (Ctrl+B)');
|
|
137
|
+
cy.log('Returning to edit mode.');
|
|
138
|
+
essayResponsePage.steps.switchToEditTab();
|
|
139
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
140
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
141
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
|
|
142
|
+
essayResponsePage.steps.enterInputInResponseField('console.log()')
|
|
143
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p><code>console.log()</code><br></p>');
|
|
144
|
+
});
|
|
145
|
+
|
|
88
146
|
//Comment: exceptional assertion of font size since in code inline font size is 14.4px
|
|
89
147
|
it('CSS of \'highlighted inline code text\'', { tags: 'css' }, () => {
|
|
90
148
|
utilities.verifyCSS(essayResponsePage.responseField().find('code'), {
|
|
@@ -203,6 +261,27 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
203
261
|
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
204
262
|
});
|
|
205
263
|
|
|
264
|
+
it('When the user applies Bold, Italic, Underline, Strikethrough and removes formatting in item preview, text should revert to default format', () => {
|
|
265
|
+
cy.log('Saving question to switch to item preview context.');
|
|
266
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
267
|
+
essayResponsePage.steps.switchToPreviewTab(); // item preview
|
|
268
|
+
// Recreate initial content
|
|
269
|
+
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
270
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
|
|
271
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
|
|
272
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
|
|
273
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
|
|
274
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Strikethrough');
|
|
275
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p><s><u><em><strong>Lorem Ipsum</strong></em></u></s></p>');
|
|
276
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format');
|
|
277
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
278
|
+
cy.log('Returning to edit mode.');
|
|
279
|
+
essayResponsePage.steps.switchToEditTab();
|
|
280
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
281
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
282
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
|
|
283
|
+
});
|
|
284
|
+
|
|
206
285
|
essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Remove Format');
|
|
207
286
|
|
|
208
287
|
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,18 +294,36 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
|
215
294
|
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum<br></p>');
|
|
216
295
|
});
|
|
217
296
|
|
|
297
|
+
it('When the user applies Superscript & Subscript and removes formatting in item preview, text should revert to default format', () => {
|
|
298
|
+
cy.log('Saving question to switch to item preview context for superscript/subscript removal.');
|
|
299
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
300
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
301
|
+
essayResponsePage.steps.resetPreviewTabResponseField();
|
|
302
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Subscript');
|
|
303
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Superscript');
|
|
304
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
|
|
305
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p><sub><sup>Lorem Ipsum</sup></sub><br></p>');
|
|
306
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format');
|
|
307
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum<br></p>');
|
|
308
|
+
cy.log('Returning to edit mode after item preview test.');
|
|
309
|
+
essayResponsePage.steps.switchToEditTab();
|
|
310
|
+
essayResponsePage.steps.clickOnEditQuestionButton();
|
|
311
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
312
|
+
essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
|
|
313
|
+
});
|
|
314
|
+
|
|
218
315
|
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
316
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Align Right');
|
|
220
|
-
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: right;\">Lorem Ipsum
|
|
317
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: right;\">Lorem Ipsum</p>');
|
|
221
318
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format')
|
|
222
|
-
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum
|
|
319
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
223
320
|
});
|
|
224
321
|
|
|
225
322
|
it('When the user has selected text in the response field and applies text formatting option - Code inline 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', () => {
|
|
226
323
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
|
|
227
|
-
essayResponsePage.steps.verifyResponseFieldHTML('<p><code>Lorem Ipsum</code
|
|
324
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p><code>Lorem Ipsum</code></p>');
|
|
228
325
|
essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format')
|
|
229
|
-
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum
|
|
326
|
+
essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
|
|
230
327
|
});
|
|
231
328
|
});
|
|
232
329
|
|