itemengine-cypress-automation 1.0.574-IEI-7071-main-eeacc3d.0 → 1.0.574

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -143,4 +143,71 @@ describe('Create item page - Fill in the gaps over image with dropdown: Partial
143
143
  fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(2, 20);
144
144
  });
145
145
  });
146
+
147
+ describe('Auto scored - Partial equal weights when response container is deleted', () => {
148
+ abortEarlySetup();
149
+ before(() => {
150
+ fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image with dropdown');
151
+ cy.barsPreLoaderWait();
152
+ fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
153
+ fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
154
+ fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(30);
155
+ fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
156
+ fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(50);
157
+ fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
158
+ fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
159
+ fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(2, optionsForDropdown2);
160
+ fillInTheGapsOverImageDropdownPage.steps.removeResponseArea(1);
161
+ fillInTheGapsOverImageDropdownPage.steps.allotPoints(10);
162
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
163
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
164
+ fillInTheGapsOverImageDropdownPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
165
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
166
+ fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
167
+ });
168
+
169
+ it('When the user selects \'Grading\' view without attempting the question, response area numeration should be displayed, correct answers section should be displayed with correct answers and respective response area numeration', () => {
170
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 10);
171
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
172
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
173
+ fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationPreviewTab();
174
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
175
+ });
176
+
177
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect dropdowns, correct/incorrect status message should not be displayed and correct answer section with all correct answers along with numeration should be displayed', () => {
178
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
179
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 10);
180
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
181
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
182
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
183
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
184
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
185
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
186
+ });
187
+
188
+ it('When the user attempts the question partially correct, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, incorrect icon should be displayed besides incorrect dropdowns, correct/incorrect status message should not be displayed and correct answer section with all correct answers along with numeration should be displayed', () => {
189
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
190
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
191
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(5, 10);
192
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
193
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
194
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
195
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
196
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
197
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
198
+ });
199
+
200
+ it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct/incorrect status message and correct answer section should not be displayed', () => {
201
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
202
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
203
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(10, 10);
204
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
205
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
206
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
207
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
208
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
209
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
210
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
211
+ });
212
+ });
146
213
  });
