itemengine-cypress-automation 1.0.46 → 1.0.48

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAddResponseContainer.js +221 -0
  2. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettings.js +450 -0
  3. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsBasic.js +202 -0
  4. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsCustomSpecialCharachters.js +120 -0
  5. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsMultilineResponse.js +189 -0
  6. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsResponseAccordions.js +431 -0
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsStudentResponseAreaAndLayout.js +262 -0
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingScoring.js +188 -0
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingWithAlternateAnswer.js +613 -0
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingWithAlternateAnswerMatchFromAllResponsesTrue.js +172 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextConditionalCheckboxes.js +203 -0
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +134 -0
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +133 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabScoringSection.js +227 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextHeaderSection.js +109 -0
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextImageProperties.js +156 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextManualAndNonScored.js +157 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextMatchFromAllResponses.js +162 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsScoring.js +200 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsWithAlternateAnswer.js +849 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsWithAlternateAnswerMatchFromAllResponsesTrue.js +171 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsScoring.js +199 -0
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsWithAlternateAnswer.js +738 -0
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsWithAlternateAnswerMatchFromAllResponsesTrue.js +168 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPreviewTab.js +66 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSetCorrectAnswerSection.js +113 -0
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSupportedFileTypes.js +86 -0
  28. package/package.json +1 -1
