itemengine-cypress-automation 1.0.113 → 1.0.114

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.js +489 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.js +482 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +488 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +92 -0
  5. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +229 -0
  6. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  7. package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +67 -0
  8. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -1
  9. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +11 -11
  10. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +529 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +108 -190
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +83 -155
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +104 -315
  14. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +121 -135
  15. package/cypress/e2e/ILC/EssayResponseMath/createItem.js +17 -0
  16. package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +203 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +121 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +236 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsBasic.js +255 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +237 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +236 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  23. package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +43 -0
  24. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +187 -0
  25. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
  26. package/cypress/e2e/ILC/ShortTextResponseNew/checkAnswerFunctionalityForAllViews.smoke.js +99 -0
  27. package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +97 -0
  28. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +74 -0
  29. package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +83 -0
  30. package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +109 -0
  31. package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +66 -0
  32. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +326 -0
  33. package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +163 -0
  34. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +8 -8
  35. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +3 -3
  36. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +154 -0
  37. package/cypress/pages/audioResponsePage.js +523 -66
  38. package/cypress/pages/components/autoScoredScoringPreviewTab.js +2 -0
  39. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +6 -5
  40. package/cypress/pages/components/equationEditorFlyout.js +11 -0
  41. package/cypress/pages/components/essayResponseCommonComponents.js +290 -19
  42. package/cypress/pages/components/maximumRecorderLengthComponent.js +32 -15
  43. package/cypress/pages/components/playbackControlsBaseComponent.js +9 -1
  44. package/cypress/pages/components/questionInputFieldComponent.js +0 -7
  45. package/cypress/pages/essayResponseBasicPage.js +1 -26
  46. package/cypress/pages/essayResponsePage.js +21 -284
  47. package/cypress/pages/shortTextResponsePage.js +142 -103
  48. package/cypress/pages/textEntryMathPage.js +58 -7
  49. package/package.json +1 -1
