itemengine-cypress-automation 1.0.85 → 1.0.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/Dockerfile +2 -1
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +30 -30
  3. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  4. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +568 -0
  5. package/cypress/e2e/ILC/EssayResponse/editAndPreviewTabScoringSection.js +86 -0
  6. package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +389 -0
  7. package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +112 -0
  8. package/cypress/e2e/ILC/EssayResponse/headerSection.js +68 -0
  9. package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +290 -0
  10. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +79 -0
  11. package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +379 -0
  12. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
  13. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +115 -0
  14. package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +79 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/partialDifferentWeightsBasic.js +159 -0
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +507 -29
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +6 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +272 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +300 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +204 -0
  22. package/cypress/e2e/ILC/Protractor/protractorEditTabBasicsSection.js +4 -4
  23. package/cypress/e2e/ILC/Protractor/protractorEditTabFunctionality.js +1 -1
  24. package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +4 -4
  25. package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -1
  26. package/cypress/e2e/ILC/SingleSelection/editTabScoringSection.js +1 -3
  27. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +205 -0
  28. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +259 -0
  29. package/cypress/e2e/ILC/TextEntryMath/evaluationMethods2.js +217 -0
  30. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +202 -0
  31. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +613 -0
  32. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +71 -0
  33. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +318 -318
  34. package/cypress/fixtures/theme/ilc.json +3 -0
  35. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -2
  36. package/cypress/pages/components/colorPopupComponent.js +26 -3
  37. package/cypress/pages/components/createCustomCategoryFlyout.js +351 -46
  38. package/cypress/pages/components/customizeSpecialCharacterComponent.js +165 -0
  39. package/cypress/pages/components/equationEditorFlyout.js +124 -0
  40. package/cypress/pages/components/essayResponseCommonComponents.js +3 -0
  41. package/cypress/pages/components/figOverImageCanvasComponent.js +316 -7
  42. package/cypress/pages/components/index.js +3 -1
  43. package/cypress/pages/components/opacityComponent.js +31 -4
  44. package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +1 -0
  45. package/cypress/pages/components/specialCharactersFlyoutComponent.js +1 -0
  46. package/cypress/pages/drawingResponsePage.js +33 -138
  47. package/cypress/pages/essayResponsePage.js +612 -26
  48. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +48 -7
  49. package/cypress/pages/fillInTheGapsOverImageTextPage.js +267 -13
  50. package/package.json +1 -1
