itemengine-cypress-automation 1.0.31 → 1.0.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAdditionalSettings.js +1 -415
  2. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAdditionalSettingsBasic.js +423 -0
  3. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAllOrNothingScoring.js +48 -0
  4. package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownAutoScoredScoring.js → fillInTheGapsDropdownAllOrNothingScoringWithAlternateAnswer.js} +1 -37
  5. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialDifferentWeights.js +59 -0
  6. package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownScoringPartialDifferentWeights.js → fillInTheGapsDropdownPartialDifferentWeightsWithAlternateAnswer.js} +1 -47
  7. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialEqualWeights.js +1 -63
  8. package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialEqualWeightsWithAlternateAnswer.js +73 -0
  9. package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsAnswerNumerationAndResponseOptionPlacement.js +196 -0
  10. package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsBasic.js +210 -0
  11. package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsStemAndResponseColumnHeader.js +206 -0
  12. package/cypress/e2e/ILC/ListMatching/listMatchingAlternateAnswer.js +193 -0
  13. package/cypress/e2e/ILC/ListMatching/listMatchingClickAndDrop.js +644 -0
  14. package/cypress/e2e/ILC/ListMatching/listMatchingEditTabScoringTypes.js +105 -0
  15. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsAllOrNothingScoring.js +117 -0
  16. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsAllOrNothingScoringWithAlternateAnswer.js +30 -0
  17. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsManualAndNonScoredScoring.js +49 -0
  18. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialDifferentScoringWithAlternateTab.js +36 -0
  19. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialDifferentScorings.js +49 -0
  20. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialEqualWeightsScoring.js +48 -0
  21. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialEqualWeightsScoringWithAlternateTab.js +36 -0
  22. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.js +207 -0
  23. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesEditTab.js +139 -0
  24. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesPreviewTab.js +227 -0
  25. package/cypress/e2e/ILC/ListMatching/listMatchingHeaderSection.js +95 -0
  26. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.js +246 -0
  27. package/cypress/e2e/ILC/ListMatching/listMatchingScoringSectionBasic.js +21 -0
  28. package/cypress/e2e/ILC/ListMatching/listMatchingSetCorrectAnswerSectionBasic.js +40 -0
  29. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsAllOrNothingScoring.js +113 -0
  30. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsAllOrNothingScoringWithAlternateAnswer.js +30 -0
  31. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsManualAndNonScoredScoring.js +48 -0
  32. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialDIfferentScoring.js +49 -0
  33. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialDifferentScoringWithAlternateAnswer.js +36 -0
  34. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialEqualScoring.js +48 -0
  35. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialEqualScoringWithAlternateAnswer.js +35 -0
  36. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSection.js +233 -0
  37. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesEditTab.js +113 -0
  38. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.js +185 -0
  39. package/cypress/e2e/ILC/ListMatching/listMatchingSwitchingCases.js +47 -0
  40. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsAnswerNumerationAndOptionLabel.js +295 -0
  41. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsBasic.js +300 -0
  42. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsOptionStyleDropdown.js +302 -0
  43. package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsSetPointsPopup.js +273 -0
  44. package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoring.js +178 -0
  45. package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoringWithAlternateAnswer.js +712 -0
  46. package/cypress/e2e/ILC/ListOrdering/listOrderingEditTabBasicSection.js +316 -0
  47. package/cypress/e2e/ILC/ListOrdering/listOrderingEditTabScoringSection.js +256 -0
  48. package/cypress/e2e/ILC/ListOrdering/listOrderingHeaderSection.js +83 -0
  49. package/cypress/e2e/ILC/ListOrdering/listOrderingManuallyAndNonScoredScoring.js +160 -0
  50. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoring.js +191 -0
  51. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoringWithAlternateAnswer.js +895 -0
  52. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoring.js +191 -0
  53. package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoringWithAlternateAnswer.js +807 -0
  54. package/cypress/e2e/ILC/ListOrdering/listOrderingSetCorrectAnswerCheckboxes.js +208 -0
  55. package/cypress/e2e/ILC/ListOrdering/listOrderingSetCorrectAnswerSection.js +172 -0
  56. package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettings.js +820 -0
  57. package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +936 -0
  58. package/cypress/e2e/ILC/ListSorting/listSortingClickAndDrop.js +456 -0
  59. package/cypress/e2e/ILC/ListSorting/listSortingEditTabBasicSection.js +440 -0
  60. package/cypress/e2e/ILC/ListSorting/listSortingEditTabScoringSection.js +259 -0
  61. package/cypress/e2e/ILC/ListSorting/listSortingHeaderSection.js +89 -0
  62. package/cypress/e2e/ILC/ListSorting/listSortingManuallyAndNonScoredScoring.js +171 -0
  63. package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoring.js +1150 -0
  64. package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoring.js +1055 -0
  65. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.js +263 -0
  66. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerSection.js +168 -0
  67. package/package.json +1 -1
