itemengine-cypress-automation 1.0.17 → 1.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (15) hide show
  1. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAdditionalSettingsBasic.js +255 -0
  2. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAllOrNothingWithAlternateAnswer.js +731 -0
  3. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAutoScoredScoring.js +0 -719
  4. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridOptionsAdditionalSettings.js +351 -0
  5. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialDifferentWeights.js +0 -930
  6. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialDifferentWeightsWithAlternateAnswer.js +942 -0
  7. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialEqualWeights.js +0 -852
  8. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialEqualWeightsWithAlternateAnswer.js +864 -0
  9. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridQuestionStemAdditionalSettings.js +261 -0
  10. package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridQuestionStemAdditionalSettings.js +0 -1
  11. package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +0 -291
  12. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +304 -0
  13. package/package.json +1 -1
  14. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAdditionalSettings.js +0 -830
  15. /package/cypress/e2e/ILC/SingleSelectionGrid/{singleSelectionGridAutoScoredScoringWithAlternateAnswer.js → singleSelectionGridAllOrNothingWithAlternateAnswer.js} +0 -0
@@ -0,0 +1,255 @@
1
+ import { multipleSelectionGridPage } from "../../../pages/multipleSelectionGridPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ const questionStems = ['Bat', 'Ostrich', 'Platypus', 'Eagle'];
6
+ const options = ['Is mammal', 'Lays eggs', 'Can fly'];
7
+
8
+ const gridStyleDropdownOptions = ['With border', 'Row dividers', 'No border', 'Inline', 'Inline - row dividers'];
9
+ const questionStemNumerationOptions = ['None', 'Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
10
+ const fontSizeDropdownOptions = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
11
+ const numbers = ['1', '2', '3', '4'];
12
+ const lowercase = ['a', 'b', 'c', 'd'];
13
+ const uppercase = ['A', 'B', 'C', 'D'];
14
+ const fontSizes = ['16px', '12px', '14px', '17px', '20px', '24px'];
15
+
16
+ describe('Create Item page - Multiple Selection Grid: Additional settings', () => {
17
+ before(() => {
18
+ cy.loginAs('admin');
19
+ });
20
+
21
+ describe('Additional Settings accordion', () => {
22
+ abortEarlySetup();
23
+ before(() => {
24
+ cy.log('Navigating to multiple selection grid question type');
25
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
26
+ });
27
+
28
+ multipleSelectionGridPage.tests.verifyAdditonalSettingsAccordionProperties();
29
+ });
30
+
31
+ describe('Additional settings: Font size contents', () => {
32
+ abortEarlySetup();
33
+ before(() => {
34
+ cy.log('Navigating to multiple selection grid question type');
35
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
36
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
37
+ });
38
+
39
+ multipleSelectionGridPage.tests.verifyFontSizeSectionContents();
40
+ });
41
+
42
+ describe('Additional settings: Font size contents set correct answer section', () => {
43
+ abortEarlySetup();
44
+ before(() => {
45
+ cy.log('Navigating to multiple selection grid question type');
46
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
47
+ multipleSelectionGridPage.steps.addQuestionInstructions();
48
+ multipleSelectionGridPage.steps.addOption();
49
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
50
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
51
+ multipleSelectionGridPage.steps.allotPoints(10);
52
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
53
+ multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption('Lowercase alphabet')
54
+ multipleSelectionGridPage.steps.addInputToTitleForOptionsInputField('Title for options')
55
+ });
56
+
57
+ //Failing due to https://redmine.zeuslearning.com/issues/534772
58
+ fontSizeDropdownOptions.forEach((option, fontsIndex) => {
59
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview (options, question instructions question stems) should be changed to ${option} in the set correct answer table`, () => {
60
+ multipleSelectionGridPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
61
+ multipleSelectionGridPage.fontSizeDropdown()
62
+ .verifyInnerText(`${option}`);
63
+ multipleSelectionGridPage.setCorrectAnswerTableHeader()
64
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
65
+ multipleSelectionGridPage.questionStemNumeration()
66
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
67
+ multipleSelectionGridPage.setCorrectAnswertableQuestionStem()
68
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
69
+ multipleSelectionGridPage.setCorrectAnswerTableQuestionStemTitle()
70
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
71
+ multipleSelectionGridPage.setCorrectAnswerTableOptionsTitle()
72
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
73
+ });
74
+ });
75
+ });
76
+
77
+ describe('Additional settings: Font size contents preview tab section', () => {
78
+ abortEarlySetup();
79
+ before(() => {
80
+ cy.log('Navigating to multiple selection grid question type');
81
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
82
+ multipleSelectionGridPage.steps.addQuestionInstructions();
83
+ multipleSelectionGridPage.steps.addOption();
84
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
85
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
86
+ multipleSelectionGridPage.steps.allotPoints(10);
87
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
88
+ multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption('Lowercase alphabet');
89
+ multipleSelectionGridPage.steps.addInputToTitleForOptionsInputField('Title for options');
90
+ });
91
+
92
+ fontSizeDropdownOptions.forEach((option, fontsIndex) => {
93
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview (options, question instructions question stems) should be changed to ${option} in the preview tab Answer table`, () => {
94
+ multipleSelectionGridPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
95
+ multipleSelectionGridPage.fontSizeDropdown()
96
+ .verifyInnerText(`${option}`);
97
+ multipleSelectionGridPage.steps.switchToPreviewTab();
98
+ multipleSelectionGridPage.questionInstructionsText()
99
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
100
+ multipleSelectionGridPage.previewTabAnswerTableHeader()
101
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
102
+ multipleSelectionGridPage.previewTabQuestionStemNumeration()
103
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
104
+ multipleSelectionGridPage.previewTabAnswertableQuestionStem()
105
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
106
+ multipleSelectionGridPage.previewTabAnswerTableQuestionStemTitle()
107
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
108
+ multipleSelectionGridPage.previewTabAnswerTableOptionsTitle()
109
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
110
+ multipleSelectionGridPage.steps.switchToEditTab();
111
+ });
112
+ });
113
+ });
114
+
115
+ describe('Additional settings: Check answer', () => {
116
+ abortEarlySetup();
117
+ before(() => {
118
+ cy.log('Navigating to multiple selection grid question type');
119
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
120
+ multipleSelectionGridPage.steps.addQuestionInstructions();
121
+ multipleSelectionGridPage.steps.addOption()
122
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
123
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
124
+ multipleSelectionGridPage.steps.allotPoints(10);
125
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSetCorrectAnswerTable([[0, 2], [1], [0, 1], [0, 1]]);
126
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
127
+ });
128
+
129
+ multipleSelectionGridPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
130
+ });
131
+
132
+ describe('Additional settings: Check answer functionality', () => {
133
+ abortEarlySetup();
134
+ before(() => {
135
+ cy.log('Navigating to multiple selection grid question type');
136
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
137
+ multipleSelectionGridPage.steps.addQuestionInstructions();
138
+ multipleSelectionGridPage.steps.addOption();
139
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
140
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
141
+ multipleSelectionGridPage.steps.allotPoints(10);
142
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSetCorrectAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
143
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
144
+ multipleSelectionGridPage.steps.setMaximumCheckAnswerAttempts(2);
145
+ multipleSelectionGridPage.steps.switchToPreviewTab();
146
+ });
147
+
148
+ multipleSelectionGridPage.tests.verifyCheckAnswerButtonFunctionalityWhenQuestionIsUnattempted()
149
+
150
+ it('When the user has selected correct answer for two options then on clicking on the Check Answer button, green checkmark icon should be displayed besides the selected correct option, and \'Incorrect Answer\' label should be displayed below the box', () => {
151
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1]]);
152
+ multipleSelectionGridPage.steps.checkAnswer();
153
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
154
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
155
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
156
+ multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
157
+ });
158
+
159
+ it('When the user has selected all correct answer options then on clicking on the Check Answer button, green checkmark icon should be displayed besides the responses and \'Correct Answer\' label should be displayed below the box', () => {
160
+ multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(2, [0, 1]);
161
+ multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(3, [1, 2]);
162
+ multipleSelectionGridPage.steps.checkAnswer();
163
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
164
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
165
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
166
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
167
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
168
+ multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
169
+ });
170
+
171
+ multipleSelectionGridPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y();
172
+
173
+ it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
174
+ multipleSelectionGridPage.steps.switchToEditTab();
175
+ multipleSelectionGridPage.steps.clearMaximumCheckAnswerAttemptsInputField();
176
+ multipleSelectionGridPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(1);
177
+ multipleSelectionGridPage.steps.switchToPreviewTab();
178
+ multipleSelectionGridPage.checkAnswerButton()
179
+ .should('be.enabled');
180
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
181
+ multipleSelectionGridPage.steps.checkAnswer();
182
+ multipleSelectionGridPage.checkAnswerButton()
183
+ .should('be.disabled');
184
+ });
185
+
186
+ it('When the \'Maximum check answer attempts\' input field has value \'0\' and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
187
+ multipleSelectionGridPage.steps.switchToEditTab();
188
+ multipleSelectionGridPage.steps.clearMaximumCheckAnswerAttemptsInputField();
189
+ multipleSelectionGridPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
190
+ cy.log('Switching to Preview tab')
191
+ multipleSelectionGridPage.steps.switchToPreviewTab();
192
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [2], [2], [0]]);
193
+ multipleSelectionGridPage.steps.checkAnswer();
194
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
195
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [2]);
196
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
197
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
198
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
199
+ multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
200
+ multipleSelectionGridPage.checkAnswerButton()
201
+ .should('be.enabled');
202
+ multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(1, [0]);
203
+ multipleSelectionGridPage.steps.checkAnswer();
204
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
205
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
206
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
207
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
208
+ multipleSelectionGridPage.correctIcon()
209
+ .should('not.exist');
210
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
211
+ multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
212
+ multipleSelectionGridPage.checkAnswerButton()
213
+ .should('be.enabled');
214
+ });
215
+
216
+ it('When the \'Maximum check answer attempts\' input field is empty and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
217
+ multipleSelectionGridPage.steps.switchToEditTab();
218
+ multipleSelectionGridPage.steps.clearMaximumCheckAnswerAttemptsInputField()
219
+ multipleSelectionGridPage.steps.switchToPreviewTab();
220
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [2], [2], [0]]);
221
+ multipleSelectionGridPage.steps.checkAnswer();
222
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
223
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [2]);
224
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
225
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
226
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
227
+ multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
228
+ multipleSelectionGridPage.checkAnswerButton()
229
+ .should('be.enabled');
230
+ multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(1, [0]);
231
+ multipleSelectionGridPage.steps.checkAnswer();
232
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
233
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
234
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
235
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
236
+ multipleSelectionGridPage.correctIcon()
237
+ .should('not.exist');
238
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
239
+ multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
240
+ multipleSelectionGridPage.checkAnswerButton()
241
+ .should('be.enabled');
242
+ });
243
+ });
244
+
245
+ describe('Additional Settings: Details section', () => {
246
+ abortEarlySetup();
247
+ before(() => {
248
+ cy.log('Navigating to multiple selection grid question type');
249
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
250
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
251
+ });
252
+
253
+ multipleSelectionGridPage.tests.verifyDetailsSection();
254
+ });
255
+ });