@@ -0,0 +1,259 @@
1
+ import { textEntryMathPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create item page - Text entry math: Scoring section', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Scoring section contents', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ textEntryMathPage.tests.verifyScoringTypeLabelAndDropdown('Auto scored');
19
+
20
+ textEntryMathPage.tests.verifyScoringSubtypeContentsForMultipleResponseTypeQuestion();
21
+ });
22
+
23
+ describe('Auto scored: All or nothing scoring - Scoring section', () => {
24
+ abortEarlySetup();
25
+ before(() => {
26
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
27
+ cy.barsPreLoaderWait();
28
+ });
29
+
30
+ it('When the user has selected \'All or nothing\' scoring subtype, minimum scoring dropdown should be displayed in the scoring section', () => {
31
+ textEntryMathPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
32
+ });
33
+ });
34
+
35
+ describe('Auto scored: All or nothing scoring - Specify correct answer section', () => {
36
+ abortEarlySetup();
37
+ before(() => {
38
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
39
+ cy.barsPreLoaderWait();
40
+ });
41
+
42
+ textEntryMathPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
43
+
44
+ textEntryMathPage.tests.verifyPointsLabelAndInputField();
45
+ });
46
+
47
+ describe('Auto scored: Partial - equal weights scoring - Scoring section', () => {
48
+ abortEarlySetup();
49
+ before(() => {
50
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
51
+ cy.barsPreLoaderWait();
52
+ });
53
+
54
+ it('User should be able to select \'Partial - equal weights\' scoring type', () => {
55
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
56
+ });
57
+
58
+ it('When the user has switched to \'Partial - equal weights\' scoring, then \'Penalty scoring\', \'Minimum scoring\' and \'Rounding\' label and dropdown should be displayed in the \'Scoring\' section, \'Round negative scores to zero\' label and checkbox should not be displayed in the \'Scoring\' section', () => {
59
+ textEntryMathPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
60
+ textEntryMathPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
61
+ textEntryMathPage.steps.verifyRoundingLabelAndDropdownDefaultState();
62
+ utilities.verifyElementVisibilityState(textEntryMathPage.roundNegativeScoresToZeroCheckbox(), 'notExist');
63
+ });
64
+ });
65
+
66
+ describe('Auto scored: Partial - equal weights scoring - Specify correct answer section', () => {
67
+ abortEarlySetup();
68
+ before(() => {
69
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
70
+ cy.barsPreLoaderWait();
71
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
72
+ });
73
+
74
+ textEntryMathPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
75
+
76
+ it('When no points are entered in the points input field, then points per response should not be displayed on the response accordion', () => {
77
+ utilities.verifyElementVisibilityState(textEntryMathPage.responseAccordionPointsWrapper(), 'notExist');
78
+ });
79
+
80
+ it('When the user gives a score input to \'Points\' input field, then the score should be equally divided and displayed on each response tab with a \'Points:\' label', () => {
81
+ textEntryMathPage.steps.allotPoints(4);
82
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(0, 2);
83
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(1, 2);
84
+ });
85
+
86
+ it('When the user adds one more response token, then points per response should get updated accordingly', () => {
87
+ textEntryMathPage.steps.addResponseToken();
88
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(0, 1.33);
89
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(1, 1.33);
90
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(2, 1.33);
91
+ });
92
+
93
+ it('When the user deletes a response token, then points per response should get updated accordingly', () => {
94
+ textEntryMathPage.steps.deleteAResponseToken(0);
95
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(0, 2);
96
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(1, 2);
97
+ });
98
+
99
+ it('When user adds and alternate answer field in a response accordion, then the points per response accordion should not be updated', () => {
100
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
101
+ textEntryMathPage.steps.addAlternateAnswerInResponseAccordion(0);
102
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(0, 2);
103
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(1, 2);
104
+ });
105
+
106
+ it('When the user switches to \'All or nothing\' scoring, then the points on each response accordion should not be displayed a and the points displayed in \'Points\' input field should remain unchanged', () => {
107
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('All or nothing');
108
+ utilities.verifyElementVisibilityState(textEntryMathPage.responseAccordionPointsWrapper(), 'notExist');
109
+ textEntryMathPage.steps.verifyPointsFieldValue(4);
110
+ });
111
+
112
+ it('When the user updates the entered points in \'All or nothing\' scoring type and switches to \'Partial equal weights\' scoring type, then the points should be equally divided and displayed on each response accordion', () => {
113
+ textEntryMathPage.steps.allotPoints(9);
114
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
115
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(0, 4.5);
116
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(1, 4.5);
117
+ });
118
+
119
+ it('CSS of \'Points:\' label and its displayed score', { tags: 'css' }, () => {
120
+ utilities.verifyCSS(textEntryMathPage.responseAccordionPointsLabel(), {
121
+ 'color': css.color.labels,
122
+ 'font-size': css.fontSize.normal,
123
+ 'font-weight': css.fontWeight.semibold
124
+ });
125
+ utilities.verifyCSS(textEntryMathPage.responseAccordionPointsScore(), {
126
+ 'color': css.color.text,
127
+ 'font-size': css.fontSize.default,
128
+ 'font-weight': css.fontWeight.regular
129
+ });
130
+ });
131
+ });
132
+
133
+ describe('Auto scored: Partial - different weights scoring - Scoring section', () => {
134
+ abortEarlySetup();
135
+ before(() => {
136
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
137
+ cy.barsPreLoaderWait();
138
+ });
139
+
140
+ it('User should be able to select \'Partial - different weights\' scoring', () => {
141
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
142
+ });
143
+
144
+ it('When the user has switched to \'Partial - different weights\' scoring, then \'Penalty scoring\', \'Minimum scoring\' and \'Rounding\' labels and dropdowns, \'Round negative scores to zero\' label and checkbox should not be displayed in the \'Scoring\' section', () => {
145
+ textEntryMathPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
146
+ textEntryMathPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
147
+ textEntryMathPage.steps.verifyRoundingLabelAndDropdownDefaultState();
148
+ utilities.verifyElementVisibilityState(textEntryMathPage.roundNegativeScoresToZeroCheckbox(), 'notExist');
149
+ });
150
+ });
151
+
152
+ describe('Auto scored: Partial - different weights scoring - Specify correct answer section', () => {
153
+ abortEarlySetup();
154
+ before(() => {
155
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
156
+ cy.barsPreLoaderWait();
157
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
158
+ });
159
+
160
+ textEntryMathPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
161
+
162
+ it('When the user has switched to \'Partial - different weights\' scoring, then the correct answer tab points input field should not be displayed and individual empty points input field should be displayed in each response accordion', () => {
163
+ utilities.verifyElementVisibilityState(textEntryMathPage.pointsLabel(), 'hidden');
164
+ cy.log('Expand response accordions')
165
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
166
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
167
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(0, '');
168
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(1, '');
169
+ utilities.verifyElementCount(textEntryMathPage.pointsInputField(), 2);
170
+ });
171
+
172
+ it('User should be able to set points in the \'Points\' input fields', () => {
173
+ textEntryMathPage.steps.allotPointsInResponseAccordion(0, 1);
174
+ textEntryMathPage.steps.allotPointsInResponseAccordion(1, 3);
175
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(0, 1);
176
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(1, 3);
177
+ });
178
+
179
+ it('CSS of \'Points\' label and \'Points\' input field in response accordion', { tags: 'css' }, () => {
180
+ utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.pointsLabel(), 0), {
181
+ 'color': css.color.labels,
182
+ 'font-size': css.fontSize.normal,
183
+ 'font-weight': css.fontWeight.semibold
184
+ });
185
+ utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.pointsInputField(), 0), {
186
+ 'color': css.color.text,
187
+ 'font-size': css.fontSize.default,
188
+ 'font-weight': css.fontWeight.regular
189
+ });
190
+ });
191
+
192
+ it('When the user switches to \'All or nothing\' scoring, the points added for individual responses in Partial - different weights scoring should get summed up in the \'All or nothing scoring\' points input field', () => {
193
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('All or nothing');
194
+ textEntryMathPage.steps.verifyPointsFieldValue(4);
195
+ });
196
+
197
+ it('When the user updates the entered points in \'All or nothing\' scoring type and switches to \'Partial different weights\' scoring type, then the points should be equally divided and displayed besides each correct option', () => {
198
+ textEntryMathPage.steps.allotPoints(9);
199
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
200
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(0, 4.5);
201
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(1, 4.5);
202
+ });
203
+ });
204
+
205
+ describe('Manually scored scoring - Scoring section', () => {
206
+ abortEarlySetup();
207
+ before(() => {
208
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
209
+ cy.barsPreLoaderWait();
210
+ });
211
+
212
+ it('User should be able to select \'Manually scored\' scoring type from scoring type dropdown', () => {
213
+ textEntryMathPage.steps.expandScoringTypeDropdown();
214
+ textEntryMathPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
215
+ });
216
+
217
+ it('When the user has selected \'Manually scored\' scoring type, then the specify correct answer section should not be displayed', () => {
218
+ utilities.verifyElementVisibilityState(textEntryMathPage.specifyCorrectAnswerLabel(), 'notExist');
219
+ utilities.verifyElementVisibilityState(textEntryMathPage.specifyCorrectAnswerSectionWrapper(), 'notExist');
220
+ });
221
+
222
+ textEntryMathPage.tests.verifyScoringSectionContentsForManuallyScoredScoringType();
223
+
224
+ textEntryMathPage.tests.verifyPointsFieldErrorState();
225
+
226
+ it('When user has selected \'Manually scored\' scoring type, then in scoring section \'Minimum scoring\' label and dropdown should be visible', () => {
227
+ textEntryMathPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
228
+ });
229
+ });
230
+
231
+ describe('Non scored scoring - Scoring section', () => {
232
+ abortEarlySetup();
233
+ before(() => {
234
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
235
+ cy.barsPreLoaderWait();
236
+ });
237
+
238
+ it('User should be able to select \'Non scored\' scoring type from scoring type dropdown', () => {
239
+ textEntryMathPage.steps.expandScoringTypeDropdown();
240
+ textEntryMathPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
241
+ });
242
+
243
+ textEntryMathPage.tests.verifyScoringSectionContentsForNonScoredScoringType();
244
+ });
245
+
246
+ describe('Non scored scoring - Specify correct answer section', () => {
247
+ abortEarlySetup();
248
+ before(() => {
249
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
250
+ cy.barsPreLoaderWait();
251
+ textEntryMathPage.steps.expandScoringTypeDropdown();
252
+ textEntryMathPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
253
+ });
254
+
255
+ textEntryMathPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
256
+
257
+ textEntryMathPage.tests.verifyPointsLabelAndInputFieldForNonScoredScoringType();
258
+ });
259
+ });
@@ -0,0 +1,217 @@
1
+ import { textEntryMathPage } from "../../../pages";
2
+ import { equationEditorFlyout } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+ describe('Create item page - Text entry math: All or nothing scoring', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Evaluation methods: Value is equivalent', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
16
+ cy.barsPreLoaderWait();
17
+ textEntryMathPage.steps.addTextInQuestionInstructionsInputField('Value is equivalent: Response inputted needs to be equivalent but can be represented differently to be marked correct');
18
+ textEntryMathPage.steps.clearQuestionInputField();
19
+ textEntryMathPage.steps.addInputToQuestionInputField('A circle has radius 7cm, it\'s perimeter is')
20
+ textEntryMathPage.steps.addResponseToken();
21
+ textEntryMathPage.steps.allotPoints(20);
22
+ });
23
+
24
+ it('When \'Value is equivalent\' evaluation method is selected then the user should be able to enter question instruction, question text and set the correct response', () => {
25
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
26
+ textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, '43.9822971503');
27
+ textEntryMathPage.steps.switchToPreviewTab();
28
+ });
29
+
30
+ it('When the user attempts the question exactly correct (same as the answer set in \'Specify correct answer\' section) on switching to \'Grading view\' correct icons should be displayed beside the responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
31
+ textEntryMathPage.steps.resetQuestionPreview();
32
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
33
+ equationEditorFlyout.steps.enterTextInPreviewInputField('43.9822971503');
34
+ equationEditorFlyout.steps.clickOnOkButton();
35
+ textEntryMathPage.steps.switchToGradingView();
36
+ textEntryMathPage.steps.verifyCorrectResponseIcon(0);
37
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
38
+ });
39
+
40
+ it('When the user attempts the question which yields the same result but using appropriate symbols then on switching to \'Grading view\' correct icons should be displayed beside the responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
41
+ textEntryMathPage.steps.resetQuestionPreview();
42
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
43
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'keypad', symbolName: ['two', 'multiply', 'seven', 'multiply'] }, { categoryName: 'greek', symbolName: ['pi'] }]);
44
+ equationEditorFlyout.steps.clickOnOkButton();
45
+ textEntryMathPage.steps.switchToGradingView();
46
+ textEntryMathPage.steps.verifyCorrectResponseIcon(0);
47
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
48
+ });
49
+
50
+ it('When the user attempts the question using cube roots on switching to \'Grading view\' correct icons should be displayed beside the responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
51
+ textEntryMathPage.steps.resetQuestionPreview();
52
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
53
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'basic', symbolName: ['cubeRoot'] }]);
54
+ equationEditorFlyout.steps.enterTextAtInputFieldCursor('85081.223211');
55
+ equationEditorFlyout.steps.clickOnOkButton();
56
+ textEntryMathPage.steps.switchToGradingView();
57
+ textEntryMathPage.steps.verifyCorrectResponseIcon(0);
58
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
59
+ });
60
+
61
+ it('When the user attempts the question using approximate value of pi then switching to \'Grading view\' incorrect icon should be displayed beside the response, a status message with text \'Your answer is incorrect\' should be displayed and correct answer section should be displayed', () => {
62
+ textEntryMathPage.steps.resetQuestionPreview();
63
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
64
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'keypad', symbolName: ['two', 'multiply', 'seven', 'multiply'] }]);
65
+ equationEditorFlyout.steps.enterTextInPreviewInputField('3.14');
66
+ equationEditorFlyout.steps.clickOnOkButton();
67
+ textEntryMathPage.steps.switchToGradingView();
68
+ textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
69
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
70
+ });
71
+
72
+ it('User should be able to switch to edit tab and change the equation', () => {
73
+ textEntryMathPage.steps.switchToEditTab();
74
+ textEntryMathPage.steps.clearQuestionInputField();
75
+ textEntryMathPage.steps.addInputToQuestionInputField('Use a square minus b square identity and simplify where a=7 and b=5')
76
+ textEntryMathPage.steps.addResponseToken();
77
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
78
+ textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, '(7-2)(7+2)');
79
+ textEntryMathPage.steps.switchToPreviewTab();
80
+ });
81
+
82
+ it('When the user attempts the question correct on switching to \'Grading\' view, correct icon should be displayed besides the correct answer response, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
83
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
84
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'keypad', symbolName: ['four', 'five'] }]);
85
+ equationEditorFlyout.steps.clickOnOkButton();
86
+ textEntryMathPage.steps.switchToGradingView();
87
+ textEntryMathPage.steps.verifyCorrectResponseIcon(0);
88
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
89
+ });
90
+
91
+ it('When the user attempts the question correctly using parenthesis then on switching to \'Grading view\' correct icons should be displayed beside the responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should be displayed', () => {
92
+ textEntryMathPage.steps.resetQuestionPreview();
93
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
94
+ equationEditorFlyout.steps.enterTextInPreviewInputField('7(7-2)+2(7-2)');
95
+ equationEditorFlyout.steps.clickOnOkButton();
96
+ textEntryMathPage.steps.switchToGradingView();
97
+ textEntryMathPage.steps.verifyCorrectResponseIcon(0);
98
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
99
+ });
100
+
101
+ it('When the user attempts the question correctly using fractions then on switching to \'Grading view\' correct icons should be displayed beside the responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should be displayed', () => {
102
+ textEntryMathPage.steps.resetQuestionPreview();
103
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
104
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'basic', symbolName: ['fraction'] }, { categoryName: 'keypad', symbolName: ['four', 'zero', 'five'] }]);
105
+ equationEditorFlyout.steps.enterTextInFirstEmptyBox(['9']);
106
+ equationEditorFlyout.steps.clickOnOkButton();
107
+ textEntryMathPage.steps.switchToGradingView();
108
+ textEntryMathPage.steps.verifyCorrectResponseIcon(0);
109
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
110
+ });
111
+ });
112
+
113
+ describe('Evaluation methods: Match exact', () => {
114
+ abortEarlySetup();
115
+ before(() => {
116
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
117
+ cy.barsPreLoaderWait();
118
+ textEntryMathPage.steps.addTextInQuestionInstructionsInputField('Match exact: Response entered needs to be an exact match to be marked correct');
119
+ textEntryMathPage.steps.clearQuestionInputField();
120
+ textEntryMathPage.steps.addInputToQuestionInputField('Match the exact value entered in edit tab')
121
+ textEntryMathPage.steps.addResponseToken();
122
+ textEntryMathPage.steps.selectEvaluationMethod('Match exact')
123
+ textEntryMathPage.steps.allotPoints(20);
124
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
125
+ textEntryMathPage.steps.selectEvaluationMethod('Match exact');
126
+ });
127
+
128
+ it('When the user enters a numeric value in \'Specify correct answer\' response field and then the user enters the exact same value then on switching to \'Grading view\' correct icon should be displayed beside the response, a status message with text \'Your answer is correct\' should be displayed', () => {
129
+ textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer('90');
130
+ textEntryMathPage.steps.switchToPreviewTab();
131
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
132
+ equationEditorFlyout.steps.enterTextInPreviewInputField('90');
133
+ equationEditorFlyout.steps.clickOnOkButton();
134
+ textEntryMathPage.steps.switchToGradingView();
135
+ textEntryMathPage.steps.verifyCorrectResponseIcon(0);
136
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
137
+ });
138
+
139
+ it('When the user enters a numeric value in \'Specify correct answer\' response field and then the user enters the same value along wit decimals then on switching to \'Grading view\' incorrect icon should be displayed beside the response, a status message with text \'Your answer is incorrect\' should be displayed', () => {
140
+ textEntryMathPage.steps.resetQuestionPreview();
141
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
142
+ equationEditorFlyout.steps.enterTextInPreviewInputField('90.00');
143
+ equationEditorFlyout.steps.clickOnOkButton();
144
+ textEntryMathPage.steps.switchToGradingView();
145
+ textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
146
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
147
+ });
148
+
149
+ it('When the user enters a numeric value in \'Specify correct answer\' response field and then the user enters the same value along with decimals then on switching to \'Grading view\' incorrect icon should be displayed beside the response, a status message with text \'Your answer is incorrect\' should be displayed', () => {
150
+ textEntryMathPage.steps.resetQuestionPreview();
151
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
152
+ equationEditorFlyout.steps.enterTextInPreviewInputField('90.00');
153
+ equationEditorFlyout.steps.clickOnOkButton();
154
+ textEntryMathPage.steps.switchToGradingView();
155
+ textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
156
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
157
+ });
158
+
159
+ it('When the user enters a numeric value in \'Specify correct answer\' response field and then the user enters the same value along with percentage then on switching to \'Grading view\' incorrect icon should be displayed beside the response, a status message with text \'Your answer is incorrect\' should be displayed', () => {
160
+ textEntryMathPage.steps.resetQuestionPreview();
161
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
162
+ equationEditorFlyout.steps.enterTextInPreviewInputField('9000%');
163
+ equationEditorFlyout.steps.clickOnOkButton();
164
+ textEntryMathPage.steps.switchToGradingView();
165
+ textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
166
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
167
+ });
168
+
169
+ it('When the user enters a numeric value in \'Specify correct answer\' response field and then the user enters the same value along with percentage then on switching to \'Grading view\' incorrect icon should be displayed beside the response, a status message with text \'Your answer is incorrect\' should be displayed', () => {
170
+ textEntryMathPage.steps.resetQuestionPreview();
171
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
172
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'keypad', symbolName: ['three', 'zero'] }, { categoryName: 'basic', symbolName: ['square'] }]);
173
+ equationEditorFlyout.steps.clickOnOkButton();
174
+ textEntryMathPage.steps.switchToGradingView();
175
+ textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
176
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
177
+ });
178
+
179
+ it('When the user enters a fraction value in \'Specify correct answer\' response field and then the user enters the exact same value then on switching to \'Grading view\' correct icon should be displayed beside the response, a status message with text \'Your answer is correct\' should be displayed', () => {
180
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(0);
181
+ textEntryMathPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
182
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'basic', symbolName: ['fraction'] }, { categoryName: 'keypad', symbolName: ['four'] }]);
183
+ equationEditorFlyout.steps.enterTextInFirstEmptyBox(['3']);
184
+ textEntryMathPage.steps.switchToPreviewTab();
185
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
186
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'basic', symbolName: ['fraction'] }, { categoryName: 'keypad', symbolName: ['four'] }]);
187
+ equationEditorFlyout.steps.enterTextInFirstEmptyBox(['3']);
188
+ equationEditorFlyout.steps.clickOnOkButton();
189
+ textEntryMathPage.steps.switchToGradingView();
190
+ textEntryMathPage.steps.verifyCorrectResponseIcon(0);
191
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
192
+ });
193
+
194
+ it('When the user enters a fraction value in \'Specify correct answer\' response field and then the user enters the fraction which yields the same value but is not the exact form then on switching to \'Grading view\' incorrect icon should be displayed beside the response, a status message with text \'Your answer is correct\' should be displayed', () => {
195
+ textEntryMathPage.steps.resetQuestionPreview();
196
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
197
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'basic', symbolName: ['fraction'] }, { categoryName: 'keypad', symbolName: ['one', 'six'] }]);
198
+ equationEditorFlyout.steps.enterTextInFirstEmptyBox(['12']);
199
+ equationEditorFlyout.steps.clickOnOkButton();
200
+ textEntryMathPage.steps.switchToGradingView();
201
+ textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
202
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
203
+ });
204
+
205
+ it('When the user enters a fraction value in \'Specify correct answer\' response field and then the user enters the mixed fraction which yields the same value but is not the exact form then on switching to \'Grading view\' incorrect icon should be displayed beside the response, a status message with text \'Your answer is incorrect\' should be displayed', () => {
206
+ textEntryMathPage.steps.resetQuestionPreview();
207
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
208
+ equationEditorFlyout.steps.enterTextInPreviewInputField('1');
209
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'basic', symbolName: ['mixedFraction'] }]);
210
+ equationEditorFlyout.steps.enterTextInFirstEmptyBox(['1', '3']);
211
+ equationEditorFlyout.steps.clickOnOkButton();
212
+ textEntryMathPage.steps.switchToGradingView();
213
+ textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
214
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
215
+ });
216
+ });
217
+ });