@@ -1,13 +1,10 @@
1
- import { shortTextResponsePage, itemPreviewPage, studentViewPage } from "../../../pages";
1
+ import { shortTextResponsePage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
 
6
6
  const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
7
7
  const clipboardFunctions = ['Cut', 'Copy', 'Paste'];
8
- let correctAnswerViews = ['Question preview', 'Item preview', 'Student view'];
9
- const views = utilities.getViews(correctAnswerViews);
10
- let itemReferenceID = "";
11
8
 
12
9
  describe('Create Item page - Short text response - drag and drop: Additional settings', () => {
13
10
  before(() => {
@@ -68,46 +65,6 @@ describe('Create Item page - Short text response - drag and drop: Additional set
68
65
  });
69
66
  });
70
67
 
71
- describe('Additional settings: Clipboard functions functionality in previewTab', () => {
72
- abortEarlySetup();
73
- before(() => {
74
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
75
- cy.barsPreLoaderWait();
76
- shortTextResponsePage.steps.expandAdditionalSettings();
77
- });
78
-
79
- it('When the user deselects cut option, then when trying to cut the response from the response field, it should not be cut and a warning message as \'Cut option is disabled\' should be displayed', () => {
80
- shortTextResponsePage.steps.unselectClipboardFunctionButton(0);
81
- shortTextResponsePage.steps.switchToPreviewTab();
82
- shortTextResponsePage.steps.enterTextInAnswerInputField('Apple');
83
- shortTextResponsePage.steps.cutTextFromAnswerResponseField();
84
- utilities.verifyInnerText(shortTextResponsePage.warningMessage(), 'Cut is disabled.');
85
- utilities.verifyElementVisibilityState(shortTextResponsePage.warningMessage(), 'visible');
86
- });
87
-
88
- it('When the user deselects copy option, then when trying to cut the response from the response field, it should not be cut and a warning message as \'Copy option is disabled\' should be displayed', () => {
89
- shortTextResponsePage.steps.switchToEditTab();
90
- shortTextResponsePage.steps.unselectClipboardFunctionButton(1);
91
- shortTextResponsePage.steps.selectClipboardFunctionButton(0);
92
- shortTextResponsePage.steps.switchToPreviewTab();
93
- shortTextResponsePage.steps.enterTextInAnswerInputField('Banana');
94
- shortTextResponsePage.steps.copyTextFromAnswerResponseField();
95
- utilities.verifyInnerText(shortTextResponsePage.warningMessage(), 'Copy is disabled.');
96
- utilities.verifyElementVisibilityState(shortTextResponsePage.warningMessage(), 'visible');
97
- });
98
-
99
- it('When the user deselects paste option, then when trying to paste the response from the response field, it should not be pasted and a warning message as \'Paste option is disabled\' should be displayed', () => {
100
- shortTextResponsePage.steps.switchToEditTab();
101
- shortTextResponsePage.steps.unselectClipboardFunctionButton(2);
102
- shortTextResponsePage.steps.selectClipboardFunctionButton(1);
103
- shortTextResponsePage.steps.switchToPreviewTab();
104
- shortTextResponsePage.steps.enterTextInAnswerInputField('Cherry');
105
- shortTextResponsePage.steps.pasteTextFromAnswerResponseField();
106
- utilities.verifyInnerText(shortTextResponsePage.warningMessage(), 'Paste is disabled.');
107
- utilities.verifyElementVisibilityState(shortTextResponsePage.warningMessage(), 'visible');
108
- });
109
- });
110
-
111
68
  describe('Additional settings: Placeholder text', () => {
112
69
  abortEarlySetup();
113
70
  before(() => {
@@ -279,7 +236,7 @@ describe('Create Item page - Short text response - drag and drop: Additional set
279
236
  });
280
237
  });
281
238
  });
282
-
239
+
283
240
  describe('Setting tab: Accessibility section', () => {
284
241
  abortEarlySetup();
285
242
  before(() => {
@@ -413,58 +370,4 @@ describe('Create Item page - Short text response - drag and drop: Additional set
413
370
 
414
371
  shortTextResponsePage.tests.verifyDetailsSection();
415
372
  });
416
-
417
- views.forEach((view) => {
418
- describe(`${view}: Additional Settings: Clipboard functions`, () => {
419
- abortEarlySetup();
420
- before(() => {
421
- switch (view) {
422
- case 'Question preview':
423
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
424
- cy.barsPreLoaderWait();
425
- shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct answer');
426
- shortTextResponsePage.steps.allotPoints(10);
427
- shortTextResponsePage.steps.expandAdditionalSettings();
428
- shortTextResponsePage.steps.deselectAllClipboardFunctionButton();
429
- shortTextResponsePage.steps.switchToPreviewTab();
430
- break;
431
- case 'Item preview':
432
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
433
- itemPreviewPage.steps.switchToPreviewTab();
434
- break;
435
- case 'Student view':
436
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
437
- break;
438
- };
439
- });
440
-
441
- beforeEach(() => {
442
- switch (view) {
443
- case 'Question preview':
444
- break;
445
- case 'Item preview':
446
- shortTextResponsePage.steps.switchToGradingView();
447
- break;
448
- case 'Student view':
449
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
450
- break;
451
- }
452
- });
453
-
454
- if (view === 'Question preview') {
455
- after(() => {
456
- shortTextResponsePage.steps.clickOnSaveQuestionButton();
457
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
458
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
459
- });
460
- };
461
-
462
- it(`When the user deselects all the Clipboard functions option and tries to ${clipboardFunctions} then warning message \'Cut, copy and paste options are disabled.\' should be displayed in ${view}`, () => {
463
- shortTextResponsePage.steps.enterTextInAnswerInputField('Apple');
464
- shortTextResponsePage.steps.copyTextFromAnswerResponseField();
465
- utilities.verifyElementVisibilityState(shortTextResponsePage.warningMessageContainer(), 'visible');
466
- utilities.verifyInnerText(shortTextResponsePage.warningMessageContainer(), 'Cut, copy and paste options are disabled.');
467
- });
468
- });
469
- });
470
373
  });
@@ -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.allotPoints(10);
20
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Fossil fuel combustion');
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.verifyCorrectIncorrectBorderNotExist();
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.allotPoints(20);
117
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Fossil fuel combustion');
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.verifyCorrectIncorrectBorderNotExist();
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.allotPoints(20);
187
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Fossil fuel combustion');
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.verifyCorrectIncorrectBorderNotExist();
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
+ });
@@ -67,61 +67,79 @@ describe('Create item page - Short text response: Conditional checkboxes', () =>
67
67
 
68
68
  describe('Only \'Validate if answer is included in the response\' checkbox checked', () => {
69
69
  abortEarlySetup();
70
- before(() => {
71
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
72
- shortTextResponsePage.steps.allotPoints(10);
73
- shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Flower is displayed');
74
- shortTextResponsePage.steps.checkConditionalCheckbox('Validate if answer is included in the response');
75
- shortTextResponsePage.steps.uncheckConditionalCheckbox('Ignore extra spaces');
76
- //shortTextResponsePage.steps.checkAllowStudentToCheckAnswerCheckbox();
77
- shortTextResponsePage.steps.switchToPreviewTab();
78
- });
79
-
80
- it('When user attempts the question with a sentence which includes the answer then full points should be awarded and when user switches to grading view, green check mark beside the response field should be displayed', () => {
81
- shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower is displayed in this image');
82
- shortTextResponsePage.steps.verifyPreviewScore(10, 10);
83
- shortTextResponsePage.steps.switchToGradingView();
84
- shortTextResponsePage.steps.verifyCorrectIcon();
85
- });
86
-
87
- it('When user attempts the question with a sentence that includes the answer with incorrect casing, then full score should be awarded and when user switches to grading view, a green check mark should be displayed beside response field', () => {
88
- shortTextResponsePage.steps.resetQuestionPreview();
89
- shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('floweR is Displayed');
90
- shortTextResponsePage.steps.verifyPreviewScore(10, 10);
91
- shortTextResponsePage.steps.switchToGradingView();
92
- shortTextResponsePage.steps.verifyCorrectIcon();
93
- });
94
-
95
- it('When user attempts the question with a sentence which includes the answer and correct casing with extra spaces in between the answer then zero points should be awarded and when user switches to grading view, red cross mark beside the response field should be displayed', () => {
96
- shortTextResponsePage.steps.resetQuestionPreview();
97
- shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower is displayed in the picture');
98
- shortTextResponsePage.steps.verifyPreviewScore(0, 10);
99
- shortTextResponsePage.steps.switchToGradingView();
100
- shortTextResponsePage.steps.verifyIncorrectIcon();
101
- });
102
-
103
- it('When user attempts the question with answer that has incorrect casing with extra spaces before and after correct answer then full points should be awarded and when user switches to grading view, green check mark beside the response field should be displayed', () => {
104
- shortTextResponsePage.steps.resetQuestionPreview();
105
- shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab(' flower is Displayed ');
106
- shortTextResponsePage.steps.verifyPreviewScore(10, 10);
107
- shortTextResponsePage.steps.switchToGradingView();
108
- shortTextResponsePage.steps.verifyCorrectIcon();
109
- });
110
-
111
- it('When user attempts the question with answer that has correct casing with extra spaces before and after correct answer and then full points should be awarded and when user switches to grading view, green check mark beside the correct response field should be displayed', () => {
112
- shortTextResponsePage.steps.resetQuestionPreview();
113
- shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab(' Flower is displayed ');
114
- shortTextResponsePage.steps.verifyPreviewScore(10, 10);
115
- shortTextResponsePage.steps.switchToGradingView();
116
- shortTextResponsePage.steps.verifyCorrectIcon();
117
- });
118
-
119
- it('When user attempts the question with exact answer then full points should be awarded and when user switches to grading view, green check mark beside the correct response field should be displayed', () => {
120
- shortTextResponsePage.steps.resetQuestionPreview();
121
- shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower is displayed');
122
- shortTextResponsePage.steps.verifyPreviewScore(10, 10);
123
- shortTextResponsePage.steps.switchToGradingView();
124
- shortTextResponsePage.steps.verifyCorrectIcon();
70
+
71
+ describe('Text Answer Tests', () => {
72
+ before(() => {
73
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
74
+ shortTextResponsePage.steps.allotPoints(10);
75
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Flower is displayed');
76
+ shortTextResponsePage.steps.checkConditionalCheckbox('Validate if answer is included in the response');
77
+ shortTextResponsePage.steps.uncheckConditionalCheckbox('Ignore extra spaces');
78
+ //shortTextResponsePage.steps.checkAllowStudentToCheckAnswerCheckbox();
79
+ shortTextResponsePage.steps.switchToPreviewTab();
80
+ });
81
+
82
+ it('When user attempts the question with a sentence which includes the answer then full points should be awarded and when user switches to grading view, green check mark beside the response field should be displayed', () => {
83
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower is displayed in this image');
84
+ shortTextResponsePage.steps.verifyPreviewScore(10, 10);
85
+ shortTextResponsePage.steps.switchToGradingView();
86
+ shortTextResponsePage.steps.verifyCorrectIcon();
87
+ });
88
+
89
+ it('When user attempts the question with a sentence that includes the answer with incorrect casing, then full score should be awarded and when user switches to grading view, a green check mark should be displayed beside response field', () => {
90
+ shortTextResponsePage.steps.resetQuestionPreview();
91
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('floweR is Displayed');
92
+ shortTextResponsePage.steps.verifyPreviewScore(10, 10);
93
+ shortTextResponsePage.steps.switchToGradingView();
94
+ shortTextResponsePage.steps.verifyCorrectIcon();
95
+ });
96
+
97
+ it('When user attempts the question with a sentence which includes the answer and correct casing with extra spaces in between the answer then zero points should be awarded and when user switches to grading view, red cross mark beside the response field should be displayed', () => {
98
+ shortTextResponsePage.steps.resetQuestionPreview();
99
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower is displayed in the picture');
100
+ shortTextResponsePage.steps.verifyPreviewScore(0, 10);
101
+ shortTextResponsePage.steps.switchToGradingView();
102
+ shortTextResponsePage.steps.verifyIncorrectIcon();
103
+ });
104
+
105
+ it('When user attempts the question with answer that has incorrect casing with extra spaces before and after correct answer then full points should be awarded and when user switches to grading view, green check mark beside the response field should be displayed', () => {
106
+ shortTextResponsePage.steps.resetQuestionPreview();
107
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab(' flower is Displayed ');
108
+ shortTextResponsePage.steps.verifyPreviewScore(10, 10);
109
+ shortTextResponsePage.steps.switchToGradingView();
110
+ shortTextResponsePage.steps.verifyCorrectIcon();
111
+ });
112
+
113
+ it('When user attempts the question with answer that has correct casing with extra spaces before and after correct answer and then full points should be awarded and when user switches to grading view, green check mark beside the correct response field should be displayed', () => {
114
+ shortTextResponsePage.steps.resetQuestionPreview();
115
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab(' Flower is displayed ');
116
+ shortTextResponsePage.steps.verifyPreviewScore(10, 10);
117
+ shortTextResponsePage.steps.switchToGradingView();
118
+ shortTextResponsePage.steps.verifyCorrectIcon();
119
+ });
120
+
121
+ it('When user attempts the question with exact answer then full points should be awarded and when user switches to grading view, green check mark beside the correct response field should be displayed', () => {
122
+ shortTextResponsePage.steps.resetQuestionPreview();
123
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower is displayed');
124
+ shortTextResponsePage.steps.verifyPreviewScore(10, 10);
125
+ shortTextResponsePage.steps.switchToGradingView();
126
+ shortTextResponsePage.steps.verifyCorrectIcon();
127
+ });
128
+ });
129
+
130
+ describe('Mathematical Expression Tests', () => {
131
+ before(() => {
132
+ shortTextResponsePage.steps.switchToEditTab();
133
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('y=-2x+5');
134
+ shortTextResponsePage.steps.switchToPreviewTab();
135
+ });
136
+
137
+ it('When user attempts the question with exact mathematical expression then full points should be awarded and when user switches to grading view, green check mark beside the response field should be displayed', () => {
138
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('y=-2x+5');
139
+ shortTextResponsePage.steps.verifyPreviewScore(10, 10);
140
+ shortTextResponsePage.steps.switchToGradingView();
141
+ shortTextResponsePage.steps.verifyCorrectIcon();
142
+ });
125
143
  });
126
144
  });
127
145