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
@@ -0,0 +1,160 @@
1
+ import { listOrderingPage } from "../../../pages/listOrderingPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ let options = ['plant', 'sprout', 'flower', 'seed'];
6
+ let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
7
+
8
+ describe('Create item page - List sorting: Preview tab \'Scoring\' section', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Question Preview: Manually Scored', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ cy.log('Navigating to list ordering question type');
17
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
18
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
19
+ cy.barsPreLoaderWait();
20
+ listOrderingPage.steps.addQuestionInstructions();
21
+ listOrderingPage.steps.addInputToOptionsInputField(options);
22
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
23
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
24
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
25
+ listOrderingPage.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored');
26
+ listOrderingPage.steps.switchToPreviewTab();
27
+ });
28
+
29
+ it('When user switches to the Preview tab, the question instruction should be displayed and the and options along with source and target option wrappers should be displayed in the preview tab', () => {
30
+ listOrderingPage.steps.verifyQuestionInstructionsText();
31
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(options);
32
+ for (let index = 0; index < 4; index++) {
33
+ listOrderingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index);
34
+ }
35
+ utilities.verifyElementCount(listOrderingPage.previewTabOption(), 4);
36
+ });
37
+
38
+ listOrderingPage.tests.verifyShowCorrectAnswerAndPointsNotDisplayedInPreviewTab();
39
+ });
40
+
41
+ describe('Question Preview: Non Scored', () => {
42
+ abortEarlySetup();
43
+ before(() => {
44
+ cy.log('Navigating to list ordering question type');
45
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
46
+ cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
47
+ cy.barsPreLoaderWait();
48
+ listOrderingPage.steps.addQuestionInstructions();
49
+ listOrderingPage.steps.addInputToOptionsInputField(options);
50
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
51
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
52
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
53
+ listOrderingPage.steps.selectAScoringTypeFromScoringTypeDropdown('Non scored');
54
+ listOrderingPage.steps.expandAdditonalSettings();
55
+ listOrderingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
56
+ listOrderingPage.steps.switchToPreviewTab();
57
+ });
58
+
59
+ listOrderingPage.tests.verifyShowCorrectAnswerLabelAndCheckboxExistAndPreviewScoreNotExistInPreviewTab();
60
+
61
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct/incorrect border or icons should not be displayed, a correct answer container with \'Correct answers:\' label and all correct answers with numeration should be displayed below the question preview', () => {
62
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox();
63
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
64
+ listOrderingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
65
+ listOrderingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
66
+ utilities.verifyInnerText(listOrderingPage.correctAnswerContainerCorrectAnswersLabel(), 'Correct answers:');
67
+ });
68
+
69
+ it('When user selects Check answer button without attempting the question, correct/incorrect answer border for the question and label should not be displayed below the question preview and correct answer container should not be displayed', () => {
70
+ cy.log('Pre-step: Deselect the show correct checkbox')
71
+ listOrderingPage.steps.uncheckShowCorrectAnswerCheckbox()
72
+ listOrderingPage.steps.checkAnswer();
73
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotExists();
74
+ listOrderingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
75
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
76
+ });
77
+
78
+ it('Case: When user attempts the question incorrect', () => {
79
+ cy.log('When user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all the options, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with all correct answers along with numeration should be displayed')
80
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 3);
81
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 0);
82
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['flower', 'plant', 'seed', 'sprout',]);
83
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox();
84
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
85
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
86
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
87
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
88
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
89
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
90
+ listOrderingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
91
+
92
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
93
+
94
+ cy.log('When user attempts the question incorrectly and clicks on the \'Check Answer\' button, then red cross-mark icons should be displayed beside all the options, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
95
+ listOrderingPage.steps.checkAnswer();
96
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
97
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
98
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
99
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
100
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
101
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
102
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
103
+ });
104
+
105
+ it('Case: When user attempts the question partially correct', () => {
106
+ cy.log('When user attempts the question partially correct with some options at the correct position and some at incorrect then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points, green check-mark icons should be displayed beside the options at the correct position, red cross-mark icons should be displayed beside the options at incorrect position, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with all correct answers along with numeration should be displayed')
107
+ listOrderingPage.steps.resetQuestionPreview(options);
108
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 3);
109
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['plant', 'sprout', 'seed', 'flower']);
110
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox()
111
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
112
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
113
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
114
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
115
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
116
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
117
+ listOrderingPage.steps.verifyCorrectAnswerContainerContents(['seed', 'plant'], ['1', '3']);
118
+
119
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
120
+
121
+ cy.log('When user attempts the question partially correct and clicks on the \'Check Answer\' button, green check-mark icons should be displayed beside the options at the correct position, red cross-mark icons should be displayed beside the options at incorrect position,, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
122
+ listOrderingPage.steps.checkAnswer()
123
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
124
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
125
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
126
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
127
+ listOrderingPage.steps.verifyIncorrectAttemptBorder();
128
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
129
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
130
+ });
131
+
132
+ it('Case: When user attempts the question correct', () => {
133
+ cy.log('When user attempts the question correctly then on selecting \'Show correct answer\' checkbox, the user should be awarded full points and green check-mark icons should be displayed beside all the options, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
134
+ listOrderingPage.steps.resetQuestionPreview(options);
135
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
136
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 1);
137
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(correctAnswerArray);
138
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox()
139
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
140
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
141
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
142
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
143
+ listOrderingPage.steps.verifyCorrectAttemptBorder();
144
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
145
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
146
+
147
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
148
+
149
+ cy.log('When user attempts the question correctly and clicks on the \'Check Answer\' button, green check-mark icons should be displayed beside the options at the correct position, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
150
+ listOrderingPage.steps.checkAnswer();
151
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
152
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
153
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
154
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
155
+ listOrderingPage.steps.verifyCorrectAttemptBorder();
156
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
157
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
158
+ });
159
+ });
160
+ });
@@ -0,0 +1,191 @@
1
+ import { listOrderingPage } from "../../../pages/listOrderingPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ let options = ['sprout', 'plant', 'flower', 'seed'];
6
+ let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
7
+
8
+ describe('Create Item page - List ordering: Preview tab Scoring Section', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Question Preview: AutoScored - Partial different weights scoring', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ cy.log('Navigating to list ordering question type');
17
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
18
+ cy.log('Adding question instructions, setting correct answer order and adding points for Partial different weights scoring type and switching to Preview tab');
19
+ cy.barsPreLoaderWait();
20
+ listOrderingPage.steps.addQuestionInstructions();
21
+ listOrderingPage.steps.addInputToOptionsInputField(options);
22
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
23
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
24
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
25
+ listOrderingPage.steps.selectPartialDifferentWeightsCheckbox();
26
+ listOrderingPage.steps.allotPartialDifferentWeightsToAllPointsFields([4.2, 1.8, 2.3, 3.7]);
27
+ listOrderingPage.steps.uncheckRoundDownScoreCheckbox();
28
+ listOrderingPage.steps.expandAdditonalSettings();
29
+ listOrderingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
30
+ listOrderingPage.steps.switchToPreviewTab();
31
+ });
32
+
33
+ //Failing due to https://redmine.zeuslearning.com/issues/538081
34
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct/incorrect border or icons should not be displayed, a correct answer container with \'Correct answers:\' label and all correct answers with numeration should be displayed below the question preview', () => {
35
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox();
36
+ listOrderingPage.steps.verifyPreviewTabScoreText(0, 12);
37
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
38
+ listOrderingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
39
+ listOrderingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
40
+ utilities.verifyInnerText(listOrderingPage.correctAnswerContainerCorrectAnswersLabel(), 'Correct answers:');
41
+ });
42
+
43
+ it('When user selects Check answer button without attempting the question, correct/incorrect answer border for the question and label should not be displayed below the question preview and correct answer container should not be displayed', () => {
44
+ cy.log('Pre-step: Deselect the show correct checkbox')
45
+ listOrderingPage.steps.uncheckShowCorrectAnswerCheckbox()
46
+ listOrderingPage.steps.checkAnswer();
47
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
48
+ listOrderingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
49
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
50
+ });
51
+
52
+ it('Case: When user attempts the question incorrect', () => {
53
+ cy.log('When user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all the options, the correct answer container with all correct answers along with numeration should be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
54
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 3);
55
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 0);
56
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['flower', 'plant', 'seed', 'sprout']);
57
+ listOrderingPage.steps.verifyPreviewTabScoreText(0, 12);
58
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox();
59
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
60
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
61
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
62
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
63
+ listOrderingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
64
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
65
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
66
+
67
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
68
+
69
+ cy.log('When user attempts the question incorrectly and clicks on the \'Check Answer\' button, then red cross-mark icons should be displayed beside all the options, the correct answer container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
70
+ listOrderingPage.steps.checkAnswer();
71
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
72
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
73
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
74
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
75
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
76
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
77
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
78
+ });
79
+
80
+ it('Case: When user attempts the question partially correct', () => {
81
+ cy.log('When user attempts the question partially correct with some options at the correct position and some at incorrect then on selecting \'Show correct answer\' checkbox, the user should be awarded points of the correctly ordered options, red cross-mark icons should be displayed beside the options at incorrect position, green check-mark icons should be displayed beside the options at the correct position, the correct answer container with all correct answers along with numeration should be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
82
+ listOrderingPage.steps.resetQuestionPreview(options);
83
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 3);
84
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 0);
85
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['plant', 'sprout', 'seed', 'flower']);
86
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox()
87
+ listOrderingPage.steps.verifyPreviewTabScoreText(5.5, 12);
88
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
89
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
90
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
91
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
92
+ listOrderingPage.steps.verifyCorrectAnswerContainerContents(['seed', 'plant'], ['1', '3']);
93
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
94
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
95
+
96
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
97
+
98
+ cy.log('When user attempts the question partially correct and clicks on the \'Check Answer\' button, red cross-mark icons should be displayed beside the options at incorrect position and green check-mark icons should be displayed beside the options at the correct position, the correct answer container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
99
+ listOrderingPage.steps.checkAnswer()
100
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
101
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
102
+ listOrderingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
103
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
104
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
105
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
106
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
107
+ });
108
+
109
+ it('Case: When user attempts the question correct', () => {
110
+ cy.log('When user attempts the question correct then on selecting \'Show correct answer\' checkbox, the user should be awarded full points and green check-mark icons should be displayed beside all the options, the correct answer container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
111
+ listOrderingPage.steps.resetQuestionPreview(options);
112
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
113
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 1);
114
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(correctAnswerArray);
115
+ listOrderingPage.steps.verifyPreviewTabScoreText(12, 12);
116
+ listOrderingPage.steps.checkShowCorrectAnswerCheckbox()
117
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
118
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
119
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
120
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
121
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
122
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
123
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
124
+
125
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
126
+
127
+ cy.log('When user attempts the question correctly and clicks on the \'Check Answer\' button, green check-mark icons should be displayed beside the options at the correct position, the correct answer container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
128
+ listOrderingPage.steps.checkAnswer();
129
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
130
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
131
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
132
+ listOrderingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
133
+ listOrderingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
134
+ listOrderingPage.steps.verifyCorrectIncorrectBorderNotVisible();
135
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
136
+ });
137
+
138
+ listOrderingPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(12);
139
+
140
+ //Failing due to - https://redmine.zeuslearning.com/issues/538651
141
+ listOrderingPage.tests.verifyPenaltyPointsFunctionalityForIncorrectAnswer(6.4, 12);
142
+
143
+ listOrderingPage.tests.verifyMinimumScoreIfAttemptedAndPenaltyPointsFunctionalityForIncorrectAnswer([1, 6.4, 6], 6, 12);
144
+ });
145
+
146
+ describe('Partial Equal Weights: Round down score', () => {
147
+ abortEarlySetup();
148
+ before(() => {
149
+ cy.log('Navigating to list ordering question type');
150
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
151
+ cy.log('Adding question instructions, setting correct answer order and adding points for Partial equal weights scoring type and switching to Preview tab');
152
+ cy.barsPreLoaderWait();
153
+ listOrderingPage.steps.addQuestionInstructions();
154
+ listOrderingPage.steps.addInputToOptionsInputField(options);
155
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
156
+ listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
157
+ listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
158
+ listOrderingPage.steps.selectPartialDifferentWeightsCheckbox();
159
+ listOrderingPage.steps.allotPartialDifferentWeightsToAllPointsFields([4.2, 1.8, 3.4, 2.3]);
160
+ listOrderingPage.steps.expandAdditonalSettings();
161
+ listOrderingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
162
+ listOrderingPage.steps.switchToPreviewTab();
163
+ });
164
+
165
+ it('When the \'Round down score\' checkbox is selected, then in Preview tab when user enters partially or fully correct answers responses the score displayed should be rounded down to the nearest whole number', () => {
166
+ listOrderingPage.steps.verifyCheckedStateOfRoundDownScoreCheckbox();
167
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
168
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'plant', 'sprout', 'flower']);
169
+ listOrderingPage.steps.verifyPreviewTabScoreText(6, 11.7);
170
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
171
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 1);
172
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'sprout', 'plant', 'flower']);
173
+ listOrderingPage.steps.verifyPreviewTabScoreText(11, 11.7);
174
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
175
+ });
176
+
177
+ it('When the \'Round down score\' checkbox is not selected, then in Preview tab when user selects partially or fully correct answers the points should be displayed in decimal points if applicable as per the options selected by the user', () => {
178
+ listOrderingPage.steps.switchToEditTab()
179
+ listOrderingPage.steps.uncheckRoundDownScoreCheckbox()
180
+ listOrderingPage.steps.switchToPreviewTab();
181
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
182
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'plant', 'sprout', 'flower']);
183
+ listOrderingPage.steps.verifyPreviewTabScoreText(6.5, 11.7);
184
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
185
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 1);
186
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'sprout', 'plant', 'flower']);
187
+ listOrderingPage.steps.verifyPreviewTabScoreText(11.7, 11.7);
188
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
189
+ });
190
+ });
191
+ });