itemengine-cypress-automation 1.0.13 → 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAdditionalSettings.js +2 -487
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAdditionalSettingsBasic.js +336 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseConditionalCheckboxes.js +154 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseContainsConditionalRadioButton.js +166 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseCustomSpecialCharacters.js +167 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseExactConditionalRadioButton.js +157 -0
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseManuallyScoredNonScoredScoringSection.js +1 -1
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseSetCorrectAnswerSection.js +137 -0
- package/package.json +1 -1
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseEditTabBasicSections.js +0 -587
- package/cypress/e2e/ILC/sorry-cypress-test/spec1.js +0 -18
- package/cypress/e2e/ILC/sorry-cypress-test/spec2.js +0 -18
- package/cypress/e2e/ILC/sorry-cypress-test/spec3.js +0 -18
@@ -1,24 +1,13 @@
|
|
1
|
-
import {
|
1
|
+
import { shortTextResponsePage } from "../../../pages";
|
2
2
|
import { commonComponents } from "../../../pages/components";
|
3
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
-
import { specialOrMathCharacters } from "../../../fixtures/specialAndMathCharacters";
|
5
4
|
const css = Cypress.env('css');
|
6
|
-
let customSpecialCharacters = [':', ')', '`']
|
7
5
|
|
8
6
|
describe('Short text response - Additional settings', () => {
|
9
7
|
before(() => {
|
10
8
|
cy.loginAs('admin');
|
11
9
|
});
|
12
10
|
|
13
|
-
describe('Additional Settings accordion', () => {
|
14
|
-
abortEarlySetup();
|
15
|
-
before(() => {
|
16
|
-
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
17
|
-
});
|
18
|
-
|
19
|
-
shortTextResponsePage.tests.verifyAdditonalSettingsAccordionProperties();
|
20
|
-
});
|
21
|
-
|
22
11
|
describe('Additional Settings: Student response area and layout', () => {
|
23
12
|
abortEarlySetup();
|
24
13
|
before(() => {
|
@@ -29,7 +18,7 @@ describe('Short text response - Additional settings', () => {
|
|
29
18
|
shortTextResponsePage.tests.verifyStudentResponseAreaAndLayoutLabelAndCSS();
|
30
19
|
});
|
31
20
|
|
32
|
-
describe('
|
21
|
+
describe('Additional Settings: ARIA label', () => {
|
33
22
|
abortEarlySetup();
|
34
23
|
before(() => {
|
35
24
|
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
@@ -384,478 +373,4 @@ describe('Short text response - Additional settings', () => {
|
|
384
373
|
.should('have.value', 'ut placerat orci nulla pellentesque dignissim');
|
385
374
|
});
|
386
375
|
});
|
387
|
-
|
388
|
-
describe('Additional Settings: Spell check section', () => {
|
389
|
-
abortEarlySetup();
|
390
|
-
before(() => {
|
391
|
-
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
392
|
-
shortTextResponsePage.steps.expandAdditonalSettings();
|
393
|
-
});
|
394
|
-
|
395
|
-
it('\'Spell check\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
|
396
|
-
shortTextResponsePage.spellCheckLabel()
|
397
|
-
.verifyInnerText('Spell check');
|
398
|
-
shortTextResponsePage.spellCheckCheckbox()
|
399
|
-
.should('not.be.checked');
|
400
|
-
});
|
401
|
-
|
402
|
-
it('CSS of \'Spell check\' section - unchecked state', { tags: 'css' }, () => {
|
403
|
-
shortTextResponsePage.spellCheckCheckbox()
|
404
|
-
.parent()
|
405
|
-
.find('svg')
|
406
|
-
.should('have.css', 'fill', css.color.uncheckedCheckbox);
|
407
|
-
});
|
408
|
-
|
409
|
-
//Note: a11y covered in Additional settings accordion, verifyAdditonalSettingsAccordionProperties
|
410
|
-
|
411
|
-
//Spell check test cases for set correct answer section response field
|
412
|
-
it('When the \'Spell check\' functionality is disabled, the response field should have \'spellcheck\' attribute set as \'false\' in set correct answer section', () => {
|
413
|
-
shortTextResponsePage.setCorrectAnswerResponseFieldWrapper()
|
414
|
-
.should('have.attr', 'spellcheck', 'false');
|
415
|
-
});
|
416
|
-
|
417
|
-
it('When the \'Spell check\' functionality is enabled, the response field should have \'spellcheck\' attribute set as \'true\' in set correct answer section', () => {
|
418
|
-
shortTextResponsePage.spellCheckCheckbox()
|
419
|
-
.click()
|
420
|
-
.should('be.checked');
|
421
|
-
shortTextResponsePage.setCorrectAnswerResponseFieldWrapper()
|
422
|
-
.should('have.attr', 'spellcheck', 'true');
|
423
|
-
});
|
424
|
-
|
425
|
-
it('CSS of \'Spell check\' section - checked state', { tags: 'css' }, () => {
|
426
|
-
shortTextResponsePage.spellCheckLabel()
|
427
|
-
.verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
|
428
|
-
shortTextResponsePage.spellCheckCheckbox()
|
429
|
-
.parent('.icon-checkbox-selected')
|
430
|
-
.find('.checkbox-icon-border-rect')
|
431
|
-
.should('have.css', 'fill', css.color.activeButtons);
|
432
|
-
});
|
433
|
-
|
434
|
-
it('Accessibility of \'Spell check\' section - checked state', { tags: 'a11y' }, () => {
|
435
|
-
cy.checkAccessibility(shortTextResponsePage.spellCheckLabel().parents('.spell-check-checkbox-wrapper'))
|
436
|
-
});
|
437
|
-
|
438
|
-
//Spell check test cases for preview tab response field
|
439
|
-
it('When the \'Spell check\' functionality is disabled, the response field should have \'spellcheck\' attribute set as \'false\' in preview tab', () => {
|
440
|
-
shortTextResponsePage.spellCheckCheckbox()
|
441
|
-
.click()
|
442
|
-
.should('not.be.checked');
|
443
|
-
shortTextResponsePage.steps.switchToPreviewTab();
|
444
|
-
shortTextResponsePage.previewTabResponseFieldWrapper()
|
445
|
-
.should('have.attr', 'spellcheck', 'false');
|
446
|
-
});
|
447
|
-
|
448
|
-
it('When the \'Spell check\' functionality is enabled, the response field should have \'spellcheck\' attribute set as \'true\' in the preview tab', () => {
|
449
|
-
cy.log('Pre step: Switching to Edit tab')
|
450
|
-
shortTextResponsePage.steps.switchToEditTab();
|
451
|
-
shortTextResponsePage.spellCheckCheckbox()
|
452
|
-
.click()
|
453
|
-
.should('be.checked');
|
454
|
-
shortTextResponsePage.steps.switchToPreviewTab();
|
455
|
-
shortTextResponsePage.previewTabResponseFieldWrapper()
|
456
|
-
.should('have.attr', 'spellcheck', 'true');
|
457
|
-
});
|
458
|
-
});
|
459
|
-
|
460
|
-
describe('Additional Settings: Custom special characters section', () => {
|
461
|
-
abortEarlySetup();
|
462
|
-
before(() => {
|
463
|
-
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
464
|
-
shortTextResponsePage.steps.expandAdditonalSettings();
|
465
|
-
});
|
466
|
-
|
467
|
-
shortTextResponsePage.tests.verifyAdditionalSettingsCustomSpecialCharactersSection();
|
468
|
-
|
469
|
-
it('When the user checks the \'Display special characters\' checkbox then the \'Special characters\' button should be displayed when user focuses in the response field in set correct answer section ', () => {
|
470
|
-
cy.log('Checking Custom characters button is not visible before focusing any option')
|
471
|
-
shortTextResponsePage.setCorrectAnsResponseFieldSpecialCharactersButton()
|
472
|
-
.should('not.have.class', 'active-special-character-button')
|
473
|
-
.should('not.be.visible');
|
474
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
475
|
-
.click();
|
476
|
-
shortTextResponsePage.setCorrectAnsResponseFieldSpecialCharactersButton()
|
477
|
-
.should('have.class', 'active-special-character-button')
|
478
|
-
.should('be.visible');
|
479
|
-
});
|
480
|
-
|
481
|
-
it('When the user has added no input to the \'Custom special characters\' input field then the default Special characters flyout should be displayed on clicking the \'Special characters\' button in the response field', () => {
|
482
|
-
shortTextResponsePage.setCorrectAnsResponseFieldSpecialCharactersButton()
|
483
|
-
.should('be.visible')
|
484
|
-
.click();
|
485
|
-
shortTextResponsePage.steps.verifySpecialCharactersFlyoutHeaderContents();
|
486
|
-
});
|
487
|
-
|
488
|
-
shortTextResponsePage.tests.verifySpecialCharactersFlyoutSymbols()
|
489
|
-
|
490
|
-
it(`When user clicks on a symbol in the ${specialOrMathCharacters['specialCharacters'].popupTitle} popup, then that symbol should be inserted in the response field`, () => {
|
491
|
-
cy.log('Clicking on all symbols.');
|
492
|
-
let symbolsString = specialOrMathCharacters['specialCharacters'].characters.map((icon) => icon.symbol);
|
493
|
-
symbolsString = symbolsString.join('');
|
494
|
-
shortTextResponsePage.steps.clickingOnSpecialCharactersSymbolsFromFlyout();
|
495
|
-
dialogBoxBase.steps.closeWarningPopup();
|
496
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
497
|
-
.should('have.value', symbolsString);
|
498
|
-
cy.log('Post step: Clearing the set correct answer input field')
|
499
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
500
|
-
.clear();
|
501
|
-
});
|
502
|
-
|
503
|
-
it('When the \'Display special characters\' checkbox is checked then user should be able to enter value in the \'Custom special characters\' input field', () => {
|
504
|
-
shortTextResponsePage.customSpecialCharactersInputField()
|
505
|
-
.type(':)`')
|
506
|
-
.should('have.value', ':)`');
|
507
|
-
});
|
508
|
-
|
509
|
-
it('When the user clicks on the \'Special characters\' button in the response field then a flyout with the title \'Special characters\' and close button should be displayed', () => {
|
510
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
511
|
-
.click();
|
512
|
-
shortTextResponsePage.setCorrectAnsResponseFieldSpecialCharactersButton()
|
513
|
-
.should('be.visible')
|
514
|
-
.click();
|
515
|
-
shortTextResponsePage.steps.verifySpecialCharactersFlyoutHeaderContents();
|
516
|
-
});
|
517
|
-
|
518
|
-
it('The flyout should contain all the added Special characters entered in the \'Custom special characters\' input field', () => {
|
519
|
-
shortTextResponsePage.specialCharactersFlyoutIcon()
|
520
|
-
.each(($el, index) => {
|
521
|
-
cy.wrap($el)
|
522
|
-
.should('have.text', `${customSpecialCharacters[index]}`)
|
523
|
-
});
|
524
|
-
});
|
525
|
-
|
526
|
-
it('When user clicks on the characters then they should be added to the set correct answer response field', () => {
|
527
|
-
shortTextResponsePage.steps.clickingOnSpecialCharactersSymbolsFromFlyout();
|
528
|
-
dialogBoxBase.steps.closeWarningPopup();
|
529
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
530
|
-
.should('have.value', ':)`');
|
531
|
-
});
|
532
|
-
|
533
|
-
//Special custom characters test cases for preview tab response field
|
534
|
-
it('When the \'Custom special characters\' functionality is disabled then the \'Special characters\' button should not be displayed in the preview tab response field', () => {
|
535
|
-
shortTextResponsePage.customSpecialCharactersInputField()
|
536
|
-
.clear();
|
537
|
-
shortTextResponsePage.displaySpecialCharactersCheckbox()
|
538
|
-
.click()
|
539
|
-
.should('not.be.checked');
|
540
|
-
shortTextResponsePage.steps.switchToPreviewTab();
|
541
|
-
shortTextResponsePage.previewTabResponseFieldSpecialCharactersButton()
|
542
|
-
.should('not.exist');
|
543
|
-
});
|
544
|
-
|
545
|
-
it('When the user has enabled the \'Custom special characters\' functionality then the \'Special characters\' button should be displayed when user focuses in any response field in the preview tab', () => {
|
546
|
-
cy.log('Pre step: Enable the Custom special characters')
|
547
|
-
shortTextResponsePage.steps.switchToEditTab();
|
548
|
-
shortTextResponsePage.displaySpecialCharactersCheckbox()
|
549
|
-
.click()
|
550
|
-
.should('be.checked');
|
551
|
-
shortTextResponsePage.steps.switchToPreviewTab();
|
552
|
-
shortTextResponsePage.previewTabResponseFieldSpecialCharactersButton()
|
553
|
-
.should('not.have.class', 'active-special-character-button')
|
554
|
-
.and('not.be.visible');
|
555
|
-
shortTextResponsePage.previewTabResponseField()
|
556
|
-
.click();
|
557
|
-
shortTextResponsePage.previewTabResponseFieldSpecialCharactersButton()
|
558
|
-
.should('have.class', 'active-special-character-button')
|
559
|
-
.and('be.visible');
|
560
|
-
});
|
561
|
-
|
562
|
-
it('When the user has added no input to the \'Custom special characters\' input field then the default Special characters flyout should be displayed on clicking the \'Special characters\' button in the response field', () => {
|
563
|
-
shortTextResponsePage.previewTabResponseFieldSpecialCharactersButton()
|
564
|
-
.should('be.visible')
|
565
|
-
.click();
|
566
|
-
shortTextResponsePage.steps.verifySpecialCharactersFlyoutHeaderContents();
|
567
|
-
});
|
568
|
-
|
569
|
-
shortTextResponsePage.tests.verifySpecialCharactersFlyoutSymbols()
|
570
|
-
|
571
|
-
it(`When user clicks on a symbol in the ${specialOrMathCharacters['specialCharacters'].popupTitle} popup, then that symbol should be inserted in the response field`, () => {
|
572
|
-
cy.log('Clicking on all symbols.');
|
573
|
-
let symbolsString = specialOrMathCharacters['specialCharacters'].characters.map((icon) => icon.symbol);
|
574
|
-
symbolsString = symbolsString.join('');
|
575
|
-
shortTextResponsePage.steps.clickingOnSpecialCharactersSymbolsFromFlyout();
|
576
|
-
dialogBoxBase.steps.closeWarningPopup();
|
577
|
-
shortTextResponsePage.previewTabResponseField()
|
578
|
-
.should('have.value', symbolsString);
|
579
|
-
});
|
580
|
-
|
581
|
-
it('When the \'Display special characters\' checkbox is checked then user should be able to enter value in the \'Custom special characters\' input field', () => {
|
582
|
-
cy.log('Pre step: Swicth to Edit tab')
|
583
|
-
shortTextResponsePage.steps.switchToEditTab()
|
584
|
-
shortTextResponsePage.customSpecialCharactersInputField()
|
585
|
-
.type(':)`')
|
586
|
-
.should('have.value', ':)`');
|
587
|
-
cy.log('Post step: Switch to Preview tab')
|
588
|
-
shortTextResponsePage.steps.switchToPreviewTab()
|
589
|
-
});
|
590
|
-
|
591
|
-
it('When the user clicks on the \'Special characters\' button then a flyout with the title \'Special characters\' and close button should be displayed in the preview tab', () => {
|
592
|
-
shortTextResponsePage.previewTabResponseField()
|
593
|
-
.click();
|
594
|
-
shortTextResponsePage.previewTabResponseFieldSpecialCharactersButton()
|
595
|
-
.should('be.visible')
|
596
|
-
.click();
|
597
|
-
shortTextResponsePage.steps.verifySpecialCharactersFlyoutHeaderContents();
|
598
|
-
});
|
599
|
-
|
600
|
-
it('The flyout should contain all the added Special characters entered in the \'Custom special characters\' input field', () => {
|
601
|
-
shortTextResponsePage.specialCharactersFlyoutIcon()
|
602
|
-
.each(($el, index) => {
|
603
|
-
cy.wrap($el)
|
604
|
-
.should('have.text', `${customSpecialCharacters[index]}`)
|
605
|
-
});
|
606
|
-
});
|
607
|
-
|
608
|
-
it('When user clicks on the characters then they should be added to the preview tab input field', () => {
|
609
|
-
shortTextResponsePage.steps.clickingOnSpecialCharactersSymbolsFromFlyout();
|
610
|
-
dialogBoxBase.steps.closeWarningPopup();
|
611
|
-
shortTextResponsePage.previewTabResponseField()
|
612
|
-
.should('have.value', ':)`');
|
613
|
-
});
|
614
|
-
});
|
615
|
-
|
616
|
-
describe('Additional Settings: Font Size dropdown', () => {
|
617
|
-
abortEarlySetup();
|
618
|
-
before(() => {
|
619
|
-
cy.log('Navigating to multiple selection quetion type, adding question instructions and options, alloting points and expanding additional settings accordion')
|
620
|
-
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
621
|
-
shortTextResponsePage.questionInstructionsInputField()
|
622
|
-
.type('Question Instructions');
|
623
|
-
shortTextResponsePage.pointsInputField()
|
624
|
-
.type('4');
|
625
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
626
|
-
.type('Answer input');
|
627
|
-
shortTextResponsePage.steps.expandAdditonalSettings();
|
628
|
-
});
|
629
|
-
|
630
|
-
shortTextResponsePage.tests.verifyFontSizeSectionContents();
|
631
|
-
|
632
|
-
//Failing due to https://redmine.zeuslearning.com/issues/526873
|
633
|
-
const fontsizes = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
|
634
|
-
const font = ['16px', '12px', '14px', '17px', '20px', '24px'];
|
635
|
-
fontsizes.forEach((option, count) => {
|
636
|
-
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab contents should be changed to ${option} in the \'Set Correct Answer\' section as well as in the \'Preview\' tab`, () => {
|
637
|
-
shortTextResponsePage.fontSizeDropdown()
|
638
|
-
.click();
|
639
|
-
shortTextResponsePage.fontSizeListOptions(count)
|
640
|
-
.click();
|
641
|
-
shortTextResponsePage.fontSizeDropdown()
|
642
|
-
.verifyInnerText(`${option}`);
|
643
|
-
cy.log('Checking correct answer section font size')
|
644
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
645
|
-
.should('have.css', 'font-size', font[count]);
|
646
|
-
cy.log('Switching to Preview tab')
|
647
|
-
shortTextResponsePage.steps.switchToPreviewTab();
|
648
|
-
cy.log('Checking Preview section font size')
|
649
|
-
shortTextResponsePage.questionInstructionsText()
|
650
|
-
.should('have.css', 'font-size', font[count]);
|
651
|
-
shortTextResponsePage.previewTabResponseField()
|
652
|
-
.should('have.css', 'font-size', font[count]);
|
653
|
-
shortTextResponsePage.steps.switchToEditTab();
|
654
|
-
});
|
655
|
-
});
|
656
|
-
});
|
657
|
-
|
658
|
-
describe('Additional Settings: Check Answer', () => {
|
659
|
-
abortEarlySetup();
|
660
|
-
before(() => {
|
661
|
-
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
662
|
-
shortTextResponsePage.questionInstructionsInputField()
|
663
|
-
.type('Question Instructions');
|
664
|
-
shortTextResponsePage.pointsInputField()
|
665
|
-
.type('4');
|
666
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
667
|
-
.type('Answer input');
|
668
|
-
shortTextResponsePage.steps.expandAdditonalSettings();
|
669
|
-
});
|
670
|
-
|
671
|
-
shortTextResponsePage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
|
672
|
-
});
|
673
|
-
|
674
|
-
describe('Additional Settings: Check Answer - Functionality', () => {
|
675
|
-
abortEarlySetup();
|
676
|
-
before(() => {
|
677
|
-
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
678
|
-
shortTextResponsePage.questionInstructionsInputField()
|
679
|
-
.type('Question Instructions');
|
680
|
-
shortTextResponsePage.pointsInputField()
|
681
|
-
.type('4');
|
682
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
683
|
-
.type('Response')
|
684
|
-
.should('have.value', 'Response');
|
685
|
-
shortTextResponsePage.steps.expandAdditonalSettings();
|
686
|
-
shortTextResponsePage.steps.setMaximumCheckAnswerAttempts(2);
|
687
|
-
shortTextResponsePage.steps.switchToPreviewTab();
|
688
|
-
});
|
689
|
-
|
690
|
-
it('When the user has not set any response then on clicking on the Check Answer button, icons should not be displayed beside both empty response, Correct/Incorrect label or border should not be displayed and \'Correct answer\' container should not be displayed below the question', () => {
|
691
|
-
shortTextResponsePage.previewTabResponseField()
|
692
|
-
.should('have.value', '');
|
693
|
-
shortTextResponsePage.checkAnswerButton()
|
694
|
-
.click();
|
695
|
-
shortTextResponsePage.correctIcon()
|
696
|
-
.should('not.exist');
|
697
|
-
shortTextResponsePage.incorrectIcon()
|
698
|
-
.should('not.exist');
|
699
|
-
shortTextResponsePage.correctIncorectAnswerLabel()
|
700
|
-
.should('not.exist');
|
701
|
-
shortTextResponsePage.correctIncorrectAnswerBorder()
|
702
|
-
.should('not.exist');
|
703
|
-
shortTextResponsePage.previewTabCorrectAnswerContainer()
|
704
|
-
.should('not.exist');
|
705
|
-
});
|
706
|
-
|
707
|
-
it('When the user has added correct response then on clicking on the Check Answer button, green checkmark icon should be displayed, Correct/Incorrect label or border should not be displayed and \'Correct answer\' container should not be displayed below the question', () => {
|
708
|
-
shortTextResponsePage.previewTabResponseField()
|
709
|
-
.clear()
|
710
|
-
.type('Response')
|
711
|
-
.should('have.value', 'Response');
|
712
|
-
shortTextResponsePage.checkAnswerButton()
|
713
|
-
.click();
|
714
|
-
shortTextResponsePage.steps.verifyCorrectOptionCheckmarkIcon()
|
715
|
-
shortTextResponsePage.correctIncorectAnswerLabel()
|
716
|
-
.should('not.exist');
|
717
|
-
shortTextResponsePage.correctIncorrectAnswerBorder()
|
718
|
-
.should('not.exist');
|
719
|
-
shortTextResponsePage.previewTabCorrectAnswerContainer()
|
720
|
-
.should('not.exist');
|
721
|
-
});
|
722
|
-
|
723
|
-
it('When the user has added incorrect response then on clicking on the Check Answer button, red crossmark icon should be displayed, Incorrect label or border should not be displayed and \'Correct answer\' container should not be displayed below the question', () => {
|
724
|
-
shortTextResponsePage.previewTabResponseField()
|
725
|
-
.clear()
|
726
|
-
.type('Incorrect Response')
|
727
|
-
.should('have.value', 'Incorrect Response');
|
728
|
-
shortTextResponsePage.checkAnswerButton()
|
729
|
-
.click();
|
730
|
-
shortTextResponsePage.steps.verifyIncorrectOptionCrossmarkIcon()
|
731
|
-
shortTextResponsePage.correctIncorectAnswerLabel()
|
732
|
-
.should('not.exist');
|
733
|
-
shortTextResponsePage.correctIncorrectAnswerBorder()
|
734
|
-
.should('not.exist');
|
735
|
-
shortTextResponsePage.previewTabCorrectAnswerContainer()
|
736
|
-
.should('not.exist');
|
737
|
-
});
|
738
|
-
|
739
|
-
it('The \'Check Answer\' button should become disabled once user has reached maximum check answer attempts', () => {
|
740
|
-
shortTextResponsePage.checkAnswerButton()
|
741
|
-
.should('be.disabled');
|
742
|
-
});
|
743
|
-
|
744
|
-
it('CSS of disabled \'Check Answer\' button', { tags: 'css' }, () => {
|
745
|
-
shortTextResponsePage.checkAnswerButton()
|
746
|
-
.verifyCSS(css.color.primaryBtnDisabled, css.fontSize.default, css.fontWeight.regular);
|
747
|
-
});
|
748
|
-
|
749
|
-
it('Accessibility of disabled Check Answer button', { tags: 'a11y' }, () => {
|
750
|
-
cy.checkAccessibility(shortTextResponsePage.checkAnswerButton());
|
751
|
-
});
|
752
|
-
|
753
|
-
it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
|
754
|
-
cy.log('Pre step: Switching to Edit tab')
|
755
|
-
shortTextResponsePage.steps.switchToEditTab();
|
756
|
-
shortTextResponsePage.maximumCheckAnswerAttemptsInputField()
|
757
|
-
.clear()
|
758
|
-
.type(1)
|
759
|
-
.should('have.value', '1');
|
760
|
-
cy.log('Switching to Preview tab');
|
761
|
-
shortTextResponsePage.steps.switchToPreviewTab();
|
762
|
-
shortTextResponsePage.checkAnswerButton()
|
763
|
-
.should('be.enabled');
|
764
|
-
shortTextResponsePage.previewTabResponseField()
|
765
|
-
.type('Response');
|
766
|
-
shortTextResponsePage.checkAnswerButton()
|
767
|
-
.click()
|
768
|
-
.should('be.disabled');
|
769
|
-
});
|
770
|
-
|
771
|
-
it('When the \'Maximum check answer attempts\' input field has value \'0\' and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
|
772
|
-
shortTextResponsePage.steps.switchToEditTab();
|
773
|
-
shortTextResponsePage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
774
|
-
shortTextResponsePage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
|
775
|
-
cy.log('Switching to Preview tab');
|
776
|
-
shortTextResponsePage.steps.switchToPreviewTab();
|
777
|
-
shortTextResponsePage.checkAnswerButton()
|
778
|
-
.should('be.enabled');
|
779
|
-
shortTextResponsePage.previewTabResponseField()
|
780
|
-
.type('Incorrect Response');
|
781
|
-
cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
|
782
|
-
shortTextResponsePage.checkAnswerButton()
|
783
|
-
.click();
|
784
|
-
shortTextResponsePage.checkAnswerButton()
|
785
|
-
.should('be.enabled');
|
786
|
-
shortTextResponsePage.steps.verifyIncorrectOptionCrossmarkIcon();
|
787
|
-
shortTextResponsePage.correctIncorectAnswerLabel()
|
788
|
-
.should('not.exist');
|
789
|
-
shortTextResponsePage.correctIncorrectAnswerBorder()
|
790
|
-
.should('not.exist');
|
791
|
-
shortTextResponsePage.previewTabCorrectAnswerContainer()
|
792
|
-
.should('not.exist');
|
793
|
-
cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding different response and checking answer again')
|
794
|
-
shortTextResponsePage.previewTabResponseField()
|
795
|
-
.clear()
|
796
|
-
.type('Response');
|
797
|
-
shortTextResponsePage.checkAnswerButton()
|
798
|
-
.click();
|
799
|
-
shortTextResponsePage.steps.verifyCorrectOptionCheckmarkIcon();
|
800
|
-
shortTextResponsePage.correctIncorectAnswerLabel()
|
801
|
-
.should('not.exist');
|
802
|
-
shortTextResponsePage.correctIncorrectAnswerBorder()
|
803
|
-
.should('not.exist');
|
804
|
-
shortTextResponsePage.previewTabCorrectAnswerContainer()
|
805
|
-
.should('not.exist');
|
806
|
-
shortTextResponsePage.checkAnswerButton()
|
807
|
-
.should('be.enabled');
|
808
|
-
});
|
809
|
-
|
810
|
-
it('When the \'Maximum check answer attempts\' input field is empty and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
|
811
|
-
cy.log('Pre step: Switching to Edit tab')
|
812
|
-
shortTextResponsePage.steps.switchToEditTab();
|
813
|
-
shortTextResponsePage.maximumCheckAnswerAttemptsInputField()
|
814
|
-
.clear()
|
815
|
-
.should('have.value', '');
|
816
|
-
cy.log('Switching to Preview tab');
|
817
|
-
shortTextResponsePage.steps.switchToPreviewTab();
|
818
|
-
shortTextResponsePage.checkAnswerButton()
|
819
|
-
.should('be.enabled');
|
820
|
-
shortTextResponsePage.previewTabResponseField()
|
821
|
-
.type('Incorrect Response');
|
822
|
-
cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
|
823
|
-
shortTextResponsePage.checkAnswerButton()
|
824
|
-
.click();
|
825
|
-
shortTextResponsePage.checkAnswerButton()
|
826
|
-
.should('be.enabled');
|
827
|
-
shortTextResponsePage.steps.verifyIncorrectOptionCrossmarkIcon();
|
828
|
-
shortTextResponsePage.correctIncorectAnswerLabel()
|
829
|
-
.should('not.exist');
|
830
|
-
shortTextResponsePage.correctIncorrectAnswerBorder()
|
831
|
-
.should('not.exist');
|
832
|
-
shortTextResponsePage.previewTabCorrectAnswerContainer()
|
833
|
-
.should('not.exist');
|
834
|
-
cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding different response and checking answer again')
|
835
|
-
shortTextResponsePage.previewTabResponseField()
|
836
|
-
.clear()
|
837
|
-
.type('Response');
|
838
|
-
shortTextResponsePage.checkAnswerButton()
|
839
|
-
.click();
|
840
|
-
shortTextResponsePage.steps.verifyCorrectOptionCheckmarkIcon();
|
841
|
-
shortTextResponsePage.correctIncorectAnswerLabel()
|
842
|
-
.should('not.exist');
|
843
|
-
shortTextResponsePage.correctIncorrectAnswerBorder()
|
844
|
-
.should('not.exist');
|
845
|
-
shortTextResponsePage.previewTabCorrectAnswerContainer()
|
846
|
-
.should('not.exist');
|
847
|
-
shortTextResponsePage.checkAnswerButton()
|
848
|
-
.should('be.enabled');
|
849
|
-
});
|
850
|
-
});
|
851
|
-
|
852
|
-
describe('Additional Settings: Details section', () => {
|
853
|
-
abortEarlySetup();
|
854
|
-
before(() => {
|
855
|
-
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
856
|
-
shortTextResponsePage.steps.expandAdditonalSettings();
|
857
|
-
});
|
858
|
-
|
859
|
-
shortTextResponsePage.tests.verifyDetailsSection();
|
860
|
-
});
|
861
376
|
});
|