@@ -1,25 +1,14 @@
1
- import { commonComponents } from "../../../pages/components";
2
1
  import { fillInTheGapsDropdownPage } from "../../../pages/fillInTheGapsDropdownPage";
3
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
3
  const css = Cypress.env('css');
5
4
 
6
5
  let optionsForResponse1 = ['changing', 'progressively', 'healthy', 'new'];
7
- let optionsForResponse2 = ['increasingly', 'decreasingly', 'extensively', 'exclusively'];
8
6
 
9
- describe('Fill In the Gaps Additional settings and Responses accordion', () => {
7
+ describe('Fill In the Gaps - Dropdown: Additional settings - Advanced settings for all response areas and Response accordion', () => {
10
8
  before(() => {
11
9
  cy.loginAs('admin');
12
10
  });
13
11
 
14
- describe('Additional Settings accordion', () => {
15
- abortEarlySetup();
16
- before(() => {
17
- fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
18
- });
19
-
20
- fillInTheGapsDropdownPage.tests.verifyAdditonalSettingsAccordionProperties();
21
- });
22
-
23
12
  describe('Additional Settings: Advanced settings for all response areas', () => {
24
13
  abortEarlySetup();
25
14
  before(() => {
@@ -758,407 +747,4 @@ describe('Fill In the Gaps Additional settings and Responses accordion', () => {
758
747
  .should('have.attr', 'width', '400px');
759
748
  });
760
749
  });
761
-
762
- describe('Additional Settings: Answer numeration (only while grading) dropdown', () => {
763
- const dropdownOptions = ['Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
764
- const numbers = ['1', '2', '3', '4'];
765
- const lowercase = ['a', 'b', 'c', 'd'];
766
- const uppercase = ['A', 'B', 'C', 'D'];
767
- abortEarlySetup();
768
- before(() => {
769
- fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
770
- fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
771
- fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
772
- fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
773
- fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new');
774
- fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'exclusively');
775
- fillInTheGapsDropdownPage.steps.allotPoints(20);
776
- fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
777
- fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
778
- .click();
779
- });
780
-
781
- fillInTheGapsDropdownPage.tests.verifyAnswerNumerationContents();
782
-
783
- //Answer numeration cases for Edit tab
784
- it(`When the user selects any option from the Answer numeration dropdown then it should not affect the Options for response numeration as well as set correct answer response dropdown`, () => {
785
- cy.log('Selecting an option from the dropdown')
786
- fillInTheGapsDropdownPage.steps.selectAnswerNumerationDropdownOption('Lowercase alphabet')
787
- cy.log('The numerical option numeration for the Options for response fields should not be affected by the Answer numeration dropdown')
788
- fillInTheGapsDropdownPage.optionsSectionWrapper()
789
- .each(($el) => {
790
- cy.wrap($el)
791
- .within(() => {
792
- fillInTheGapsDropdownPage.optionWrapper()
793
- .each(($el, index) => {
794
- cy.wrap($el)
795
- .within(() => {
796
- fillInTheGapsDropdownPage.optionNumeration()
797
- .should('have.text', numbers[index]);
798
- });
799
- });
800
- });
801
- });
802
- cy.log('The option numeration should not be displayed in the set correct answer section')
803
- fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
804
- .each(($el, index) => {
805
- cy.wrap($el)
806
- .contains(uppercase[index])
807
- .should('not.exist');
808
- });
809
- });
810
-
811
- //Answer numeration cases for preview tab
812
- dropdownOptions.forEach((option) => {
813
- it(`When the user selects ${option} option from the Answer numeration dropdown then it should not be displayed in the Preview tab response dropdown`, () => {
814
- fillInTheGapsDropdownPage.answerNumerationDropdown()
815
- .click();
816
- fillInTheGapsDropdownPage.answerNumerationDropdownListOptions(option)
817
- .click();
818
- fillInTheGapsDropdownPage.answerNumerationDropdown()
819
- .verifyInnerText(`${option}`);
820
- fillInTheGapsDropdownPage.steps.switchToPreviewTab()
821
- fillInTheGapsDropdownPage.steps.verifyAnswerNumerationShouldNotExistInPreviewTabResponseDropdown()
822
- });
823
-
824
- it(`When the user clicks on Show correct answer checkbox then ${option} numeration should be displayed in the Preview tab response dropdown and the correct answer container`, () => {
825
- fillInTheGapsDropdownPage.showCorrectAnswerCheckbox()
826
- .click()
827
- .should('be.checked');
828
- cy.log('Checking answer numeration for response dropdown')
829
- fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
830
- .each(($el, index) => {
831
- cy.wrap($el)
832
- .within(() => {
833
- switch (option) {
834
- case 'Numerical':
835
- fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
836
- .should('have.text', numbers[index])
837
- .should('be.visible');
838
- break;
839
- case 'Uppercase alphabet':
840
- fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
841
- .should('have.text', uppercase[index])
842
- .should('be.visible');
843
- break;
844
- case 'Lowercase alphabet':
845
- fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
846
- .should('have.text', lowercase[index])
847
- .should('be.visible');
848
- break;
849
- default:
850
- throw new Error('Invalid numeration option');
851
- }
852
- });
853
- });
854
- cy.log('Checking the answer numeration should be displayed in the correct answer container')
855
- fillInTheGapsDropdownPage.previewTabCorrectAnswerResponseWrapper()
856
- .each(($el, index) => {
857
- cy.wrap($el)
858
- .parents('.response-dropdown-wrapper')
859
- .within(() => {
860
- switch (option) {
861
- case 'Numerical':
862
- fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
863
- .should('have.text', numbers[index])
864
- .should('be.visible');
865
- break;
866
- case 'Uppercase alphabet':
867
- fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
868
- .should('have.text', uppercase[index])
869
- .should('be.visible');
870
- break;
871
- case 'Lowercase alphabet':
872
- fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
873
- .should('have.text', lowercase[index])
874
- .should('be.visible');
875
- break;
876
- default:
877
- throw new Error('Invalid numeration option');
878
- }
879
- });
880
- });
881
- });
882
-
883
- it('CSS of option numeration in response dropdown and correct answer container', { tags: 'css' }, () => {
884
- cy.log('CSS of Response dropdown numeration')
885
- fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
886
- .eq(0)
887
- .within(() => {
888
- fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
889
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
890
- });
891
- cy.log('CSS of Correct answer container dropdown numeration')
892
- fillInTheGapsDropdownPage.previewTabCorrectAnswerResponseWrapper()
893
- .eq(0)
894
- .parents('.response-dropdown-wrapper')
895
- .within(() => {
896
- fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
897
- .eq(0)
898
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
899
- });
900
- });
901
-
902
- it('Accessibility of option numeration in response dropdown and correct answer container', { tags: 'a11y' }, () => {
903
- cy.log('Accessibility of Response dropdown numeration')
904
- cy.checkAccessibility(fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper());
905
- cy.log('Accessibility of Correct answer container dropdown numeration')
906
- cy.checkAccessibility(fillInTheGapsDropdownPage.previewTabCorrectAnswerResponseWrapper().parents('.response-dropdown-wrapper'));
907
- });
908
-
909
- it(`When user clicks on Check answer button then ${option} numeration should not be displayed in the preview tab Response dropdown`, () => {
910
- cy.log('Pre step: Unchecking the show correct answer checkbox')
911
- fillInTheGapsDropdownPage.showCorrectAnswerCheckbox()
912
- .click()
913
- .should('not.be.checked');
914
- fillInTheGapsDropdownPage.checkAnswerButton()
915
- .click();
916
- fillInTheGapsDropdownPage.steps.verifyAnswerNumerationShouldNotExistInPreviewTabResponseDropdown()
917
- cy.log('Post step: Swicthing to Edit tab')
918
- fillInTheGapsDropdownPage.steps.switchToEditTab()
919
- });
920
- });
921
-
922
- //TODO: We have not checked the Response numeration in Grading view
923
- });
924
-
925
- describe('Additional Settings: Font Size dropdown', () => {
926
- abortEarlySetup();
927
- before(() => {
928
- cy.log('Navigating to fill in the gaps - dropdown type, adding question instructions and options, alloting points and expanding additional settings accordion')
929
- fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
930
- fillInTheGapsDropdownPage.questionInstructionsInputField()
931
- .type('Question Instructions');
932
- fillInTheGapsDropdownPage.pointsInputField()
933
- .type('4');
934
- fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
935
- fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new')
936
- fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
937
- });
938
-
939
- fillInTheGapsDropdownPage.tests.verifyFontSizeSectionContents();
940
-
941
- const fontsizes = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
942
- const font = ['16px', '12px', '14px', '17px', '20px', '24px'];
943
- fontsizes.forEach((option, count) => {
944
- 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`, () => {
945
- fillInTheGapsDropdownPage.fontSizeDropdown()
946
- .click();
947
- fillInTheGapsDropdownPage.fontSizeListOptions(count)
948
- .click();
949
- fillInTheGapsDropdownPage.fontSizeDropdown()
950
- .verifyInnerText(`${option}`);
951
- cy.log('Checking correct answer section font size')
952
- fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
953
- .should('have.css', 'font-size', font[count])
954
- fillInTheGapsDropdownPage.responseDropdownSetCorrectAnswerSection()
955
- .click();
956
- fillInTheGapsDropdownPage.responseDropdownOptions()
957
- .each(($el) => {
958
- cy.wrap($el)
959
- .find('span')
960
- .should('have.css', 'font-size', font[count]);
961
- });
962
- cy.log('Closing the dropdown')
963
- cy.get('body')
964
- .click();
965
- cy.log('Switching to Preview tab')
966
- fillInTheGapsDropdownPage.steps.switchToPreviewTab();
967
- cy.log('Checking Preview section font size')
968
- fillInTheGapsDropdownPage.questionInstructionsText()
969
- .should('have.css', 'font-size', font[count]);
970
- fillInTheGapsDropdownPage.previewTabResponseDropdown()
971
- .click();
972
- cy.log('Checking font size of options')
973
- fillInTheGapsDropdownPage.responseDropdownOptions()
974
- .each(($el) => {
975
- cy.wrap($el)
976
- .find('span')
977
- .should('have.css', 'font-size', font[count]);
978
- });
979
- cy.log('selecting an option to collapse the response dropdown')
980
- fillInTheGapsDropdownPage.steps.selectOptionFromResponseDropdown('new');
981
- cy.log('Checking font size of response dropdown')
982
- fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
983
- .should('have.css', 'font-size', font[count]);
984
- fillInTheGapsDropdownPage.previewTabQuestionContainer()
985
- .should('have.css', 'font-size', font[count]);
986
- cy.log('Post step: Switch to Edit tab')
987
- fillInTheGapsDropdownPage.steps.switchToEditTab();
988
- });
989
- });
990
- });
991
-
992
- describe('Additional Settings: Check Answer', () => {
993
- abortEarlySetup();
994
- before(() => {
995
- fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
996
- fillInTheGapsDropdownPage.questionInstructionsInputField()
997
- .type('Question Instructions');
998
- fillInTheGapsDropdownPage.pointsInputField()
999
- .type('4');
1000
- fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
1001
- fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new')
1002
- fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
1003
- });
1004
-
1005
- fillInTheGapsDropdownPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
1006
- });
1007
-
1008
- describe('Additional Settings: Check Answer - Functionality', () => {
1009
- abortEarlySetup();
1010
- before(() => {
1011
- fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
1012
- fillInTheGapsDropdownPage.questionInstructionsInputField()
1013
- .type('Question Instructions');
1014
- fillInTheGapsDropdownPage.pointsInputField()
1015
- .type('6');
1016
- fillInTheGapsDropdownPage.questionInputField()
1017
- .click();
1018
- fillInTheGapsDropdownPage.ckEditorAddResponseButton()
1019
- .click();
1020
- fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
1021
- fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new')
1022
- fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
1023
- fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'extensively')
1024
- fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
1025
- fillInTheGapsDropdownPage.steps.setMaximumCheckAnswerAttempts(2);
1026
- fillInTheGapsDropdownPage.steps.switchToPreviewTab();
1027
- });
1028
-
1029
- it('When the user has not set any responses then on clicking on the Check Answer button icons should not be displayed beside both empty responses, label should not be displayed below the box', () => {
1030
- fillInTheGapsDropdownPage.previewTabResponseDropdown()
1031
- .each(($el) => {
1032
- cy.wrap($el)
1033
- .should('not.have.text')
1034
- });
1035
- fillInTheGapsDropdownPage.checkAnswerButton()
1036
- .click();
1037
- fillInTheGapsDropdownPage.correctIcon()
1038
- .should('not.exist');
1039
- fillInTheGapsDropdownPage.incorrectIcon()
1040
- .should('not.exist');
1041
- fillInTheGapsDropdownPage.correctIncorectAnswerLabel()
1042
- .should('not.exist');
1043
- fillInTheGapsDropdownPage.previewTabCorrectAnswerContainer()
1044
- .should('not.exist')
1045
- });
1046
-
1047
- it('When the user has added correct response for one option then on clicking on the Check Answer button, green checkmark icon should be displayed besides the correct response, red crossmark should not be displayed beside empty response and \'Incorrect Answer\' label should be displayed below the box', () => {
1048
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'new');
1049
- fillInTheGapsDropdownPage.checkAnswerButton()
1050
- .click();
1051
- fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(0);
1052
- fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotVisible(1);
1053
- fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
1054
- fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
1055
- });
1056
-
1057
- it('When the user has added both correct responses then on clicking on the Check Answer button, green checkmark icon should be displayed besides the responses and \'Correct Answer\' label should be displayed below the box', () => {
1058
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
1059
- fillInTheGapsDropdownPage.checkAnswerButton()
1060
- .click();
1061
- fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(0)
1062
- fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(1)
1063
- fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Correct')
1064
- fillInTheGapsDropdownPage.steps.verifyCorrectAttemptBorder()
1065
- });
1066
-
1067
-
1068
- fillInTheGapsDropdownPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y()
1069
-
1070
- it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
1071
- cy.log('Pre step: Switching to Edit tab')
1072
- fillInTheGapsDropdownPage.steps.switchToEditTab();
1073
- fillInTheGapsDropdownPage.maximumCheckAnswerAttemptsInputField()
1074
- .clear()
1075
- .type(1)
1076
- .should('have.value', '1');
1077
- cy.log('Switching to Preview tab');
1078
- fillInTheGapsDropdownPage.steps.switchToPreviewTab();
1079
- fillInTheGapsDropdownPage.checkAnswerButton()
1080
- .should('be.enabled');
1081
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'new');
1082
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
1083
- fillInTheGapsDropdownPage.checkAnswerButton()
1084
- .click()
1085
- .should('be.disabled');
1086
- });
1087
-
1088
- 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', () => {
1089
- fillInTheGapsDropdownPage.steps.switchToEditTab();
1090
- fillInTheGapsDropdownPage.steps.clearMaximumCheckAnswerAttemptsInputField();
1091
- fillInTheGapsDropdownPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
1092
- cy.log('Switching to Preview tab')
1093
- fillInTheGapsDropdownPage.steps.switchToPreviewTab();
1094
- fillInTheGapsDropdownPage.checkAnswerButton()
1095
- .should('be.enabled');
1096
- cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
1097
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'changing');
1098
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'decreasingly');
1099
- fillInTheGapsDropdownPage.checkAnswerButton()
1100
- .click();
1101
- fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
1102
- fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
1103
- fillInTheGapsDropdownPage.checkAnswerButton()
1104
- .should('be.enabled');
1105
- fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
1106
- fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
1107
- cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
1108
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'healthy');
1109
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
1110
- fillInTheGapsDropdownPage.checkAnswerButton()
1111
- .click();
1112
- fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
1113
- fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(1)
1114
- fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
1115
- fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
1116
- fillInTheGapsDropdownPage.checkAnswerButton()
1117
- .should('be.enabled');
1118
- });
1119
-
1120
- 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', () => {
1121
- cy.log('Pre step: Switching to Edit tab')
1122
- fillInTheGapsDropdownPage.steps.switchToEditTab();
1123
- fillInTheGapsDropdownPage.maximumCheckAnswerAttemptsInputField()
1124
- .clear()
1125
- .should('have.value', '');
1126
- cy.log('Switching to Preview tab');
1127
- fillInTheGapsDropdownPage.steps.switchToPreviewTab();
1128
- fillInTheGapsDropdownPage.checkAnswerButton()
1129
- .should('be.enabled');
1130
- cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
1131
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'changing');
1132
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'decreasingly');
1133
- fillInTheGapsDropdownPage.checkAnswerButton()
1134
- .click();
1135
- fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
1136
- fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
1137
- fillInTheGapsDropdownPage.checkAnswerButton()
1138
- .should('be.enabled');
1139
- fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
1140
- fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
1141
- cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
1142
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'healthy');
1143
- fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
1144
- fillInTheGapsDropdownPage.checkAnswerButton()
1145
- .click();
1146
- fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
1147
- fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(1)
1148
- fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
1149
- fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
1150
- fillInTheGapsDropdownPage.checkAnswerButton()
1151
- .should('be.enabled');
1152
- });
1153
- });
1154
-
1155
- describe('Additional Settings: Details section', () => {
1156
- abortEarlySetup();
1157
- before(() => {
1158
- fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
1159
- fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
1160
- });
1161
-
1162
- fillInTheGapsDropdownPage.tests.verifyDetailsSection();
1163
- });
1164
750
  });