@@ -0,0 +1,157 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const correctTabAnswerArray = ['Flower', 'Leaf', 'Stem'];
5
+ const incorrectAnswerArray = ['Roots', 'Branch', 'Seed'];
6
+
7
+ describe('Create item page - Fill in the gaps over image - text: Manually and Non-scored', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Question preview: Manually scored', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigate to fill in the gaps over image - text question type');
16
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
17
+ cy.barsPreLoaderWait();
18
+ fillInTheGapsOverImageTextPage.steps.addQuestionInstructions();
19
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
20
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
21
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
22
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
23
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
24
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
25
+ fillInTheGapsOverImageTextPage.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored');
26
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
27
+ });
28
+
29
+ it('When user switches to the Preview tab, the question instruction and the response fields should be displayed in the preview tab', () => {
30
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionInstructionsText();
31
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.responseFieldPreviewTab(), 2);
32
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseFieldPreviewTab(), 'visible');
33
+ });
34
+
35
+ fillInTheGapsOverImageTextPage.tests.verifyShowCorrectAnswerAndPointsNotDisplayedInPreviewTab();
36
+ });
37
+
38
+ describe('Question Preview: Non scored', () => {
39
+ abortEarlySetup();
40
+ before(() => {
41
+ cy.log('Navigate to fill in the gaps over image - text question type');
42
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
43
+ cy.barsPreLoaderWait();
44
+ fillInTheGapsOverImageTextPage.steps.addQuestionInstructions();
45
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
46
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
47
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
48
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
49
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
50
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
51
+ fillInTheGapsOverImageTextPage.steps.selectAScoringTypeFromScoringTypeDropdown('Non scored');
52
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
53
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
54
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
55
+ });
56
+
57
+ fillInTheGapsOverImageTextPage.tests.verifyShowCorrectAnswerLabelAndCheckboxExistAndPreviewScoreNotExistInPreviewTab();
58
+
59
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct/incorrect icons or label should not be displayed, correct answer container along with \'Correct answers:\' label and correct responses with numeric count should be displayed below the question preview', () => {
60
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
61
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
62
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
63
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
64
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerLabel(), 'Correct answers:');
65
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
66
+ fillInTheGapsOverImageTextPage.steps.uncheckShowCorrectAnswerCheckbox();
67
+ });
68
+
69
+ it('When user selects Check answer button without attempting the question, correct/incorrect label and border should not be displayed below and check-mark or cross-mark should not be displayed for any option', () => {
70
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
71
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
72
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
73
+ });
74
+
75
+ it('When the user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, red cross-mark icons should be displayed beside all incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container with all correct answers along with numeration should be displayed', () => {
76
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
77
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
78
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
79
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
80
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
81
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
82
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
83
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
84
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
85
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
86
+ cy.log('When the user attempts the question incorrectly and clicks on the \'Check answer\' button, then red cross-mark icons should be displayed beside all incorrect the responses, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
87
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
88
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
89
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
90
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
91
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
92
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
93
+ });
94
+
95
+ it('When user attempts the question partially correct without incorrect answer, then on selecting \'Show correct answer\' checkbox, green check-mark should be displayed besides correct answer responses, red cross-mark should not be displayed beside any responses and correct/incorrect border and label should not be displayed', () => {
96
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
97
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
98
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
99
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
100
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
101
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
102
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
103
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1]], ['2']);
104
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
105
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
106
+
107
+ cy.log('When user attempts the question partially correct and clicks on the \'Check answer\' button, green check-mark should be displayed besides correctly attempted responses, red cross-mark should not be displayed beside any responses and correct/incorrect border and label should not be displayed');
108
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
109
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
110
+ fillInTheGapsOverImageTextPage.steps.verifyCheckmarkOrCrossmarkNotVisible(1);
111
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
112
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
113
+ });
114
+
115
+ it('When user attempts the question partially correct with incorrect answer, then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points, green check-mark should be displayed besides correct answer responses, red cross-mark should be displayed besides incorrectly answered option and correct/incorrect border and label should not be displayed', () => {
116
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
117
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
118
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
119
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
120
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
121
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
122
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
123
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
124
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1]], ['2']);
125
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
126
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
127
+
128
+ cy.log('When user attempts the question partially correct and clicks on the \'Check Answer\' button, green check-mark should be displayed besides correctly attempted responses, red cross-mark should be displayed besides incorrectly answered option and correct/incorrect border and label should not be displayed')
129
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
130
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
131
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
132
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
133
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
134
+ });
135
+
136
+ it('When user attempts the question correctly then on selecting \'Show correct answer\' checkbox, green check-mark icons should be displayed besides the correctly answered responses, correct/incorrect border and label and correct answer container should not be displayed', () => {
137
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
138
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
139
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
140
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
141
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
142
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
143
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
144
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
145
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
146
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
147
+
148
+ cy.log('When user attempts the question correctly and clicks on the \'Check Answer\' button, green check-mark icons should be displayed besides the correctly answered responses and correct/incorrect border and label should not be displayed')
149
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
150
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
151
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
152
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
153
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
154
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
155
+ });
156
+ });
157
+ });
@@ -0,0 +1,162 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const correctTabAnswerArray = ['Flower', 'Leaf'];
4
+ const alternateTab1AnswerArray = ['Petals', 'Leaves'];
5
+ const alternateTab2AnswerArray = ['Branch', 'Roots'];
6
+
7
+ describe('Fill In the gaps over image - text \'Correct response condition\' checkboxes', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Match from all responses - Edit tab cases for \'All or Nothing\' scoring type', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigate to fill in the gaps over image - text question type');
16
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
17
+ cy.barsPreLoaderWait();
18
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
19
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
20
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
21
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
22
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
23
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
24
+ fillInTheGapsOverImageTextPage.steps.allotPoints(7);
25
+ });
26
+
27
+ it('When the user adds alternate answer and enables the \'Match from all responses\' functionality, the points field should be in disabled state and should have the value of points same as set in the \'Correct\' tab', () => {
28
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
29
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab1AnswerArray[0]);
30
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab1AnswerArray[1]);
31
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
32
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
33
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
34
+ });
35
+
36
+ it('When the user adds another tab, the new alternate answer tab should also have the same point value as the \'Correct\' tab', () => {
37
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(2);
38
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
39
+ });
40
+
41
+ it('When the user has already set different points in the alternate answer tab and then enables the \'Match from all responses\' functionality, the points field in the \'Alternate\' tab should get disabled and should have the value of points same as set in the \'Correct\' tab', () => {
42
+ cy.log('Pre:step - unchecking the \'Match from all responses\' checkbox and updating the points')
43
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
44
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab2AnswerArray[0]);
45
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab2AnswerArray[1]);
46
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
47
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
48
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
49
+ });
50
+
51
+ it('When the user disables the \'Match from all responses\' functionality, the score should go back to their previously set values', () => {
52
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
53
+ fillInTheGapsOverImageTextPage.steps.verifyPointsFieldValue(20);
54
+ fillInTheGapsOverImageTextPage.steps.switchToCorrectTab();
55
+ fillInTheGapsOverImageTextPage.steps.verifyPointsFieldValue(7);
56
+ });
57
+ });
58
+
59
+ describe('Match from all responses - Edit tab cases for \'Partial - equal weights\' scoring type', () => {
60
+ abortEarlySetup();
61
+ before(() => {
62
+ cy.log('Navigate to fill in the gaps over image - text question type');
63
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
64
+ cy.barsPreLoaderWait();
65
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
66
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
67
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
68
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
69
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
70
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
71
+ fillInTheGapsOverImageTextPage.steps.allotPoints(7);
72
+ fillInTheGapsOverImageTextPage.steps.selectPartialEqualWeightsCheckbox();
73
+ });
74
+
75
+ it('When the user adds alternate answer and enables the \'Match from all responses\' functionality, the points field should be in disabled state and should have the value of points same as set in the \'Correct\' tab', () => {
76
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
77
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab1AnswerArray[0]);
78
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab1AnswerArray[1]);
79
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
80
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
81
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
82
+ fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(3.5);
83
+ });
84
+
85
+ it('When the user adds another tab, the new alternate answer tab should also have the same point value as the \'Correct\' tab', () => {
86
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(2);
87
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
88
+ fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(3.5);
89
+ });
90
+
91
+ it('When the user has already set different points in the alternate answer tab and then enables the \'Match from all responses\' functionality, the points field in the \'Alternate\' tab should get disabled and should have the value of points same as set in the \'Correct\' tab', () => {
92
+ cy.log('Pre:step - unchecking the \'Match from all responses\' checkbox and updating the points')
93
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
94
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab2AnswerArray[0]);
95
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab2AnswerArray[1]);
96
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
97
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
98
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
99
+ fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(3.5);
100
+ });
101
+
102
+ it('When the user disables the \'Match from all responses\' functionality, the score should go back to their previously set values', () => {
103
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
104
+ fillInTheGapsOverImageTextPage.steps.verifyPointsFieldValue(20);
105
+ fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(10);
106
+ fillInTheGapsOverImageTextPage.steps.switchToCorrectTab();
107
+ fillInTheGapsOverImageTextPage.steps.verifyPointsFieldValue(7);
108
+ fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(3.5);
109
+ });
110
+ });
111
+
112
+ describe('Match from all responses - Edit tab cases for \'Partial - different weights\' scoring type', () => {
113
+ abortEarlySetup();
114
+ before(() => {
115
+ cy.log('Navigate to fill in the gaps over image - text question type');
116
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
117
+ cy.barsPreLoaderWait();
118
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
119
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
120
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
121
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
122
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
123
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
124
+ fillInTheGapsOverImageTextPage.steps.selectPartialDifferentWeightsCheckbox();
125
+ fillInTheGapsOverImageTextPage.steps.addPartialDifferentWeightsPoints([1, 7]);
126
+ });
127
+
128
+ it('When the user adds alternate answer and enables the \'Match from all responses\' functionality, the points field should be in disabled state and should have the value of points same as set in the \'Correct\' tab', () => {
129
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
130
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab1AnswerArray[0]);
131
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab1AnswerArray[1]);
132
+ fillInTheGapsOverImageTextPage.steps.addPartialDifferentWeightsPoints([2, 8]);
133
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
134
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 1);
135
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(1, 7);
136
+ });
137
+
138
+ it('When the user adds another tab, the new alternate answer tab should also have the same point value as the \'Correct\' tab', () => {
139
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(2);
140
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 1);
141
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(1, 7);
142
+ });
143
+
144
+ it('When the user has already set different points in the alternate answer tab and then enables the \'Match from all responses\' functionality, the points field in the \'Alternate\' tab should get disabled and should have the value of points same as set in the \'Correct\' tab', () => {
145
+ cy.log('Pre:step - unchecking the \'Match from all responses\' checkbox and updating the points')
146
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
147
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab2AnswerArray[0]);
148
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab2AnswerArray[1]);
149
+ fillInTheGapsOverImageTextPage.steps.addPartialDifferentWeightsPoints([3, 10]);
150
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
151
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 1);
152
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(1, 7);
153
+ });
154
+
155
+ it('When the user disables the \'Match from all responses\' functionality, the score should go back to their previously set values', () => {
156
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
157
+ fillInTheGapsOverImageTextPage.steps.verifyPartialDifferentWeightsPointsInputFieldValue([3, 10]);
158
+ fillInTheGapsOverImageTextPage.steps.switchToCorrectTab();
159
+ fillInTheGapsOverImageTextPage.steps.verifyPartialDifferentWeightsPointsInputFieldValue([1, 7]);
160
+ });
161
+ });
162
+ });
@@ -0,0 +1,200 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const correctTabAnswerArray = ['Flower', 'Leaf', 'Stem'];
5
+ const incorrectAnswerArray = ['Roots', 'Branch', 'Seed'];
6
+
7
+ describe('Create item page - Fill in the gaps over image - text: Partial different weights scoring', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Question preview: Auto scored - Partial different weights scoring', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigate to fill in the gaps over image - text question type');
16
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
17
+ cy.barsPreLoaderWait();
18
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
19
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
20
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
21
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
22
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
23
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
24
+ fillInTheGapsOverImageTextPage.steps.selectPartialDifferentWeightsCheckbox();
25
+ fillInTheGapsOverImageTextPage.steps.uncheckRoundDownScoreCheckbox();
26
+ fillInTheGapsOverImageTextPage.steps.addPartialDifferentWeightsPoints([13.2, 6.8]);
27
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
28
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
29
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
30
+ });
31
+
32
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct/incorrect icons or label should not be displayed, correct answer container along with \'Correct answers:\' label and correct responses with numeric count should be displayed below the question preview', () => {
33
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
34
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
35
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
36
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
37
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerLabel(), 'Correct answers:');
38
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
39
+ fillInTheGapsOverImageTextPage.steps.uncheckShowCorrectAnswerCheckbox();
40
+ });
41
+
42
+ it('When the user selects \'Check answer\' button without attempting the question, then red cross-mark icon or green check-mark icons, correct/incorrect answer label and border and correct answer container should not be displayed', () => {
43
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
44
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
45
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
46
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
47
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
48
+ });
49
+
50
+ it('When the 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 incorrect response fields, correct/incorrect answer label and its border should not be displayed and the correct answer container with all correct answers along with numeration should be displayed', () => {
51
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
52
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
53
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
54
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
55
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
56
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
57
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
58
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
59
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
60
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
61
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
62
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
63
+ cy.log('When the user clicks on \'Check answer\' button, then red cross-mark icons should be displayed beside all incorrect the responses, correct/incorrect answer label and its border, correct answer container should not be displayed')
64
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
65
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
66
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
67
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
68
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
69
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
70
+ });
71
+
72
+ it('When the user attempts the question partially correct, then on selecting \'Show correct answer\' checkbox, the user should be awarded points as per the correctly attempted response, green check-mark icons should be displayed beside the correct response fields, red cross-mark icons should be displayed beside the incorrect response fields, correct/incorrect answer label and its border should not be displayed and the correct answer container with correct answers for responses marked incorrect along with numeration should be displayed', () => {
73
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
74
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
75
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
76
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(13.2, 20);
77
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
78
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
79
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
80
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
81
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
82
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
83
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1]], ['2']);
84
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
85
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
86
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icons should be displayed beside the correct response fields, red cross-mark icons should be displayed beside the incorrect response fields, correct/incorrect answer label and its border, correct answer container should not be displayed')
87
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
88
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
89
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
90
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
91
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
92
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
93
+ });
94
+
95
+ it('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 response fields, correct/incorrect answer label and its border and the correct answer container should not be displayed', () => {
96
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
97
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
98
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
99
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
100
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
101
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
102
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
103
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
104
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
105
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
106
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
107
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icons should be displayed beside all the response fields, correct/incorrect answer label and its border, correct answer container should not be displayed')
108
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
109
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
110
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
111
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
112
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
113
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
114
+ });
115
+
116
+ fillInTheGapsOverImageTextPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(1, 20);
117
+
118
+ it('When user has defined penalty points', () => {
119
+ cy.log('Pre-step: Switch to edit tab, clear the minimum score if attempted points and set penalty points');
120
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
121
+ fillInTheGapsOverImageTextPage.steps.allotPenaltyPoints(3);
122
+ fillInTheGapsOverImageTextPage.steps.clearMinimumScoreIfAttemptedPointsField();
123
+
124
+ cy.log('After switching to preview tab, when user adds an incorrect answer input, then 0 points should be awarded(no negative points)');
125
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
126
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
127
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
128
+
129
+ cy.log('When user adds a partially correct answer input, the points should be updated accordingly with deducted penalty points');
130
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
131
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(3.8, 20);
132
+ });
133
+
134
+ it('When user has defined both penalty points and minimum score awarded (if attempted) points', () => {
135
+ cy.log('Pre-step: Switch to edit tab and set minimum score awarded (if attempted) points');
136
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
137
+ fillInTheGapsOverImageTextPage.steps.allotMinimumScoreAwardedIfAttempted(1);
138
+
139
+ cy.log('Switch to preview tab and give incorrect answer input to check that minimum points are displayed');
140
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
141
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
142
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(1, 20);
143
+
144
+ cy.log('When user adds a partially correct answer such that the points of the attempt(with penalty points deducted) is more than the minimum score awarded(if attempted) points');
145
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
146
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(3.8, 20);
147
+
148
+ cy.log('When user switches to edit tab and increases the minimum score awarded (if attempted) points to check the case for an attempt in which points of the attempt is less than minimum score awarded (if attempted) points, then the minimum score awarded (if attempted) points should be displayed to the user');
149
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
150
+ fillInTheGapsOverImageTextPage.steps.clearMinimumScoreIfAttemptedPointsField();
151
+ fillInTheGapsOverImageTextPage.steps.allotMinimumScoreAwardedIfAttempted(9)
152
+ cy.log('Switching to preview tab');
153
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
154
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
155
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
156
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(9, 20);
157
+ });
158
+ });
159
+
160
+ describe('Partial different weights: Round down score', () => {
161
+ abortEarlySetup();
162
+ before(() => {
163
+ cy.log('Navigate to fill in the gaps over image - text question type');
164
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
165
+ cy.barsPreLoaderWait();
166
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
167
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
168
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
169
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
170
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
171
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
172
+ fillInTheGapsOverImageTextPage.steps.selectPartialDifferentWeightsCheckbox();
173
+ fillInTheGapsOverImageTextPage.steps.addPartialDifferentWeightsPoints([10.2, 3.4]);
174
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
175
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
176
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
177
+ });
178
+
179
+ 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', () => {
180
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
181
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 13.6);
182
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
183
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
184
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(13, 13.6);
185
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
186
+ });
187
+
188
+ 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', () => {
189
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
190
+ fillInTheGapsOverImageTextPage.steps.uncheckRoundDownScoreCheckbox();
191
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
192
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
193
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10.2, 13.6);
194
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
195
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
196
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(13.6, 13.6);
197
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
198
+ });
199
+ });
200
+ });