itemengine-cypress-automation 1.0.15 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridAdditionalSettingsBasic.js +235 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridAutoScoredScoring.js +205 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridAutoScoredScoringWithAlternateAnswer.js +472 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridEditTabBasicSection.js +589 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridEditTabScoringSection.js +282 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridHeaderSection.js +97 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridManuallyAndNonScored.js +146 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridOptionsAdditionalSettings.js +345 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridPartialDifferentWeights.js +188 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridPartialDifferentWeightsWithAlternateAnswer.js +662 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridPartialEqualWeights.js +190 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridPartialEqualWeightsWIthAlternateAnswer.js +595 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridQuestionStemAdditionalSettings.js +258 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridRandomizeOptions.js +122 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridSetCorrectAnswerSection.js +183 -0
- package/package.json +1 -1
@@ -0,0 +1,235 @@
|
|
1
|
+
import { singleSelectionGridPage } from "../../../pages/singleSelectionGridPage";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
|
5
|
+
const questionStems = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
|
6
|
+
const options = ['Fully agree as true', 'Fully agree as false'];
|
7
|
+
|
8
|
+
const fontSizeDropdownOptions = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
|
9
|
+
const fontSizes = ['16px', '12px', '14px', '17px', '20px', '24px'];
|
10
|
+
|
11
|
+
describe('Create Item page - Single Selection Grid: Additional settings', () => {
|
12
|
+
before(() => {
|
13
|
+
cy.loginAs('admin');
|
14
|
+
});
|
15
|
+
|
16
|
+
describe('Additional Settings accordion', () => {
|
17
|
+
abortEarlySetup();
|
18
|
+
before(() => {
|
19
|
+
cy.log('Navigating to Single selection grid question type');
|
20
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
21
|
+
});
|
22
|
+
|
23
|
+
singleSelectionGridPage.tests.verifyAdditonalSettingsAccordionProperties();
|
24
|
+
});
|
25
|
+
|
26
|
+
describe('Additional settings: Font size contents', () => {
|
27
|
+
abortEarlySetup();
|
28
|
+
before(() => {
|
29
|
+
cy.log('Navigating to Single selection grid question type');
|
30
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
31
|
+
singleSelectionGridPage.steps.expandAdditonalSettings();
|
32
|
+
});
|
33
|
+
|
34
|
+
singleSelectionGridPage.tests.verifyFontSizeSectionContents();
|
35
|
+
});
|
36
|
+
|
37
|
+
describe('Additional settings: Font size contents set correct answer section', () => {
|
38
|
+
abortEarlySetup();
|
39
|
+
before(() => {
|
40
|
+
cy.log('Navigating to Single selection grid question type');
|
41
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
42
|
+
singleSelectionGridPage.steps.addQuestionInstructions();
|
43
|
+
singleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
44
|
+
singleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
45
|
+
singleSelectionGridPage.steps.allotPoints(10);
|
46
|
+
singleSelectionGridPage.steps.expandAdditonalSettings();
|
47
|
+
singleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption('Lowercase alphabet')
|
48
|
+
singleSelectionGridPage.steps.addInputToTitleForOptionsInputField('Title for options')
|
49
|
+
});
|
50
|
+
|
51
|
+
//Failing due to https://redmine.zeuslearning.com/issues/534772
|
52
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
53
|
+
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`, () => {
|
54
|
+
singleSelectionGridPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
|
55
|
+
singleSelectionGridPage.fontSizeDropdown()
|
56
|
+
.verifyInnerText(`${option}`);
|
57
|
+
singleSelectionGridPage.setCorrectAnswerTableHeader()
|
58
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
59
|
+
singleSelectionGridPage.questionStemNumeration()
|
60
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
61
|
+
singleSelectionGridPage.setCorrectAnswertableQuestionStem()
|
62
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
63
|
+
singleSelectionGridPage.setCorrectAnswerTableQuestionStemTitle()
|
64
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
65
|
+
singleSelectionGridPage.setCorrectAnswerTableOptionsTitle()
|
66
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
67
|
+
});
|
68
|
+
});
|
69
|
+
});
|
70
|
+
|
71
|
+
describe('Additional settings: Font size contents preview tab section', () => {
|
72
|
+
abortEarlySetup();
|
73
|
+
before(() => {
|
74
|
+
cy.log('Navigating to Single selection grid question type');
|
75
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
76
|
+
singleSelectionGridPage.steps.addQuestionInstructions();
|
77
|
+
singleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
78
|
+
singleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
79
|
+
singleSelectionGridPage.steps.allotPoints(10);
|
80
|
+
singleSelectionGridPage.steps.expandAdditonalSettings();
|
81
|
+
singleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption('Lowercase alphabet');
|
82
|
+
singleSelectionGridPage.steps.addInputToTitleForOptionsInputField('Title for options');
|
83
|
+
});
|
84
|
+
|
85
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
86
|
+
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`, () => {
|
87
|
+
singleSelectionGridPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
|
88
|
+
singleSelectionGridPage.fontSizeDropdown()
|
89
|
+
.verifyInnerText(`${option}`);
|
90
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
91
|
+
singleSelectionGridPage.questionInstructionsText()
|
92
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
93
|
+
singleSelectionGridPage.previewTabAnswerTableHeader()
|
94
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
95
|
+
singleSelectionGridPage.previewTabQuestionStemNumeration()
|
96
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
97
|
+
singleSelectionGridPage.previewTabAnswertableQuestionStem()
|
98
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
99
|
+
singleSelectionGridPage.previewTabAnswerTableQuestionStemTitle()
|
100
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
101
|
+
singleSelectionGridPage.previewTabAnswerTableOptionsTitle()
|
102
|
+
.should('have.css', 'font-size', fontSizes[fontsIndex]);
|
103
|
+
singleSelectionGridPage.steps.switchToEditTab();
|
104
|
+
});
|
105
|
+
});
|
106
|
+
});
|
107
|
+
|
108
|
+
describe('Additional settings: Check answer', () => {
|
109
|
+
abortEarlySetup();
|
110
|
+
before(() => {
|
111
|
+
cy.log('Navigating to Single selection grid question type');
|
112
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
113
|
+
singleSelectionGridPage.steps.addQuestionInstructions();
|
114
|
+
singleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
115
|
+
singleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
116
|
+
singleSelectionGridPage.steps.allotPoints(10);
|
117
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInSetCorrectAnswerTable([0, 1, 0, 1]);
|
118
|
+
singleSelectionGridPage.steps.expandAdditonalSettings();
|
119
|
+
});
|
120
|
+
|
121
|
+
singleSelectionGridPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
|
122
|
+
});
|
123
|
+
|
124
|
+
describe('Additional settings: Check answer functionality', () => {
|
125
|
+
abortEarlySetup();
|
126
|
+
before(() => {
|
127
|
+
cy.log('Navigating to Single selection grid question type');
|
128
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
129
|
+
singleSelectionGridPage.steps.addQuestionInstructions();
|
130
|
+
singleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
131
|
+
singleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
132
|
+
singleSelectionGridPage.steps.allotPoints(10);
|
133
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInSetCorrectAnswerTable([0, 1, 0, 1]);
|
134
|
+
singleSelectionGridPage.steps.expandAdditonalSettings();
|
135
|
+
singleSelectionGridPage.steps.setMaximumCheckAnswerAttempts(2);
|
136
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
137
|
+
});
|
138
|
+
|
139
|
+
singleSelectionGridPage.tests.verifyCheckAnswerButtonFunctionalityWhenQuestionIsUnattempted()
|
140
|
+
|
141
|
+
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, red crossmark should not be displayed beside empty response and \'Incorrect Answer\' label should be displayed below the box', () => {
|
142
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([0, 1]);
|
143
|
+
singleSelectionGridPage.steps.checkAnswer();
|
144
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIconForAllQuestionStems([0, 1]);
|
145
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
146
|
+
singleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
147
|
+
});
|
148
|
+
|
149
|
+
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', () => {
|
150
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([0, 1, 0, 1]);
|
151
|
+
singleSelectionGridPage.steps.checkAnswer();
|
152
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIconForAllQuestionStems([0, 1, 0, 1]);
|
153
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
154
|
+
singleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
155
|
+
});
|
156
|
+
|
157
|
+
singleSelectionGridPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y();
|
158
|
+
|
159
|
+
it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
|
160
|
+
singleSelectionGridPage.steps.switchToEditTab();
|
161
|
+
singleSelectionGridPage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
162
|
+
singleSelectionGridPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(1);
|
163
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
164
|
+
singleSelectionGridPage.checkAnswerButton()
|
165
|
+
.should('be.enabled');
|
166
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([0, 1, 0, 1]);
|
167
|
+
singleSelectionGridPage.steps.checkAnswer();
|
168
|
+
singleSelectionGridPage.checkAnswerButton()
|
169
|
+
.should('be.disabled');
|
170
|
+
});
|
171
|
+
|
172
|
+
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', () => {
|
173
|
+
singleSelectionGridPage.steps.switchToEditTab();
|
174
|
+
singleSelectionGridPage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
175
|
+
singleSelectionGridPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
|
176
|
+
cy.log('Switching to Preview tab')
|
177
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
178
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([1, 1, 1, 1]);
|
179
|
+
singleSelectionGridPage.steps.checkAnswer();
|
180
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIcon(0, 1)
|
181
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIcon(1, 1)
|
182
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIcon(2, 1)
|
183
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIcon(3, 1)
|
184
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
185
|
+
singleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
186
|
+
singleSelectionGridPage.checkAnswerButton()
|
187
|
+
.should('be.enabled');
|
188
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([1, 0, 1, 0]);
|
189
|
+
singleSelectionGridPage.steps.checkAnswer();
|
190
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIconForAllQuestionStems([1, 0, 1, 0]);
|
191
|
+
singleSelectionGridPage.correctIcon()
|
192
|
+
.should('not.exist');
|
193
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
194
|
+
singleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
195
|
+
singleSelectionGridPage.checkAnswerButton()
|
196
|
+
.should('be.enabled');
|
197
|
+
});
|
198
|
+
|
199
|
+
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', () => {
|
200
|
+
singleSelectionGridPage.steps.switchToEditTab();
|
201
|
+
singleSelectionGridPage.steps.clearMaximumCheckAnswerAttemptsInputField()
|
202
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
203
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([1, 1, 1, 1]);
|
204
|
+
singleSelectionGridPage.steps.checkAnswer();
|
205
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIcon(0, 1)
|
206
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIcon(1, 1)
|
207
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIcon(2, 1)
|
208
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIcon(3, 1)
|
209
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
210
|
+
singleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
211
|
+
singleSelectionGridPage.checkAnswerButton()
|
212
|
+
.should('be.enabled');
|
213
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([1, 0, 1, 0]);
|
214
|
+
singleSelectionGridPage.steps.checkAnswer();
|
215
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIconForAllQuestionStems([1, 0, 1, 0]);
|
216
|
+
singleSelectionGridPage.correctIcon()
|
217
|
+
.should('not.exist');
|
218
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
219
|
+
singleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
220
|
+
singleSelectionGridPage.checkAnswerButton()
|
221
|
+
.should('be.enabled');
|
222
|
+
});
|
223
|
+
});
|
224
|
+
|
225
|
+
describe('Additional Settings: Details section', () => {
|
226
|
+
abortEarlySetup();
|
227
|
+
before(() => {
|
228
|
+
cy.log('Navigating to Single selection grid question type');
|
229
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
230
|
+
singleSelectionGridPage.steps.expandAdditonalSettings();
|
231
|
+
});
|
232
|
+
|
233
|
+
singleSelectionGridPage.tests.verifyDetailsSection();
|
234
|
+
});
|
235
|
+
});
|
@@ -0,0 +1,205 @@
|
|
1
|
+
import { singleSelectionGridPage } from "../../../pages/singleSelectionGridPage";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
|
5
|
+
const questionStems = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
|
6
|
+
const options = ['Fully agree as true', 'Fully agree as false', 'Somewhat agree'];
|
7
|
+
|
8
|
+
describe('Create Item page - Single Selection Grid: Preview tab Scoring Section', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Show correct answer', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigating to Single selection grid question type');
|
17
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
18
|
+
singleSelectionGridPage.steps.addQuestionInstructions();
|
19
|
+
singleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
20
|
+
singleSelectionGridPage.steps.addInputToAllOptionsFields(options.slice(0, 2));
|
21
|
+
});
|
22
|
+
|
23
|
+
singleSelectionGridPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet()
|
24
|
+
|
25
|
+
it('When the user has set correct answer options and alloted points \'Show correct answer\' checkbox should be displayed and it should be unchecked by default and points for the question should be displayed beside it', () => {
|
26
|
+
singleSelectionGridPage.steps.switchToEditTab();
|
27
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInSetCorrectAnswerTable([1, 0, 0, 1]);
|
28
|
+
singleSelectionGridPage.steps.allotPoints('15');
|
29
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
30
|
+
singleSelectionGridPage.steps.verifyDefaultShowCorrectAnswerCheckboxAndLabel();
|
31
|
+
singleSelectionGridPage.previewScoreText()
|
32
|
+
.verifyInnerText('0/15');
|
33
|
+
});
|
34
|
+
|
35
|
+
it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab users response should not persist', () => {
|
36
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([1, 1, 0, 1]);
|
37
|
+
singleSelectionGridPage.steps.switchToEditTab();
|
38
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
39
|
+
singleSelectionGridPage.steps.verifyRadioButtonsUncheckedInPreviewTabAnswerTable();
|
40
|
+
});
|
41
|
+
});
|
42
|
+
|
43
|
+
describe('Question Preview: AutoScored - All or Nothing', () => {
|
44
|
+
abortEarlySetup();
|
45
|
+
before(() => {
|
46
|
+
cy.log('Navigating to Single selection grid question type');
|
47
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
48
|
+
cy.log('Adding question instructions, question stems, options, setting correct answer and adding points for Autoscored scoring type and switching to Preview tab');
|
49
|
+
singleSelectionGridPage.steps.addQuestionInstructions();
|
50
|
+
singleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
51
|
+
singleSelectionGridPage.steps.addInputToAllOptionsFields(options.slice(0, 2));
|
52
|
+
singleSelectionGridPage.steps.allotPoints(20);
|
53
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInSetCorrectAnswerTable([0, 1, 0, 1]);
|
54
|
+
singleSelectionGridPage.steps.expandAdditonalSettings();
|
55
|
+
singleSelectionGridPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
56
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
57
|
+
});
|
58
|
+
|
59
|
+
singleSelectionGridPage.tests.verifyCSSOfPreviewAndEditTabAndScoringContents();
|
60
|
+
|
61
|
+
singleSelectionGridPage.tests.verifya11yOfCreateItemWrapperContents();
|
62
|
+
|
63
|
+
it('When the user selects \'Show correct answer\' checkbox without attempting the question, green check-mark icons should be displayed beside the correct answer options, no incorrect icons or label should be displayed below the table', () => {
|
64
|
+
singleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox();
|
65
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIconForAllQuestionStems([0, 1, 0, 1]);
|
66
|
+
singleSelectionGridPage.incorrectIcon()
|
67
|
+
.should('not.exist');
|
68
|
+
singleSelectionGridPage.correctIncorectAnswerLabel()
|
69
|
+
.should('not.exist');
|
70
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotVisible();
|
71
|
+
});
|
72
|
+
|
73
|
+
it('When user selects Check answer button without attempting the question, then then red cross-mark icon or green check-mark should not be displayed anywhere, correct/incorrect answer label and its border should not be displayed', () => {
|
74
|
+
cy.log('Post step: Unchecking the show correct answer checkbox')
|
75
|
+
singleSelectionGridPage.steps.uncheckShowCorrectAnswerCheckbox();
|
76
|
+
singleSelectionGridPage.steps.checkAnswer();
|
77
|
+
singleSelectionGridPage.correctIcon()
|
78
|
+
.should('not.exist');
|
79
|
+
singleSelectionGridPage.incorrectIcon()
|
80
|
+
.should('not.exist');
|
81
|
+
singleSelectionGridPage.correctIncorectAnswerLabel()
|
82
|
+
.should('not.exist');
|
83
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotExists();
|
84
|
+
});
|
85
|
+
|
86
|
+
it('Case: When user adds incorrect response', () => {
|
87
|
+
cy.log('User selects incorrect options')
|
88
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([1, 0, 1, 0]);
|
89
|
+
|
90
|
+
cy.log('User should be awarded 0 points')
|
91
|
+
singleSelectionGridPage.previewScoreText()
|
92
|
+
.verifyInnerText('0/20');
|
93
|
+
|
94
|
+
cy.log('When the user selects \'Show correct answer\' checkbox, red cross-mark icon should be displayed besides the selected incorrect answer options, green check-mark should be displayed beside correct answer options, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed below the table')
|
95
|
+
singleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox();
|
96
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIconForAllQuestionStems([1, 0, 1, 0]);
|
97
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIconForAllQuestionStems([0, 1, 0, 1]);
|
98
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
99
|
+
singleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
100
|
+
|
101
|
+
singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
102
|
+
|
103
|
+
cy.log('When the user clicks on \'Check answer\' button, red cross-mark icon should be displayed besides the incorrect response field, incorrect answer border should appear and a label \'Incorrect Answer\' should be displayed below the table')
|
104
|
+
singleSelectionGridPage.steps.checkAnswer();
|
105
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIconForAllQuestionStems([1, 0, 1, 0]);
|
106
|
+
singleSelectionGridPage.correctIcon()
|
107
|
+
.should('not.exist');
|
108
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
109
|
+
singleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
110
|
+
});
|
111
|
+
|
112
|
+
//Use the common function once https://redmine.zeuslearning.com/issues/518498 is resolved
|
113
|
+
it('CSS of incorrect answer state', { tags: 'css' }, () => {
|
114
|
+
cy.log('Pre requisite: The user has attempted the question incorrectly')
|
115
|
+
cy.log('Verifying CSS of incorrect crossmark icon')
|
116
|
+
singleSelectionGridPage.incorrectIcon()
|
117
|
+
.eq(0)
|
118
|
+
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
119
|
+
singleSelectionGridPage.correctIncorectAnswerLabel()
|
120
|
+
.verifyCSS(css.color.incorrectAnswer, css.fontSize.normal, css.fontWeight.bold)
|
121
|
+
.parent()
|
122
|
+
.find('.answer-label-icon')
|
123
|
+
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
124
|
+
singleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
125
|
+
});
|
126
|
+
|
127
|
+
it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
|
128
|
+
cy.checkAccessibility(singleSelectionGridPage.previewTabQuestionWrapper());
|
129
|
+
});
|
130
|
+
|
131
|
+
it('Case: When user enters partially correct response', () => {
|
132
|
+
cy.log('Selecting parially correct options');
|
133
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([1, 1, 1, 1]);
|
134
|
+
|
135
|
+
cy.log('User should be awarded 0 points')
|
136
|
+
singleSelectionGridPage.previewScoreText()
|
137
|
+
.verifyInnerText('0/20');
|
138
|
+
|
139
|
+
cy.log('When user selects \'Show correct answer\' checkbox, red cross-mark icon should be displayed besides the selected incorrect answer options, green check-mark should be displayed beside correct answer options, incorrect answer border should appear, a label \'Incorrect Answer\' should be displayed below the table')
|
140
|
+
singleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox();
|
141
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIcon(0, 1)
|
142
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIcon(2, 1)
|
143
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIconForAllQuestionStems([0, 1, 0, 1]);
|
144
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
145
|
+
singleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
146
|
+
|
147
|
+
singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
148
|
+
|
149
|
+
cy.log('When the user clicks on \'Check answer\' button, red cross-mark icon should be displayed besides the selected incorrect options, green checkmark should be displayed beside selected correct options and incorrect answer border should appear and a label \'Incorrect Answer\' should be displayed below the table')
|
150
|
+
singleSelectionGridPage.steps.checkAnswer();
|
151
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIcon(0, 1)
|
152
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIcon(1, 1)
|
153
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionCrossmarkIcon(2, 1)
|
154
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIcon(3, 1)
|
155
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
156
|
+
singleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
|
157
|
+
});
|
158
|
+
|
159
|
+
it('Case: When user adds correct response', () => {
|
160
|
+
cy.log('Selecting correct options');
|
161
|
+
singleSelectionGridPage.steps.selectOptionForAllQuestionStemsInPreviewTabAnswerTable([0, 1, 0, 1]);
|
162
|
+
|
163
|
+
cy.log('User should be awarded full points')
|
164
|
+
singleSelectionGridPage.previewScoreText()
|
165
|
+
.verifyInnerText('20/20');
|
166
|
+
|
167
|
+
cy.log('When user selects show correct answer then green check-mark icons should be displayed besides correct answer options and a label \'Correct answer\' should be displayed below the table')
|
168
|
+
singleSelectionGridPage.steps.checkShowCorrectAnswerCheckbox();
|
169
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIconForAllQuestionStems([0, 1, 0, 1]);
|
170
|
+
singleSelectionGridPage.incorrectIcon()
|
171
|
+
.should('not.exist');
|
172
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
173
|
+
singleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
174
|
+
|
175
|
+
singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
176
|
+
|
177
|
+
cy.log('When the user clicks on the \'Check answer\' button, then green check-mark icons should be displayed besides correct answer options and a label \'Correct answer\' should be displayed below the table');
|
178
|
+
singleSelectionGridPage.steps.checkAnswer();
|
179
|
+
singleSelectionGridPage.steps.verifyCorrectOptionCheckmarkIconForAllQuestionStems([0, 1, 0, 1]);
|
180
|
+
singleSelectionGridPage.incorrectIcon()
|
181
|
+
.should('not.exist');
|
182
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
183
|
+
singleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
184
|
+
});
|
185
|
+
|
186
|
+
//Use the common function once https://redmine.zeuslearning.com/issues/518498 is resolved
|
187
|
+
it('CSS of check score text full score state and Correct Answer label', { tags: 'css' }, () => {
|
188
|
+
singleSelectionGridPage.previewScoreText()
|
189
|
+
.should('have.css', 'color', css.color.primaryBtn)
|
190
|
+
.and('have.css', 'background-color', css.color.correctAnswer)
|
191
|
+
singleSelectionGridPage.correctIncorectAnswerLabel()
|
192
|
+
.verifyCSS(css.color.correctAnswer, css.fontSize.normal, css.fontWeight.bold)
|
193
|
+
.parent()
|
194
|
+
.find('.answer-label-icon')
|
195
|
+
.verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
|
196
|
+
singleSelectionGridPage.steps.verifyCorrectAttemptBorder();
|
197
|
+
});
|
198
|
+
|
199
|
+
it('Accessibility of check score text full score state and Correct Answer label', { tags: 'a11y' }, () => {
|
200
|
+
cy.checkAccessibility(singleSelectionGridPage.previewTabQuestionWrapper());
|
201
|
+
});
|
202
|
+
|
203
|
+
singleSelectionGridPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer('20')
|
204
|
+
});
|
205
|
+
});
|