@@ -0,0 +1,245 @@
1
+ import { shortTextResponsePage } from "../../../pages/shortTextResponsePage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create item page - Single selection: All or nothing with alternative answer', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Correct answer\' points are more than \'Alternative answer\' points', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
14
+ cy.barsPreLoaderWait();
15
+ shortTextResponsePage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
16
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
17
+ shortTextResponsePage.steps.allotPoints(20);
18
+ shortTextResponsePage.steps.clickOnAddAlternativeAnswerButton();
19
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Fossil fuel combustion');
20
+ shortTextResponsePage.steps.allotPoints(10);
21
+ shortTextResponsePage.steps.checkAllowStudentToCheckAnswerCheckbox();
22
+ shortTextResponsePage.steps.switchToPreviewTab();
23
+ });
24
+
25
+ //TODO: need to fix it after https://redmine.zeuslearning.com/issues/561054 is resolved
26
+ it('When the user selects \'Grading\' view without attempting the question then incorrect answer border and correct answer section should be displayed and correct/incorrect icons should not be displayed', () => {
27
+ shortTextResponsePage.steps.switchToGradingView();
28
+ shortTextResponsePage.steps.verifyCorrectIncorrectIconNotVisibleGradingView();
29
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
30
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
31
+ shortTextResponsePage.steps.switchToStudentView();
32
+ });
33
+
34
+ it('When the user attempts the question with response from the correct accordion, then the user should be awarded with points specified for correct accordion and on switching to \'Grading\' view, correct icon and correct answer border should be displayed and correct answer section should not be displayed', () => {
35
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
36
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
37
+ shortTextResponsePage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
38
+ shortTextResponsePage.steps.switchToGradingView();
39
+ shortTextResponsePage.steps.verifyCorrectIcon();
40
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
41
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
42
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
43
+ cy.log('When the user has attempted the question with response from the correct accordion and clicks on \'Check answer\' button, then correct icon and correct answer border should be displayed in the question preview')
44
+ shortTextResponsePage.steps.checkAnswer();
45
+ shortTextResponsePage.steps.verifyCorrectIcon();
46
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
47
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
48
+ });
49
+
50
+ shortTextResponsePage.tests.verifyPointsCorrectAnswerLabelAndBorderCSSAndA11y('short text response');
51
+
52
+ it('When the user attempts the question with response from the alternative accordion, then the user should be awarded with points specified for alternative accordion (less than overall points) and on switching to \'Grading\' view, correct icon should be displayed beside response input field and correct answer border be displayed and correct answer section should not be displayed', () => {
53
+ shortTextResponsePage.steps.resetQuestionPreview();
54
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil fuel combustion');
55
+ shortTextResponsePage.steps.verifyPreviewScore(10, 20);
56
+ shortTextResponsePage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
57
+ shortTextResponsePage.steps.switchToGradingView();
58
+ shortTextResponsePage.steps.verifyCorrectIcon();
59
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
60
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
61
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
62
+ cy.log('When the user has attempted the question with response from the alternative accordion and clicks on \'Check answer\' button, then correct icon should only be displayed beside response input field and correct answer border should be displayed in question preview');
63
+ shortTextResponsePage.steps.checkAnswer();
64
+ shortTextResponsePage.steps.verifyCorrectIcon();
65
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
66
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
67
+ });
68
+
69
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed beside response input field, incorrect answer border and correct answer section should be displayed in question preview', () => {
70
+ shortTextResponsePage.steps.resetQuestionPreview();
71
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect answer');
72
+ shortTextResponsePage.steps.verifyPreviewScore(0, 20);
73
+ shortTextResponsePage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
74
+ shortTextResponsePage.steps.switchToGradingView();
75
+ shortTextResponsePage.steps.verifyIncorrectIcon();
76
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
77
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
78
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
79
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icon should be displayed beside response input field and incorrect answer border should not be displayed in question preview')
80
+ shortTextResponsePage.steps.checkAnswer();
81
+ shortTextResponsePage.steps.verifyIncorrectIcon();
82
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
83
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
84
+ });
85
+
86
+ shortTextResponsePage.tests.verifyIncorrectAnswerLabelAndBorderCSSAndA11y('single selection');
87
+
88
+ it('When the user sets \'Award minimum score only if attempted\' in minimum scoring dropdown and allots minimum points such that minimum points are less than alternative answer points, then attempts the question with response from the alternative accordion, the user should be awarded with alternative answer points', () => {
89
+ shortTextResponsePage.steps.switchToEditTab();
90
+ shortTextResponsePage.steps.expandMinimumScoringDropdown();
91
+ shortTextResponsePage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
92
+ shortTextResponsePage.steps.allotMinimumPoints(3);
93
+ shortTextResponsePage.steps.switchToPreviewTab();
94
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil fuel combustion');
95
+ shortTextResponsePage.steps.verifyPreviewScore(10, 20);
96
+ });
97
+
98
+ it('When the user sets minimum points such that minimum points are greater than alternative answer points, then attempts the question with response from the alternative accordion, the user should be awarded with minimum points', () => {
99
+ shortTextResponsePage.steps.switchToEditTab();
100
+ shortTextResponsePage.steps.allotMinimumPoints(13);
101
+ shortTextResponsePage.steps.switchToPreviewTab();
102
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil fuel combustion');
103
+ shortTextResponsePage.steps.verifyPreviewScore(13, 20);
104
+ });
105
+ });
106
+
107
+ describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Alternative answer\' points are more than \'Correct answer\' points', () => {
108
+ abortEarlySetup();
109
+ before(() => {
110
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
111
+ cy.barsPreLoaderWait();
112
+ shortTextResponsePage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
113
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
114
+ shortTextResponsePage.steps.allotPoints(10);
115
+ shortTextResponsePage.steps.clickOnAddAlternativeAnswerButton();
116
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Fossil fuel combustion');
117
+ shortTextResponsePage.steps.allotPoints(20);
118
+ shortTextResponsePage.steps.checkAllowStudentToCheckAnswerCheckbox();
119
+ shortTextResponsePage.steps.switchToPreviewTab();
120
+ });
121
+
122
+ //TODO: need to fix it after https://redmine.zeuslearning.com/issues/561054 is resolved
123
+ it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed and answer input field should have incorrect answer border and correct answer section should be displayed below response input field', () => {
124
+ shortTextResponsePage.steps.switchToGradingView();
125
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
126
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Fossil fuel combustion');
127
+ shortTextResponsePage.steps.switchToStudentView();
128
+ });
129
+
130
+ it('When the user attempts the question with response from the correct accordion, then the user should be awarded with points specified for correct accordion (less than overall points) and on switching to \'Grading\' view, correct icon should be displayed beside response input field, correct answer border should be displayed and correct answer section should not be displayed', () => {
131
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
132
+ shortTextResponsePage.steps.verifyPreviewScore(10, 20);
133
+ shortTextResponsePage.steps.switchToGradingView();
134
+ shortTextResponsePage.steps.verifyCorrectIcon();
135
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
136
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
137
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
138
+ cy.log('When the user has attempted the question with response from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed beside correct response input field, correct answer border should be displayed in question preview')
139
+ shortTextResponsePage.steps.checkAnswer();
140
+ shortTextResponsePage.steps.verifyCorrectIcon();
141
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
142
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
143
+ });
144
+
145
+ it('When the user attempts the question with response from the alternative accordion, then the user should be awarded with points specified for alternative accordion and on switching to \'Grading\' view, correct icon should be displayed beside response input field, correct answer border should be displayed and correct answer section should not be displayed', () => {
146
+ shortTextResponsePage.steps.resetQuestionPreview();
147
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil fuel combustion');
148
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
149
+ shortTextResponsePage.steps.switchToGradingView();
150
+ shortTextResponsePage.steps.verifyCorrectIcon();
151
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
152
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
153
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
154
+ cy.log('When the user has attempted the question with response input field from the alternative accordion and clicks on \'Check answer\' button, then correct icon should beside response input field and correct answer border should be displayed in the question preview')
155
+ shortTextResponsePage.steps.checkAnswer();
156
+ shortTextResponsePage.steps.verifyCorrectIcon();
157
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
158
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
159
+ });
160
+
161
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed beside response input field, incorrect answer border and correct answer section should be displayed', () => {
162
+ shortTextResponsePage.steps.resetQuestionPreview();
163
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil');
164
+ shortTextResponsePage.steps.verifyPreviewScore(0, 20);
165
+ shortTextResponsePage.steps.switchToGradingView();
166
+ shortTextResponsePage.steps.verifyIncorrectIcon();
167
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
168
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Fossil fuel combustion');
169
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
170
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icon should be displayed beside response input field and incorrect answer border should be displayed question preview')
171
+ shortTextResponsePage.steps.checkAnswer();
172
+ shortTextResponsePage.steps.verifyIncorrectIcon();
173
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
174
+ });
175
+ });
176
+
177
+ describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Correct answer\' points is equal to \'Alternative answer\' points', () => {
178
+ abortEarlySetup();
179
+ before(() => {
180
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
181
+ cy.barsPreLoaderWait();
182
+ shortTextResponsePage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
183
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
184
+ shortTextResponsePage.steps.allotPoints(20);
185
+ shortTextResponsePage.steps.clickOnAddAlternativeAnswerButton();
186
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Fossil fuel combustion');
187
+ shortTextResponsePage.steps.allotPoints(20);
188
+ shortTextResponsePage.steps.checkAllowStudentToCheckAnswerCheckbox();
189
+ shortTextResponsePage.steps.switchToPreviewTab();
190
+ });
191
+
192
+ //TODO: need to fix it after https://redmine.zeuslearning.com/issues/561054 is resolved
193
+ it('When the user switches to \'Grading\' view without attempting the question, then incorrect border and correct answer section should be displayed', () => {
194
+ shortTextResponsePage.steps.switchToGradingView();
195
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
196
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
197
+ shortTextResponsePage.steps.switchToStudentView();
198
+ });
199
+
200
+ it('When the user attempts the question with response from the correct accordion, then the user should be awarded with points specified for correct accordion and on switching to \'Grading\' view, correct icon should be displayed beside response input field, correct answer border should be displayed and correct answer section should not be displayed', () => {
201
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
202
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
203
+ shortTextResponsePage.steps.switchToGradingView();
204
+ shortTextResponsePage.steps.verifyCorrectIcon();
205
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
206
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
207
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
208
+ cy.log('When the user has attempted the question with response input field from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed beside response input field and correct answer border should be displayed in question preview')
209
+ shortTextResponsePage.steps.checkAnswer();
210
+ shortTextResponsePage.steps.verifyCorrectIcon();
211
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
212
+ });
213
+
214
+ it('When the user attempts the question with response from the alternative accordion, then the user should be awarded with points specified for alternative accordion (same as correct answer points) and on switching to \'Grading\' view, correct icon should only be displayed beside response input field, correct answer border and correct answer section should not be displayed in question preview', () => {
215
+ shortTextResponsePage.steps.resetQuestionPreview();
216
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil fuel combustion');
217
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
218
+ shortTextResponsePage.steps.switchToGradingView();
219
+ shortTextResponsePage.steps.verifyCorrectIcon();
220
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
221
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
222
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
223
+ cy.log('When the user has attempted the question with response input field from the alternative accordion and clicks on \'Check answer\' button, then correct icon should only be displayed beside response input field and correct answer border should be displayed in question preview')
224
+ shortTextResponsePage.steps.checkAnswer();
225
+ shortTextResponsePage.steps.verifyCorrectIcon();
226
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
227
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
228
+ });
229
+
230
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed beside response input field, incorrect answer border and correct answer section should be displayed in question preview', () => {
231
+ shortTextResponsePage.steps.resetQuestionPreview();
232
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect');
233
+ shortTextResponsePage.steps.verifyPreviewScore(0, 20);
234
+ shortTextResponsePage.steps.switchToGradingView();
235
+ shortTextResponsePage.steps.verifyIncorrectIcon();
236
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
237
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
238
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
239
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icon should only be displayed beside incorrect response input field, correct icon should not be displayed beside unattempted correct options, incorrect answer border and a label should not be displayed in question preview')
240
+ shortTextResponsePage.steps.checkAnswer();
241
+ shortTextResponsePage.steps.verifyIncorrectIcon();
242
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
243
+ });
244
+ });
245
+ });
@@ -0,0 +1,99 @@
1
+ import { shortTextResponsePage, studentViewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ import { itemPreviewPage } from "../../../pages";
5
+ let checkAnswerViews = ['Question preview', 'Item preview', 'Student view'];
6
+ const views = utilities.getViews(checkAnswerViews);
7
+ var itemReferenceID = "";
8
+ const css = Cypress.env('css');
9
+
10
+ describe('Create item page - short text response - Check answer functionality', () => {
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ });
14
+
15
+ views.forEach((view) => {
16
+ const checkAnswer = (view) => {
17
+ switch (view) {
18
+ case checkAnswerViews[0]:
19
+ case checkAnswerViews[1]:
20
+ shortTextResponsePage.steps.checkAnswer();
21
+ break;
22
+ case checkAnswerViews[2]:
23
+ studentViewPage.steps.checkAnswer();
24
+ break;
25
+ default:
26
+ throw new Error(`Unsupported page identifier: ${view}`);
27
+ }
28
+ };
29
+ describe(`Check answer - ${view}`, { tags: 'smoke' }, () => {
30
+ abortEarlySetup();
31
+ before(() => {
32
+ switch (view) {
33
+ case 'Question preview':
34
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
35
+ cy.barsPreLoaderWait();
36
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Transport and buildings');
37
+ shortTextResponsePage.steps.allotPoints(20);
38
+ shortTextResponsePage.steps.checkAllowStudentToCheckAnswerCheckbox();
39
+ shortTextResponsePage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
40
+
41
+ shortTextResponsePage.steps.switchToPreviewTab();
42
+ break;
43
+ case 'Item preview':
44
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
45
+ itemPreviewPage.steps.switchToPreviewTab();
46
+ break;
47
+ case 'Student view':
48
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
49
+ break;
50
+ }
51
+ });
52
+
53
+ beforeEach(() => {
54
+ switch (view) {
55
+ case 'Question preview':
56
+ shortTextResponsePage.steps.switchToStudentView();
57
+ shortTextResponsePage.steps.resetQuestionPreview();
58
+ break;
59
+ case 'Item preview':
60
+ shortTextResponsePage.steps.switchToStudentView();
61
+ itemPreviewPage.steps.resetQuestionPreview();
62
+ break;
63
+ case 'Student view':
64
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
65
+ break;
66
+ }
67
+ });
68
+
69
+ if (view === 'Question preview') {
70
+ after(() => {
71
+ shortTextResponsePage.steps.clickOnSaveQuestionButton();
72
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
73
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
74
+ });
75
+ };
76
+
77
+ it('When the user selects \'Check answer\' button without attempting the question, then correct/incorrect icons, correct/incorrect answer label and border should not be displayed', () => {
78
+ checkAnswer(view);
79
+ shortTextResponsePage.steps.verifyCorrectIncorrectIconsNotExist();
80
+ shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExists();
81
+ });
82
+
83
+ it('When user attempts the question incorrectly and clicks on \'Check answer\' button, then incorrect icon should be displayed besides input field and incorrect answer border should be displayed', () => {
84
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('answer');
85
+ checkAnswer(view);
86
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
87
+ shortTextResponsePage.steps.verifyIncorrectIcon();
88
+ });
89
+
90
+ it('When user attempts the question correctly and clicks on \'Check answer\' button, then correct icon should be displayed besides input field and correct answer border should be displayed', () => {
91
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Transport and buildings');
92
+ checkAnswer(view);
93
+ shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExists();
94
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
95
+ shortTextResponsePage.steps.verifyCorrectIcon();
96
+ });
97
+ });
98
+ });
99
+ });
@@ -0,0 +1,97 @@
1
+ import { shortTextResponsePage } 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 - Short text response: Scoring section', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Scoring section contents', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ shortTextResponsePage.tests.verifyScoringTypeLabelAndDropdown('Auto scored');
19
+ });
20
+
21
+ describe('Auto scored - Scoring section', () => {
22
+ abortEarlySetup();
23
+ before(() => {
24
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
25
+ cy.barsPreLoaderWait();
26
+ });
27
+
28
+ it('When the user has selected \'All or nothing\' scoring subtype, minimum scoring dropdown should be displayed in the scoring section', () => {
29
+ shortTextResponsePage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
30
+ });
31
+ });
32
+
33
+ describe('Auto scored - Specify correct answer section', () => {
34
+ abortEarlySetup();
35
+ before(() => {
36
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
37
+ cy.barsPreLoaderWait();
38
+ });
39
+
40
+ shortTextResponsePage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
41
+
42
+ shortTextResponsePage.tests.verifyPointsLabelAndInputField();
43
+
44
+ shortTextResponsePage.tests.verifyPointsFieldErrorState();
45
+ });
46
+
47
+ describe('Manually Scored scoring - Edit tab', () => {
48
+ abortEarlySetup();
49
+ before(() => {
50
+ cy.log('Add question instructions and options');
51
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
52
+ shortTextResponsePage.steps.addQuestionInstructions();
53
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct');
54
+ });
55
+
56
+ it('When the user selects \'Manually scored\' option from the scoring Type dropdown then the \'Specify correct answer\' section should not be displayed; \'Points\' and \'Minimum scoring\' label and dropdown should be displayed', () => {
57
+ shortTextResponsePage.steps.expandScoringTypeDropdown();
58
+ shortTextResponsePage.steps.selectOptionFromScoringTypeDropdown('Manually scored')
59
+ shortTextResponsePage.steps.verifyDefaultPointsLabelAndInputField();
60
+ shortTextResponsePage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
61
+ utilities.verifyElementVisibilityState(shortTextResponsePage.specifyCorrectAnswerLabel(), 'notExist');
62
+ });
63
+
64
+ shortTextResponsePage.tests.verifyPointsFieldErrorState(10);
65
+ });
66
+
67
+ describe('Non scored scoring - Scoring section', () => {
68
+ abortEarlySetup();
69
+ before(() => {
70
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
71
+ cy.barsPreLoaderWait();
72
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct');
73
+ });
74
+
75
+ it('User should be able to select \'Non scored\' scoring type from scoring type dropdown', () => {
76
+ shortTextResponsePage.steps.expandScoringTypeDropdown();
77
+ shortTextResponsePage.steps.selectOptionFromScoringTypeDropdown('Non scored');
78
+ });
79
+
80
+ shortTextResponsePage.tests.verifyScoringSectionContentsForNonScoredScoringType();
81
+ });
82
+
83
+ describe('Non scored scoring - Specify correct answer section', () => {
84
+ abortEarlySetup();
85
+ before(() => {
86
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
87
+ cy.barsPreLoaderWait();
88
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct');
89
+ shortTextResponsePage.steps.expandScoringTypeDropdown();
90
+ shortTextResponsePage.steps.selectOptionFromScoringTypeDropdown('Non scored');
91
+ });
92
+
93
+ shortTextResponsePage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
94
+
95
+ shortTextResponsePage.tests.verifyPointsLabelAndInputFieldForNonScoredScoringType();
96
+ });
97
+ });
@@ -0,0 +1,74 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { dialogBoxBase, shortTextResponsePage } from "../../../pages";
3
+
4
+ describe('Create item page - Short text response - text: Header section and saving question', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Header section contents', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
13
+ cy.barsPreLoaderWait();
14
+ });
15
+
16
+ shortTextResponsePage.tests.verifyCreateQuestionPageQuestionTypeHeader('Short text response');
17
+ });
18
+
19
+ describe('Tabs section', () => {
20
+ abortEarlySetup();
21
+ before(() => {
22
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
23
+ cy.barsPreLoaderWait();
24
+ });
25
+
26
+ shortTextResponsePage.tests.verifyTabsSection();
27
+ });
28
+
29
+ describe('Cancel button', () => {
30
+ abortEarlySetup();
31
+ before(() => {
32
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
33
+ cy.barsPreLoaderWait();
34
+ });
35
+
36
+ shortTextResponsePage.tests.verifyCancelButton('short text response')
37
+ });
38
+
39
+ describe('Save Question button', () => {
40
+ abortEarlySetup();
41
+ before(() => {
42
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
43
+ cy.barsPreLoaderWait();
44
+ });
45
+
46
+ describe('Validation error messages', () => {
47
+ shortTextResponsePage.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
48
+
49
+ it('Validation error messages should be displayed below required input fields', () => {
50
+ shortTextResponsePage.steps.verifyQuestionInstructionsErrorMessage();
51
+ shortTextResponsePage.steps.verifyPointsFieldErrorMessage();
52
+ shortTextResponsePage.steps.verifyCorrectAnswerErrorMessage();
53
+ });
54
+
55
+ it('Validation error messages should disappear when required input fields are filled', () => {
56
+ shortTextResponsePage.steps.addQuestionInstructions();
57
+ shortTextResponsePage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
58
+ shortTextResponsePage.steps.allotPoints(20);
59
+ shortTextResponsePage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
60
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct');
61
+ shortTextResponsePage.steps.verifyCorrectAnswerErrorMessageIsNotDisplayed();
62
+ });
63
+
64
+ shortTextResponsePage.tests.verifyCreateItemWrapperContentsA11y();
65
+ });
66
+
67
+ describe('Saving a question', () => {
68
+ it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
69
+ shortTextResponsePage.steps.saveAQuestionAndVerifySnackbar();
70
+ });
71
+ shortTextResponsePage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
72
+ });
73
+ });
74
+ });
@@ -0,0 +1,83 @@
1
+ import { shortTextResponsePage } 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 - Short text response: Scoring Section - Manually scored and Non scored', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Question Preview: Manually scored', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ cy.log('Adding question instructions and correct answer response, select Manually scored scoring type and add points for the question');
15
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
16
+ shortTextResponsePage.steps.addQuestionInstructions();
17
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
18
+ shortTextResponsePage.steps.allotPoints(20);
19
+ shortTextResponsePage.steps.expandScoringTypeDropdown();
20
+ shortTextResponsePage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
21
+ cy.log('Switching to Preview tab')
22
+ shortTextResponsePage.steps.switchToPreviewTab();
23
+ });
24
+
25
+ it('In Preview tab, Question Instructions and response field should be displayed', () => {
26
+ shortTextResponsePage.steps.verifyQuestionInstructionsText();
27
+ utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabResponseField(), 'visible');
28
+ });
29
+
30
+ shortTextResponsePage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored');
31
+ });
32
+
33
+ describe('Question Preview: Non scored', () => {
34
+ abortEarlySetup();
35
+ before(() => {
36
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
37
+ shortTextResponsePage.steps.addQuestionInstructions();
38
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
39
+ shortTextResponsePage.steps.expandScoringTypeDropdown();
40
+ shortTextResponsePage.steps.selectOptionFromScoringTypeDropdown('Non scored');
41
+ shortTextResponsePage.steps.checkAllowStudentToCheckAnswerCheckbox();
42
+ shortTextResponsePage.steps.switchToPreviewTab();
43
+ });
44
+
45
+ shortTextResponsePage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
46
+
47
+ it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed and correct answer section should be displayed with the correct answers', () => {
48
+ shortTextResponsePage.steps.switchToGradingView();
49
+ shortTextResponsePage.steps.verifyCorrectIncorrectIconsNotExist();
50
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
51
+ shortTextResponsePage.steps.switchToStudentView();
52
+ });
53
+
54
+ it('When the user attempts the question incorrectly, then on switching to \'Grading\' view, incorrect icon, incorrect answer border should be displayed and correct answer wrapper should be displayed below the response field the question preview', () => {
55
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect');
56
+ shortTextResponsePage.steps.switchToGradingView();
57
+ shortTextResponsePage.steps.verifyIncorrectIcon();
58
+ shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
59
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
60
+ shortTextResponsePage.steps.switchToStudentView();
61
+ cy.log('When the user clicks on \'Check answer\' button, red cross mark icon should be displayed besides the response field, Incorrect answer label and border should not be displayed and no correct answer wrapper should be displayed');
62
+ shortTextResponsePage.steps.checkAnswer();
63
+ shortTextResponsePage.steps.verifyIncorrectIcon();
64
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
65
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
66
+ });
67
+
68
+ it('When user attempts the question correctly, then on switching to \'Grading\' view, then correct icons should be displayed beside correct response and correct answer border should be displayed and correct answer wrapper should not be displayed in the question preview', () => {
69
+ shortTextResponsePage.steps.resetQuestionPreview();
70
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
71
+ shortTextResponsePage.steps.switchToGradingView();
72
+ shortTextResponsePage.steps.verifyCorrectIcon();
73
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
74
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
75
+ shortTextResponsePage.steps.switchToStudentView();
76
+ cy.log('When the user clicks on \'Check answer\' button, then green checkmark icon should be displayed besides response fields, Correct answer label and border should not be displayed and no correct answer container should be displayed and no correct answer container should be displayed')
77
+ shortTextResponsePage.steps.checkAnswer();
78
+ shortTextResponsePage.steps.verifyCorrectIcon();
79
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
80
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
81
+ });
82
+ });
83
+ });