itemengine-cypress-automation 1.0.31 → 1.0.32
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAdditionalSettings.js +1 -415
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAdditionalSettingsBasic.js +423 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAllOrNothingScoring.js +48 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownAutoScoredScoring.js → fillInTheGapsDropdownAllOrNothingScoringWithAlternateAnswer.js} +1 -37
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialDifferentWeights.js +59 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownScoringPartialDifferentWeights.js → fillInTheGapsDropdownPartialDifferentWeightsWithAlternateAnswer.js} +1 -47
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialEqualWeights.js +1 -63
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialEqualWeightsWithAlternateAnswer.js +73 -0
- 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
|
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
|
});
|
@@ -0,0 +1,423 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
let optionsForResponse1 = ['changing', 'progressively', 'healthy', 'new'];
|
5
|
+
let optionsForResponse2 = ['increasingly', 'decreasingly', 'extensively', 'exclusively'];
|
6
|
+
|
7
|
+
describe('Fill In the Gaps - Dropdown - Additional settings basic', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Additional Settings accordion', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
16
|
+
});
|
17
|
+
|
18
|
+
fillInTheGapsDropdownPage.tests.verifyAdditonalSettingsAccordionProperties();
|
19
|
+
});
|
20
|
+
|
21
|
+
describe('Additional Settings: Answer numeration (only while grading) dropdown', () => {
|
22
|
+
const dropdownOptions = ['Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
|
23
|
+
const numbers = ['1', '2', '3', '4'];
|
24
|
+
const lowercase = ['a', 'b', 'c', 'd'];
|
25
|
+
const uppercase = ['A', 'B', 'C', 'D'];
|
26
|
+
abortEarlySetup();
|
27
|
+
before(() => {
|
28
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
29
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
30
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
31
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
32
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new');
|
33
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'exclusively');
|
34
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
35
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
36
|
+
fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
|
37
|
+
.click();
|
38
|
+
});
|
39
|
+
|
40
|
+
fillInTheGapsDropdownPage.tests.verifyAnswerNumerationContents();
|
41
|
+
|
42
|
+
//Answer numeration cases for Edit tab
|
43
|
+
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`, () => {
|
44
|
+
cy.log('Selecting an option from the dropdown')
|
45
|
+
fillInTheGapsDropdownPage.steps.selectAnswerNumerationDropdownOption('Lowercase alphabet')
|
46
|
+
cy.log('The numerical option numeration for the Options for response fields should not be affected by the Answer numeration dropdown')
|
47
|
+
fillInTheGapsDropdownPage.optionsSectionWrapper()
|
48
|
+
.each(($el) => {
|
49
|
+
cy.wrap($el)
|
50
|
+
.within(() => {
|
51
|
+
fillInTheGapsDropdownPage.optionWrapper()
|
52
|
+
.each(($el, index) => {
|
53
|
+
cy.wrap($el)
|
54
|
+
.within(() => {
|
55
|
+
fillInTheGapsDropdownPage.optionNumeration()
|
56
|
+
.should('have.text', numbers[index]);
|
57
|
+
});
|
58
|
+
});
|
59
|
+
});
|
60
|
+
});
|
61
|
+
cy.log('The option numeration should not be displayed in the set correct answer section')
|
62
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
63
|
+
.each(($el, index) => {
|
64
|
+
cy.wrap($el)
|
65
|
+
.contains(uppercase[index])
|
66
|
+
.should('not.exist');
|
67
|
+
});
|
68
|
+
});
|
69
|
+
|
70
|
+
//Answer numeration cases for preview tab
|
71
|
+
dropdownOptions.forEach((option) => {
|
72
|
+
it(`When the user selects ${option} option from the Answer numeration dropdown then it should not be displayed in the Preview tab response dropdown`, () => {
|
73
|
+
fillInTheGapsDropdownPage.answerNumerationDropdown()
|
74
|
+
.click();
|
75
|
+
fillInTheGapsDropdownPage.answerNumerationDropdownListOptions(option)
|
76
|
+
.click();
|
77
|
+
fillInTheGapsDropdownPage.answerNumerationDropdown()
|
78
|
+
.verifyInnerText(`${option}`);
|
79
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab()
|
80
|
+
fillInTheGapsDropdownPage.steps.verifyAnswerNumerationShouldNotExistInPreviewTabResponseDropdown()
|
81
|
+
});
|
82
|
+
|
83
|
+
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`, () => {
|
84
|
+
fillInTheGapsDropdownPage.showCorrectAnswerCheckbox()
|
85
|
+
.click()
|
86
|
+
.should('be.checked');
|
87
|
+
cy.log('Checking answer numeration for response dropdown')
|
88
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
89
|
+
.each(($el, index) => {
|
90
|
+
cy.wrap($el)
|
91
|
+
.within(() => {
|
92
|
+
switch (option) {
|
93
|
+
case 'Numerical':
|
94
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
95
|
+
.should('have.text', numbers[index])
|
96
|
+
.should('be.visible');
|
97
|
+
break;
|
98
|
+
case 'Uppercase alphabet':
|
99
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
100
|
+
.should('have.text', uppercase[index])
|
101
|
+
.should('be.visible');
|
102
|
+
break;
|
103
|
+
case 'Lowercase alphabet':
|
104
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
105
|
+
.should('have.text', lowercase[index])
|
106
|
+
.should('be.visible');
|
107
|
+
break;
|
108
|
+
default:
|
109
|
+
throw new Error('Invalid numeration option');
|
110
|
+
}
|
111
|
+
});
|
112
|
+
});
|
113
|
+
cy.log('Checking the answer numeration should be displayed in the correct answer container')
|
114
|
+
fillInTheGapsDropdownPage.previewTabCorrectAnswerResponseWrapper()
|
115
|
+
.each(($el, index) => {
|
116
|
+
cy.wrap($el)
|
117
|
+
.parents('.response-dropdown-wrapper')
|
118
|
+
.within(() => {
|
119
|
+
switch (option) {
|
120
|
+
case 'Numerical':
|
121
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
122
|
+
.should('have.text', numbers[index])
|
123
|
+
.should('be.visible');
|
124
|
+
break;
|
125
|
+
case 'Uppercase alphabet':
|
126
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
127
|
+
.should('have.text', uppercase[index])
|
128
|
+
.should('be.visible');
|
129
|
+
break;
|
130
|
+
case 'Lowercase alphabet':
|
131
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
132
|
+
.should('have.text', lowercase[index])
|
133
|
+
.should('be.visible');
|
134
|
+
break;
|
135
|
+
default:
|
136
|
+
throw new Error('Invalid numeration option');
|
137
|
+
}
|
138
|
+
});
|
139
|
+
});
|
140
|
+
});
|
141
|
+
|
142
|
+
it('CSS of option numeration in response dropdown and correct answer container', { tags: 'css' }, () => {
|
143
|
+
cy.log('CSS of Response dropdown numeration')
|
144
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
145
|
+
.eq(0)
|
146
|
+
.within(() => {
|
147
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
148
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
149
|
+
});
|
150
|
+
cy.log('CSS of Correct answer container dropdown numeration')
|
151
|
+
fillInTheGapsDropdownPage.previewTabCorrectAnswerResponseWrapper()
|
152
|
+
.eq(0)
|
153
|
+
.parents('.response-dropdown-wrapper')
|
154
|
+
.within(() => {
|
155
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
156
|
+
.eq(0)
|
157
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
158
|
+
});
|
159
|
+
});
|
160
|
+
|
161
|
+
it('Accessibility of option numeration in response dropdown and correct answer container', { tags: 'a11y' }, () => {
|
162
|
+
cy.log('Accessibility of Response dropdown numeration')
|
163
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper());
|
164
|
+
cy.log('Accessibility of Correct answer container dropdown numeration')
|
165
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.previewTabCorrectAnswerResponseWrapper().parents('.response-dropdown-wrapper'));
|
166
|
+
});
|
167
|
+
|
168
|
+
it(`When user clicks on Check answer button then ${option} numeration should not be displayed in the preview tab Response dropdown`, () => {
|
169
|
+
cy.log('Pre step: Unchecking the show correct answer checkbox')
|
170
|
+
fillInTheGapsDropdownPage.showCorrectAnswerCheckbox()
|
171
|
+
.click()
|
172
|
+
.should('not.be.checked');
|
173
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
174
|
+
.click();
|
175
|
+
fillInTheGapsDropdownPage.steps.verifyAnswerNumerationShouldNotExistInPreviewTabResponseDropdown()
|
176
|
+
cy.log('Post step: Swicthing to Edit tab')
|
177
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab()
|
178
|
+
});
|
179
|
+
});
|
180
|
+
|
181
|
+
//TODO: We have not checked the Response numeration in Grading view
|
182
|
+
});
|
183
|
+
|
184
|
+
describe('Additional Settings: Font Size dropdown', () => {
|
185
|
+
abortEarlySetup();
|
186
|
+
before(() => {
|
187
|
+
cy.log('Navigating to fill in the gaps - dropdown type, adding question instructions and options, alloting points and expanding additional settings accordion')
|
188
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
189
|
+
fillInTheGapsDropdownPage.questionInstructionsInputField()
|
190
|
+
.type('Question Instructions');
|
191
|
+
fillInTheGapsDropdownPage.pointsInputField()
|
192
|
+
.type('4');
|
193
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
194
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new')
|
195
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
196
|
+
});
|
197
|
+
|
198
|
+
fillInTheGapsDropdownPage.tests.verifyFontSizeSectionContents();
|
199
|
+
|
200
|
+
const fontsizes = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
|
201
|
+
const font = ['16px', '12px', '14px', '17px', '20px', '24px'];
|
202
|
+
fontsizes.forEach((option, count) => {
|
203
|
+
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`, () => {
|
204
|
+
fillInTheGapsDropdownPage.fontSizeDropdown()
|
205
|
+
.click();
|
206
|
+
fillInTheGapsDropdownPage.fontSizeListOptions(count)
|
207
|
+
.click();
|
208
|
+
fillInTheGapsDropdownPage.fontSizeDropdown()
|
209
|
+
.verifyInnerText(`${option}`);
|
210
|
+
cy.log('Checking correct answer section font size')
|
211
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
212
|
+
.should('have.css', 'font-size', font[count])
|
213
|
+
fillInTheGapsDropdownPage.responseDropdownSetCorrectAnswerSection()
|
214
|
+
.click();
|
215
|
+
fillInTheGapsDropdownPage.responseDropdownOptions()
|
216
|
+
.each(($el) => {
|
217
|
+
cy.wrap($el)
|
218
|
+
.find('span')
|
219
|
+
.should('have.css', 'font-size', font[count]);
|
220
|
+
});
|
221
|
+
cy.log('Closing the dropdown')
|
222
|
+
cy.get('body')
|
223
|
+
.click();
|
224
|
+
cy.log('Switching to Preview tab')
|
225
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
226
|
+
cy.log('Checking Preview section font size')
|
227
|
+
fillInTheGapsDropdownPage.questionInstructionsText()
|
228
|
+
.should('have.css', 'font-size', font[count]);
|
229
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdown()
|
230
|
+
.click();
|
231
|
+
cy.log('Checking font size of options')
|
232
|
+
fillInTheGapsDropdownPage.responseDropdownOptions()
|
233
|
+
.each(($el) => {
|
234
|
+
cy.wrap($el)
|
235
|
+
.find('span')
|
236
|
+
.should('have.css', 'font-size', font[count]);
|
237
|
+
});
|
238
|
+
cy.log('selecting an option to collapse the response dropdown')
|
239
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromResponseDropdown('new');
|
240
|
+
cy.log('Checking font size of response dropdown')
|
241
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
242
|
+
.should('have.css', 'font-size', font[count]);
|
243
|
+
fillInTheGapsDropdownPage.previewTabQuestionContainer()
|
244
|
+
.should('have.css', 'font-size', font[count]);
|
245
|
+
cy.log('Post step: Switch to Edit tab')
|
246
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
247
|
+
});
|
248
|
+
});
|
249
|
+
});
|
250
|
+
|
251
|
+
describe('Additional Settings: Check Answer', () => {
|
252
|
+
abortEarlySetup();
|
253
|
+
before(() => {
|
254
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
255
|
+
fillInTheGapsDropdownPage.questionInstructionsInputField()
|
256
|
+
.type('Question Instructions');
|
257
|
+
fillInTheGapsDropdownPage.pointsInputField()
|
258
|
+
.type('4');
|
259
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
260
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new')
|
261
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
262
|
+
});
|
263
|
+
|
264
|
+
fillInTheGapsDropdownPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
|
265
|
+
});
|
266
|
+
|
267
|
+
describe('Additional Settings: Check Answer - Functionality', () => {
|
268
|
+
abortEarlySetup();
|
269
|
+
before(() => {
|
270
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
271
|
+
fillInTheGapsDropdownPage.questionInstructionsInputField()
|
272
|
+
.type('Question Instructions');
|
273
|
+
fillInTheGapsDropdownPage.pointsInputField()
|
274
|
+
.type('6');
|
275
|
+
fillInTheGapsDropdownPage.questionInputField()
|
276
|
+
.click();
|
277
|
+
fillInTheGapsDropdownPage.ckEditorAddResponseButton()
|
278
|
+
.click();
|
279
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
280
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new')
|
281
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
282
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'extensively')
|
283
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
284
|
+
fillInTheGapsDropdownPage.steps.setMaximumCheckAnswerAttempts(2);
|
285
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
286
|
+
});
|
287
|
+
|
288
|
+
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', () => {
|
289
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdown()
|
290
|
+
.each(($el) => {
|
291
|
+
cy.wrap($el)
|
292
|
+
.should('not.have.text')
|
293
|
+
});
|
294
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
295
|
+
.click();
|
296
|
+
fillInTheGapsDropdownPage.correctIcon()
|
297
|
+
.should('not.exist');
|
298
|
+
fillInTheGapsDropdownPage.incorrectIcon()
|
299
|
+
.should('not.exist');
|
300
|
+
fillInTheGapsDropdownPage.correctIncorectAnswerLabel()
|
301
|
+
.should('not.exist');
|
302
|
+
fillInTheGapsDropdownPage.previewTabCorrectAnswerContainer()
|
303
|
+
.should('not.exist')
|
304
|
+
});
|
305
|
+
|
306
|
+
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', () => {
|
307
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'new');
|
308
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
309
|
+
.click();
|
310
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
311
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotVisible(1);
|
312
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
313
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
|
314
|
+
});
|
315
|
+
|
316
|
+
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', () => {
|
317
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
|
318
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
319
|
+
.click();
|
320
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(0)
|
321
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(1)
|
322
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Correct')
|
323
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAttemptBorder()
|
324
|
+
});
|
325
|
+
|
326
|
+
|
327
|
+
fillInTheGapsDropdownPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y()
|
328
|
+
|
329
|
+
it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
|
330
|
+
cy.log('Pre step: Switching to Edit tab')
|
331
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
332
|
+
fillInTheGapsDropdownPage.maximumCheckAnswerAttemptsInputField()
|
333
|
+
.clear()
|
334
|
+
.type(1)
|
335
|
+
.should('have.value', '1');
|
336
|
+
cy.log('Switching to Preview tab');
|
337
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
338
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
339
|
+
.should('be.enabled');
|
340
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'new');
|
341
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
|
342
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
343
|
+
.click()
|
344
|
+
.should('be.disabled');
|
345
|
+
});
|
346
|
+
|
347
|
+
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', () => {
|
348
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
349
|
+
fillInTheGapsDropdownPage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
350
|
+
fillInTheGapsDropdownPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
|
351
|
+
cy.log('Switching to Preview tab')
|
352
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
353
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
354
|
+
.should('be.enabled');
|
355
|
+
cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
|
356
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'changing');
|
357
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'decreasingly');
|
358
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
359
|
+
.click();
|
360
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
|
361
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
|
362
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
363
|
+
.should('be.enabled');
|
364
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
365
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
|
366
|
+
cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
|
367
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'healthy');
|
368
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
|
369
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
370
|
+
.click();
|
371
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
|
372
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(1)
|
373
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
374
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
|
375
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
376
|
+
.should('be.enabled');
|
377
|
+
});
|
378
|
+
|
379
|
+
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', () => {
|
380
|
+
cy.log('Pre step: Switching to Edit tab')
|
381
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
382
|
+
fillInTheGapsDropdownPage.maximumCheckAnswerAttemptsInputField()
|
383
|
+
.clear()
|
384
|
+
.should('have.value', '');
|
385
|
+
cy.log('Switching to Preview tab');
|
386
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
387
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
388
|
+
.should('be.enabled');
|
389
|
+
cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
|
390
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'changing');
|
391
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'decreasingly');
|
392
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
393
|
+
.click();
|
394
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
|
395
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
|
396
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
397
|
+
.should('be.enabled');
|
398
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
399
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
|
400
|
+
cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
|
401
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'healthy');
|
402
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
|
403
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
404
|
+
.click();
|
405
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
|
406
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(1)
|
407
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
408
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
|
409
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
410
|
+
.should('be.enabled');
|
411
|
+
});
|
412
|
+
});
|
413
|
+
|
414
|
+
describe('Additional Settings: Details section', () => {
|
415
|
+
abortEarlySetup();
|
416
|
+
before(() => {
|
417
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
418
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
419
|
+
});
|
420
|
+
|
421
|
+
fillInTheGapsDropdownPage.tests.verifyDetailsSection();
|
422
|
+
});
|
423
|
+
});
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage, fillInTheGapsScoring } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
|
5
|
+
let optionsForResponse1 = ['Correct answer 1', 'Alternate correct answer 1', 'Incorrect answer 1', 'Incorrect answer 2'];
|
6
|
+
let optionsForResponse2 = ['Correct answer 2', 'Alternate correct answer 2', 'Incorrect answer 1', 'Incorrect answer 2'];
|
7
|
+
|
8
|
+
describe('Create Item page - Fill in the Gaps - dropdown: Auto scored all or nothing scoring', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Show correct answer', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
17
|
+
cy.log('Adding a response token')
|
18
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
19
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
20
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
21
|
+
});
|
22
|
+
|
23
|
+
fillInTheGapsDropdownPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet();
|
24
|
+
|
25
|
+
fillInTheGapsScoring.tests.verifyShowCorrectAnswerBasicFunctionality('fill in the gaps - dropdown');
|
26
|
+
});
|
27
|
+
|
28
|
+
describe('Question Preview: AutoScored - All or Nothing', () => {
|
29
|
+
abortEarlySetup();
|
30
|
+
before(() => {
|
31
|
+
cy.log('Navigate to fill in the gaps - dropdown question type, fill the necessary details and points and switch to preview tab');
|
32
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
33
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
34
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
35
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
36
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
|
37
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
|
38
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
39
|
+
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
40
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
41
|
+
fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
|
42
|
+
.click();
|
43
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
44
|
+
});
|
45
|
+
|
46
|
+
fillInTheGapsScoring.tests.verifyAutoScoredAllOrNothingScoring('fill in the gaps - dropdown');
|
47
|
+
});
|
48
|
+
});
|
@@ -5,47 +5,11 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
5
5
|
let optionsForResponse1 = ['Correct answer 1', 'Alternate correct answer 1', 'Incorrect answer 1', 'Incorrect answer 2'];
|
6
6
|
let optionsForResponse2 = ['Correct answer 2', 'Alternate correct answer 2', 'Incorrect answer 1', 'Incorrect answer 2'];
|
7
7
|
|
8
|
-
describe('Create
|
8
|
+
describe('Create item page - Fill in the Gaps - dropdown: Auto scored all or nothing scoring with alternate answer', () => {
|
9
9
|
before(() => {
|
10
10
|
cy.loginAs('admin');
|
11
11
|
});
|
12
12
|
|
13
|
-
describe('Show correct answer', () => {
|
14
|
-
abortEarlySetup();
|
15
|
-
before(() => {
|
16
|
-
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
17
|
-
cy.log('Adding a response token')
|
18
|
-
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
19
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
20
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
21
|
-
});
|
22
|
-
|
23
|
-
fillInTheGapsDropdownPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet();
|
24
|
-
|
25
|
-
fillInTheGapsScoring.tests.verifyShowCorrectAnswerBasicFunctionality('fill in the gaps - dropdown');
|
26
|
-
});
|
27
|
-
|
28
|
-
describe('Question Preview: AutoScored - All or Nothing', () => {
|
29
|
-
abortEarlySetup();
|
30
|
-
before(() => {
|
31
|
-
cy.log('Navigate to fill in the gaps - dropdown question type, fill the necessary details and points and switch to preview tab');
|
32
|
-
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
33
|
-
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
34
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
35
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
36
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
|
37
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
|
38
|
-
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
39
|
-
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
40
|
-
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
41
|
-
fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
|
42
|
-
.click();
|
43
|
-
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
44
|
-
});
|
45
|
-
|
46
|
-
fillInTheGapsScoring.tests.verifyAutoScoredAllOrNothingScoring('fill in the gaps - dropdown');
|
47
|
-
});
|
48
|
-
|
49
13
|
describe('Question Preview: AutoScored - All or Nothing with alternate answer with \'Match from all responses property - \"false\"\'', () => {
|
50
14
|
abortEarlySetup();
|
51
15
|
before(() => {
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { fillInTheGapsScoring } from "../../../pages/fillInTheGapsScoring";
|
2
|
+
import { fillInTheGapsDropdownPage } from "../../../pages/fillInTheGapsDropdownPage";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
let optionsForResponse1 = ['Correct answer 1', 'Alternate correct answer 1', 'Incorrect answer 1', 'Incorrect answer 2'];
|
7
|
+
let optionsForResponse2 = ['Correct answer 2', 'Alternate correct answer 2', 'Incorrect answer 1', 'Incorrect answer 2'];
|
8
|
+
|
9
|
+
describe('Create Item page - Fill in the gaps - dropdown: Partial different weights scoring with alternate answer', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Question Preview: AutoScored - Partial different weights', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
cy.log('Navigate to Fill in the gaps - dropdown question type, fill the necessary details and points, uncheck round down score checkbox and switch to preview tab');
|
18
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
21
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
22
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
23
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
|
24
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
|
25
|
+
fillInTheGapsDropdownPage.partialDifferentWeightsCheckbox()
|
26
|
+
.click();
|
27
|
+
fillInTheGapsDropdownPage.steps.addPartialDifferentWeightsPoints([5.4, 4.8]);
|
28
|
+
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
29
|
+
fillInTheGapsDropdownPage.rounddownScoreCheckbox()
|
30
|
+
.click();
|
31
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
32
|
+
fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
|
33
|
+
.click();
|
34
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
35
|
+
});
|
36
|
+
|
37
|
+
fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsScoring('fill in the gaps - dropdown');
|
38
|
+
});
|
39
|
+
|
40
|
+
describe('Partial Different Weights: Round down score', () => {
|
41
|
+
abortEarlySetup();
|
42
|
+
before(() => {
|
43
|
+
cy.log('Add question instructions and options, set correct answers, select partial - different weights scoring and add points (in decimals) for correct answer options');
|
44
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown')
|
45
|
+
cy.barsPreLoaderWait();
|
46
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
47
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
48
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
49
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
|
50
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
|
51
|
+
fillInTheGapsDropdownPage.partialDifferentWeightsCheckbox()
|
52
|
+
.click();
|
53
|
+
fillInTheGapsDropdownPage.steps.addPartialDifferentWeightsPoints([1.36, 2.89]);
|
54
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
55
|
+
});
|
56
|
+
|
57
|
+
fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsRoundDownScore('fill in the gaps - dropdown');
|
58
|
+
});
|
59
|
+
});
|
@@ -6,37 +6,11 @@ const css = Cypress.env('css');
|
|
6
6
|
let optionsForResponse1 = ['Correct answer 1', 'Alternate correct answer 1', 'Incorrect answer 1', 'Incorrect answer 2'];
|
7
7
|
let optionsForResponse2 = ['Correct answer 2', 'Alternate correct answer 2', 'Incorrect answer 1', 'Incorrect answer 2'];
|
8
8
|
|
9
|
-
describe('Partial
|
9
|
+
describe('Create item page - Fill in the gaps - dropdown: Partial different weights scoring with alternate answer', () => {
|
10
10
|
before(() => {
|
11
11
|
cy.loginAs('admin');
|
12
12
|
});
|
13
13
|
|
14
|
-
describe('Question Preview: AutoScored - Partial different weights', () => {
|
15
|
-
abortEarlySetup();
|
16
|
-
before(() => {
|
17
|
-
cy.log('Navigate to Fill in the gaps - dropdown question type, fill the necessary details and points, uncheck round down score checkbox and switch to preview tab');
|
18
|
-
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
19
|
-
cy.barsPreLoaderWait();
|
20
|
-
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
21
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
22
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
23
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
|
24
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
|
25
|
-
fillInTheGapsDropdownPage.partialDifferentWeightsCheckbox()
|
26
|
-
.click();
|
27
|
-
fillInTheGapsDropdownPage.steps.addPartialDifferentWeightsPoints([5.4, 4.8]);
|
28
|
-
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
29
|
-
fillInTheGapsDropdownPage.rounddownScoreCheckbox()
|
30
|
-
.click();
|
31
|
-
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
32
|
-
fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
|
33
|
-
.click();
|
34
|
-
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
35
|
-
});
|
36
|
-
|
37
|
-
fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsScoring('fill in the gaps - dropdown');
|
38
|
-
});
|
39
|
-
|
40
14
|
describe('Question Preview: AutoScored - Partial different weights with alternate answer with \'Match from all responses - \"false\"', () => {
|
41
15
|
abortEarlySetup();
|
42
16
|
before(() => {
|
@@ -99,24 +73,4 @@ describe('Partial Different scoring', () => {
|
|
99
73
|
|
100
74
|
fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsWithAlternateAnswerAndMatchFromAllResponsesTrue('fill in the gaps - dropdown');
|
101
75
|
});
|
102
|
-
|
103
|
-
describe('Partial Different Weights: Round down score', () => {
|
104
|
-
abortEarlySetup();
|
105
|
-
before(() => {
|
106
|
-
cy.log('Add question instructions and options, set correct answers, select partial - different weights scoring and add points (in decimals) for correct answer options');
|
107
|
-
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown')
|
108
|
-
cy.barsPreLoaderWait();
|
109
|
-
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
110
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
111
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
112
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
|
113
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
|
114
|
-
fillInTheGapsDropdownPage.partialDifferentWeightsCheckbox()
|
115
|
-
.click();
|
116
|
-
fillInTheGapsDropdownPage.steps.addPartialDifferentWeightsPoints([1.36, 2.89]);
|
117
|
-
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
118
|
-
});
|
119
|
-
|
120
|
-
fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsRoundDownScore('fill in the gaps - dropdown');
|
121
|
-
});
|
122
76
|
});
|
@@ -4,7 +4,7 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
4
4
|
let optionsForResponse1 = ['Correct answer 1', 'Alternate correct answer 1', 'Incorrect answer 1', 'Incorrect answer 2'];
|
5
5
|
let optionsForResponse2 = ['Correct answer 2', 'Alternate correct answer 2', 'Incorrect answer 1', 'Incorrect answer 2'];
|
6
6
|
|
7
|
-
describe('Fill in the gaps - dropdown
|
7
|
+
describe('Fill in the gaps - dropdown: Partial - equal weights scoring', () => {
|
8
8
|
before(() => {
|
9
9
|
cy.loginAs('admin');
|
10
10
|
})
|
@@ -33,68 +33,6 @@ describe('Fill in the gaps - dropdown scoring section partial - equal weights',
|
|
33
33
|
fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsScoring('fill in the gaps - dropdown')
|
34
34
|
});
|
35
35
|
|
36
|
-
describe('Question preview: Partial - equal weights with alternate answer and match from all responses - \"false\"', () => {
|
37
|
-
abortEarlySetup();
|
38
|
-
before(() => {
|
39
|
-
cy.log('Navigate to fill in the gaps - dropdown question type, adding correct answer responses and alternate answer responses, adding points and switch to preview tab');
|
40
|
-
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
41
|
-
cy.barsPreLoaderWait();
|
42
|
-
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
43
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
44
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
45
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
|
46
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
|
47
|
-
fillInTheGapsDropdownPage.steps.allotPoints('10');
|
48
|
-
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
49
|
-
fillInTheGapsDropdownPage.alternateAnswerButton()
|
50
|
-
.click();
|
51
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Alternate correct answer 1');
|
52
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Alternate correct answer 2');
|
53
|
-
fillInTheGapsDropdownPage.steps.allotPoints('6');
|
54
|
-
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
55
|
-
fillInTheGapsDropdownPage.partialEqualWeightsCheckbox()
|
56
|
-
.click();
|
57
|
-
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
58
|
-
fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
|
59
|
-
.click();
|
60
|
-
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
61
|
-
});
|
62
|
-
|
63
|
-
fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsWithAlternateAnswerAndMatchFromAllResponsesFalse('fill in the gaps - dropdown')
|
64
|
-
});
|
65
|
-
|
66
|
-
describe('Question preview: Partial - equal weights with alternate answer and match from all responses - \"true\"', () => {
|
67
|
-
abortEarlySetup();
|
68
|
-
before(() => {
|
69
|
-
cy.log('Navigate to fill in the gaps - dropdown question type, adding correct answer responses and alternate answer responses and points for both correct and alternate answer');
|
70
|
-
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
71
|
-
cy.barsPreLoaderWait();
|
72
|
-
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
73
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
74
|
-
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
75
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
|
76
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
|
77
|
-
fillInTheGapsDropdownPage.steps.allotPoints('10');
|
78
|
-
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
79
|
-
fillInTheGapsDropdownPage.alternateAnswerButton()
|
80
|
-
.click();
|
81
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Alternate correct answer 1');
|
82
|
-
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Alternate correct answer 2');
|
83
|
-
fillInTheGapsDropdownPage.steps.allotPoints('6');
|
84
|
-
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
85
|
-
fillInTheGapsDropdownPage.matchFromAllResponsesCheckbox()
|
86
|
-
.click();
|
87
|
-
fillInTheGapsDropdownPage.partialEqualWeightsCheckbox()
|
88
|
-
.click();
|
89
|
-
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
90
|
-
fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
|
91
|
-
.click();
|
92
|
-
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
93
|
-
});
|
94
|
-
|
95
|
-
fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsWithAlternateAnswerAndMatchFromAllResponsesTrue('fill in the gaps - dropdown')
|
96
|
-
});
|
97
|
-
|
98
36
|
describe('Partial Equal Weights: Round down score', () => {
|
99
37
|
abortEarlySetup();
|
100
38
|
before(() => {
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage, fillInTheGapsScoring } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
let optionsForResponse1 = ['Correct answer 1', 'Alternate correct answer 1', 'Incorrect answer 1', 'Incorrect answer 2'];
|
5
|
+
let optionsForResponse2 = ['Correct answer 2', 'Alternate correct answer 2', 'Incorrect answer 1', 'Incorrect answer 2'];
|
6
|
+
|
7
|
+
describe('Fill in the gaps - dropdown: Partial equal weights scoring with alternate answer', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Question preview: Partial - equal weights with alternate answer and match from all responses - \"false\"', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
cy.log('Navigate to fill in the gaps - dropdown question type, adding correct answer responses and alternate answer responses, adding points and switch to preview tab');
|
16
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
17
|
+
cy.barsPreLoaderWait();
|
18
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
19
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
20
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
21
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
|
22
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
|
23
|
+
fillInTheGapsDropdownPage.steps.allotPoints('10');
|
24
|
+
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
25
|
+
fillInTheGapsDropdownPage.alternateAnswerButton()
|
26
|
+
.click();
|
27
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Alternate correct answer 1');
|
28
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Alternate correct answer 2');
|
29
|
+
fillInTheGapsDropdownPage.steps.allotPoints('6');
|
30
|
+
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
31
|
+
fillInTheGapsDropdownPage.partialEqualWeightsCheckbox()
|
32
|
+
.click();
|
33
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
34
|
+
fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
|
35
|
+
.click();
|
36
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
37
|
+
});
|
38
|
+
|
39
|
+
fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsWithAlternateAnswerAndMatchFromAllResponsesFalse('fill in the gaps - dropdown')
|
40
|
+
});
|
41
|
+
|
42
|
+
describe('Question preview: Partial - equal weights with alternate answer and match from all responses - \"true\"', () => {
|
43
|
+
abortEarlySetup();
|
44
|
+
before(() => {
|
45
|
+
cy.log('Navigate to fill in the gaps - dropdown question type, adding correct answer responses and alternate answer responses and points for both correct and alternate answer');
|
46
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
47
|
+
cy.barsPreLoaderWait();
|
48
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
49
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
50
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
51
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
|
52
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
|
53
|
+
fillInTheGapsDropdownPage.steps.allotPoints('10');
|
54
|
+
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
55
|
+
fillInTheGapsDropdownPage.alternateAnswerButton()
|
56
|
+
.click();
|
57
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Alternate correct answer 1');
|
58
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Alternate correct answer 2');
|
59
|
+
fillInTheGapsDropdownPage.steps.allotPoints('6');
|
60
|
+
fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
61
|
+
fillInTheGapsDropdownPage.matchFromAllResponsesCheckbox()
|
62
|
+
.click();
|
63
|
+
fillInTheGapsDropdownPage.partialEqualWeightsCheckbox()
|
64
|
+
.click();
|
65
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
66
|
+
fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
|
67
|
+
.click();
|
68
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
69
|
+
});
|
70
|
+
|
71
|
+
fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsWithAlternateAnswerAndMatchFromAllResponsesTrue('fill in the gaps - dropdown')
|
72
|
+
});
|
73
|
+
});
|