itemengine-cypress-automation 1.0.46 → 1.0.48
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAddResponseContainer.js +221 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettings.js +450 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsBasic.js +202 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsCustomSpecialCharachters.js +120 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsMultilineResponse.js +189 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsResponseAccordions.js +431 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsStudentResponseAreaAndLayout.js +262 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingScoring.js +188 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingWithAlternateAnswer.js +613 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingWithAlternateAnswerMatchFromAllResponsesTrue.js +172 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextConditionalCheckboxes.js +203 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +134 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +133 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabScoringSection.js +227 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextHeaderSection.js +109 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextImageProperties.js +156 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextManualAndNonScored.js +157 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextMatchFromAllResponses.js +162 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsScoring.js +200 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsWithAlternateAnswer.js +849 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsWithAlternateAnswerMatchFromAllResponsesTrue.js +171 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsScoring.js +199 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsWithAlternateAnswer.js +738 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsWithAlternateAnswerMatchFromAllResponsesTrue.js +168 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPreviewTab.js +66 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSetCorrectAnswerSection.js +113 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSupportedFileTypes.js +86 -0
- package/package.json +1 -1
@@ -0,0 +1,262 @@
|
|
1
|
+
import { specialOrMathCharacters } from "../../../fixtures/specialAndMathCharacters";
|
2
|
+
import { fillInTheGapsOverImageTextPage } from "../../../pages";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
const correctTabAnswerArray = ['Flower', 'Leaf'];
|
7
|
+
const incorrectAnswerArray = ['Root', 'Branch'];
|
8
|
+
const numbers = ['1', '2'];
|
9
|
+
const lowercase = ['a', 'b'];
|
10
|
+
const uppercase = ['A', 'B'];
|
11
|
+
const answerNumerationDropdownOptions = ['Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
|
12
|
+
let symbolsString = specialOrMathCharacters['specialCharacters'].characters.map((icon) => icon.symbol);
|
13
|
+
symbolsString = symbolsString.join('');
|
14
|
+
|
15
|
+
describe('Fill In the gaps over image - text - Additional settings', () => {
|
16
|
+
before(() => {
|
17
|
+
cy.loginAs('admin');
|
18
|
+
});
|
19
|
+
|
20
|
+
describe('Additional settings: Student response area and layout', () => {
|
21
|
+
abortEarlySetup();
|
22
|
+
before(() => {
|
23
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
24
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
25
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
26
|
+
});
|
27
|
+
|
28
|
+
it('\'Student response area and layout\' label should be displayed', () => {
|
29
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.studentResponseAreaAndLayoutLabel(), 'Student response area and layout');
|
30
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.studentResponseAreaAndLayoutLabel(), 'visible');
|
31
|
+
});
|
32
|
+
|
33
|
+
it('CSS of \'Student response area and layout\' section', { tags: 'css' }, () => {
|
34
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.studentResponseAreaAndLayoutLabel(), {
|
35
|
+
'color': css.color.labels,
|
36
|
+
'font-size': css.fontSize.default,
|
37
|
+
'font-weight': css.fontWeight.semibold
|
38
|
+
});
|
39
|
+
});
|
40
|
+
|
41
|
+
//Note: a11y covered in Additional settings accordion, verifyAdditonalSettingsAccordionProperties
|
42
|
+
});
|
43
|
+
|
44
|
+
describe('Additional settings: \'Answer numeration\' (only while grading) - Contents and set correct answer section', () => {
|
45
|
+
abortEarlySetup();
|
46
|
+
before(() => {
|
47
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
48
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
49
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
50
|
+
});
|
51
|
+
|
52
|
+
fillInTheGapsOverImageTextPage.tests.verifyAnswerNumerationContents();
|
53
|
+
|
54
|
+
it(`When the user selects ${answerNumerationDropdownOptions[0]} option from the \'Answer numeration\' dropdown, then correct response numeration should not be displayed in the \'Set correct answer section\'`, () => {
|
55
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.answerNumerationDropdown(), `${answerNumerationDropdownOptions[0]}`)
|
56
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseNumeration(), 'notExist');
|
57
|
+
});
|
58
|
+
|
59
|
+
it(`When the user selects ${answerNumerationDropdownOptions[1]} option from the \'Answer numeration\' dropdown, then correct response numeration should not be displayed in the \'Set correct answer section\'`, () => {
|
60
|
+
fillInTheGapsOverImageTextPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[1]}`);
|
61
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseNumeration(), 'notExist');
|
62
|
+
});
|
63
|
+
|
64
|
+
it(`When the user selects ${answerNumerationDropdownOptions[2]} option from the \'Answer numeration\' dropdown, then correct response numeration should not be displayed in the \'Set correct answer section\'`, () => {
|
65
|
+
fillInTheGapsOverImageTextPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[2]}`);
|
66
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseNumeration(), 'notExist');
|
67
|
+
});
|
68
|
+
});
|
69
|
+
|
70
|
+
describe('Additional settings: \'Answer numeration\' (only while grading) - Preview tab', () => {
|
71
|
+
abortEarlySetup();
|
72
|
+
before(() => {
|
73
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
74
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
75
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
76
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
77
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
78
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
79
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
|
80
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
|
81
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(10);
|
82
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
83
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
84
|
+
});
|
85
|
+
|
86
|
+
it(`When the user attempts the question when ${answerNumerationDropdownOptions[0]} is selected and selects \'Show correct answer\' checkbox then the correct answer section should have ${answerNumerationDropdownOptions[0]} numeration`, () => {
|
87
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.answerNumerationDropdown(), `${answerNumerationDropdownOptions[0]}`);
|
88
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
89
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
|
90
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
|
91
|
+
fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
|
92
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabResponseFieldAndCorrectAnswerNumeration(numbers);
|
93
|
+
});
|
94
|
+
|
95
|
+
it(`When the user attempts the question when ${answerNumerationDropdownOptions[1]} is selected and selects \'Show correct answer\' checkbox then the correct answer section should have ${answerNumerationDropdownOptions[1]} numeration`, () => {
|
96
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
97
|
+
fillInTheGapsOverImageTextPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[1]}`);
|
98
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
99
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
|
100
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
|
101
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabResponseFieldAndCorrectAnswerNumeration(uppercase);
|
102
|
+
});
|
103
|
+
|
104
|
+
it(`When the user attempts the question when ${answerNumerationDropdownOptions[2]} is selected and selects \'Show correct answer\' checkbox then the correct answer section should have ${answerNumerationDropdownOptions[2]} numeration`, () => {
|
105
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
106
|
+
fillInTheGapsOverImageTextPage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[2]}`);
|
107
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
108
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
|
109
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
|
110
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabResponseFieldAndCorrectAnswerNumeration(lowercase);
|
111
|
+
});
|
112
|
+
});
|
113
|
+
|
114
|
+
describe('Additional settings: Display answer numeration to students - Contents and set correct answer section', () => {
|
115
|
+
abortEarlySetup();
|
116
|
+
before(() => {
|
117
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
118
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
119
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
120
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
121
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
122
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
123
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
124
|
+
});
|
125
|
+
|
126
|
+
it('\'Display answer numeration to students\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
|
127
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.displayAnswerNumerationToStudentsLabel(), 'Display answer numeration to students');
|
128
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.displayAnswerNumerationToStudentsLabel(), 'visible');
|
129
|
+
fillInTheGapsOverImageTextPage.steps.verifyDisplayAnswerNumerationToStudentsCheckboxNotChecked();
|
130
|
+
});
|
131
|
+
|
132
|
+
it('CSS of \'Display answer numeration to students\' section - unchecked state', { tags: 'css' }, () => {
|
133
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.displayAnswerNumerationToStudentsLabel(), {
|
134
|
+
'color': css.color.labelText,
|
135
|
+
'font-size': css.fontSize.normal,
|
136
|
+
'font-weight': css.fontWeight.regular
|
137
|
+
});
|
138
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.displayAnswerNumerationToStudentsCheckbox().parent().find('svg'), {
|
139
|
+
'fill': css.color.uncheckedCheckbox
|
140
|
+
});
|
141
|
+
});
|
142
|
+
|
143
|
+
it('When \'Display answer numeration to students\' checkbox is unchecked, answer numeration should not be displayed in set correct answer section response fields', () => {
|
144
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseNumeration(), 'notExist');
|
145
|
+
});
|
146
|
+
|
147
|
+
it('When the user checks the \'Display answer numeration to students\' checkbox, answer numeration should not be displayed in set correct answer section response fields', () => {
|
148
|
+
fillInTheGapsOverImageTextPage.steps.checkDisplayAnswerNumerationToStudentsCheckbox();
|
149
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseNumeration(), 'notExist');
|
150
|
+
});
|
151
|
+
|
152
|
+
it('CSS of \'Display answer numeration to students\' section - checked state', { tags: 'css' }, () => {
|
153
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.displayAnswerNumerationToStudentsCheckbox().parent().find('svg g g'), {
|
154
|
+
'fill': css.color.activeButtons
|
155
|
+
});
|
156
|
+
});
|
157
|
+
|
158
|
+
it('Accessibility of \'Display answer numeration to students\' section - checked state', { tags: 'a11y' }, () => {
|
159
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.displayAnswerNumerationToStudentsCheckbox().parents('.additional-settings-container'));
|
160
|
+
});
|
161
|
+
});
|
162
|
+
|
163
|
+
//Failing due to https://redmine.zeuslearning.com/issues/548127
|
164
|
+
describe('Additional settings: Display answer numeration to students - Preview tab', () => {
|
165
|
+
abortEarlySetup();
|
166
|
+
before(() => {
|
167
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
168
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
169
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
170
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
171
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
172
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
173
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
174
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
175
|
+
});
|
176
|
+
|
177
|
+
it('When \'Display answer numeration to students\' checkbox is unchecked, answer numeration should not be displayed in preview tab response fields', () => {
|
178
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseNumeration(), 'notExist');
|
179
|
+
});
|
180
|
+
|
181
|
+
it('When the user checks the \'Display answer numeration to students\' checkbox, answer numeration should not be displayed in preview tab response fields', () => {
|
182
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
183
|
+
fillInTheGapsOverImageTextPage.steps.checkDisplayAnswerNumerationToStudentsCheckbox();
|
184
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
185
|
+
fillInTheGapsOverImageTextPage.steps.verifyResponseFieldNumeration(['1', '2']);
|
186
|
+
});
|
187
|
+
});
|
188
|
+
|
189
|
+
describe('Additional settings: Spell check - Contents and set correct answer section', () => {
|
190
|
+
abortEarlySetup();
|
191
|
+
before(() => {
|
192
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
193
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
194
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
195
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
196
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
197
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
198
|
+
});
|
199
|
+
|
200
|
+
it('\'Spell check\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
|
201
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.spellCheckLabel(), 'Spell check');
|
202
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.spellCheckLabel(), 'visible');
|
203
|
+
fillInTheGapsOverImageTextPage.steps.verifySpellCheckCheckboxNotChecked();
|
204
|
+
});
|
205
|
+
|
206
|
+
it('CSS of \'Spell check\' section - unchecked state', { tags: 'css' }, () => {
|
207
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.spellCheckLabel(), {
|
208
|
+
'color': css.color.labelText,
|
209
|
+
'font-size': css.fontSize.normal,
|
210
|
+
'font-weight': css.fontWeight.regular
|
211
|
+
});
|
212
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.spellCheckCheckbox().parent().find('svg'), {
|
213
|
+
'fill': css.color.uncheckedCheckbox
|
214
|
+
});
|
215
|
+
});
|
216
|
+
|
217
|
+
//Note: a11y covered in Additional settings accordion, verifyAdditonalSettingsAccordionProperties
|
218
|
+
|
219
|
+
//Spell check test cases for set correct answer section response fields
|
220
|
+
it('When the \'Spell check\' functionality is disabled, the response field should have \'spellcheck\' attribute set as \'false\' in \'Set correct answer\' section', () => {
|
221
|
+
fillInTheGapsOverImageTextPage.steps.verifySpellCheckOfResponseFieldSetCorrectAnswerSectionDisabled(0);
|
222
|
+
});
|
223
|
+
|
224
|
+
it('When the \'Spell check\' functionality is enabled, the response field should have \'spellcheck\' attribute set as \'true\' in \'Set correct answer\' section', () => {
|
225
|
+
fillInTheGapsOverImageTextPage.steps.checkSpellCheckCheckbox();
|
226
|
+
fillInTheGapsOverImageTextPage.steps.verifySpellCheckOfResponseFieldSetCorrectAnswerSectionEnabled(0);
|
227
|
+
});
|
228
|
+
|
229
|
+
it('CSS of \'Spell check\' section - checked state', { tags: 'css' }, () => {
|
230
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.spellCheckCheckbox().parent().find('svg g g'), {
|
231
|
+
'fill': css.color.activeButtons
|
232
|
+
});
|
233
|
+
});
|
234
|
+
|
235
|
+
it('Accessibility of \'Spell check\' section - checked state', { tags: 'a11y' }, () => {
|
236
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.spellCheckCheckbox().parents('.additional-settings-container'));
|
237
|
+
});
|
238
|
+
});
|
239
|
+
|
240
|
+
describe('Additional settings: Spell check - Preview tab', () => {
|
241
|
+
abortEarlySetup();
|
242
|
+
before(() => {
|
243
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
244
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
245
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
246
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
247
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
248
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
249
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
250
|
+
});
|
251
|
+
it('When the \'Spell check\' functionality is disabled, the response field should have \'spellcheck\' attribute set as \'false\' in preview tab', () => {
|
252
|
+
fillInTheGapsOverImageTextPage.steps.verifySpellCheckOfResponseFieldPreviewTabDisabled(0);
|
253
|
+
});
|
254
|
+
|
255
|
+
it('When the \'Spell check\' functionality is enabled, the response field should have \'spellcheck\' attribute set as \'true\' in the preview tab', () => {
|
256
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
257
|
+
fillInTheGapsOverImageTextPage.steps.checkSpellCheckCheckbox();
|
258
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
259
|
+
fillInTheGapsOverImageTextPage.steps.verifySpellCheckOfResponseFieldPreviewTabEnabled(0);
|
260
|
+
});
|
261
|
+
});
|
262
|
+
});
|
package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingScoring.js
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
import { fillInTheGapsOverImageTextPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
const correctTabAnswerArray = ['Flower', 'Leaf', 'Stem'];
|
6
|
+
const incorrectAnswerArray = ['Root', 'Branch', 'Seed'];
|
7
|
+
|
8
|
+
describe('Create item page - Fill in the gaps over image - text: All or nothing scoring', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Show correct answer', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
17
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
20
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
21
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
22
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
23
|
+
});
|
24
|
+
|
25
|
+
fillInTheGapsOverImageTextPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet();
|
26
|
+
|
27
|
+
it('When the user has set correct answer responses 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', () => {
|
28
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
29
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
|
30
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
|
31
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(20);
|
32
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
33
|
+
fillInTheGapsOverImageTextPage.steps.verifyDefaultShowCorrectAnswerCheckboxAndLabel();
|
34
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
|
35
|
+
});
|
36
|
+
|
37
|
+
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', () => {
|
38
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
|
39
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
|
40
|
+
fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
|
41
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(0, '');
|
42
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(1, '');
|
43
|
+
});
|
44
|
+
});
|
45
|
+
|
46
|
+
//Failing due to https://redmine.zeuslearning.com/issues/545382, https://redmine.zeuslearning.com/issues/542590
|
47
|
+
describe('Question preview: Auto scored - All or nothing', () => {
|
48
|
+
abortEarlySetup();
|
49
|
+
before(() => {
|
50
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
51
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
52
|
+
cy.barsPreLoaderWait();
|
53
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
54
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
55
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
56
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
57
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
|
58
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
|
59
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(20);
|
60
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
61
|
+
fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
62
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
63
|
+
});
|
64
|
+
|
65
|
+
it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct/incorrect icons or label should not be displayed, correct answer container along with \'Correct answers:\' label and correct responses with numeric count should be displayed below the question preview', () => {
|
66
|
+
fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
|
67
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
|
68
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
69
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
|
70
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerLabel(), 'Correct answers:');
|
71
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
|
72
|
+
});
|
73
|
+
|
74
|
+
it('CSS of the correct answer container when \'Show correct answer\' checkbox is checked', { tags: 'css' }, () => {
|
75
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerLabel(), {
|
76
|
+
'color': css.color.text,
|
77
|
+
'font-size': css.fontSize.normal,
|
78
|
+
'font-weight': css.fontWeight.regular
|
79
|
+
});
|
80
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerContainer(), {
|
81
|
+
'border': `1px solid ${css.color.correctAnswerContainerBorder}`
|
82
|
+
});
|
83
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.responseNumeration(), {
|
84
|
+
'color': css.color.text,
|
85
|
+
'font-size': css.fontSize.default,
|
86
|
+
'font-weight': css.fontWeight.regular
|
87
|
+
});
|
88
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerResponseWrapper(), {
|
89
|
+
'color': css.color.text,
|
90
|
+
'font-size': css.fontSize.default,
|
91
|
+
'font-weight': css.fontWeight.regular,
|
92
|
+
'border-left': `1px solid ${css.color.correctAnswerContainerResponseBlockBorder}`,
|
93
|
+
});
|
94
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerResponseWrapper().parent().find('fieldset'), {
|
95
|
+
'border': `1px solid ${css.color.correctAnswerContainerResponseBlockBorder}`
|
96
|
+
});
|
97
|
+
});
|
98
|
+
|
99
|
+
it('Accessibility of \'Correct answer container\'', { tags: 'a11y' }, () => {
|
100
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.previewTabCorrectAnswerContainer())
|
101
|
+
cy.log('Post step: unchecking the show correct answer checkbox')
|
102
|
+
fillInTheGapsOverImageTextPage.steps.uncheckShowCorrectAnswerCheckbox();
|
103
|
+
});
|
104
|
+
|
105
|
+
it('When the user selects \'Check answer\' button without attempting the question, then red cross-mark icon or green check-mark icons, correct/incorrect answer label and border and correct answer container should not be displayed', () => {
|
106
|
+
fillInTheGapsOverImageTextPage.steps.checkAnswer();
|
107
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
|
108
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
109
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
|
110
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
|
111
|
+
});
|
112
|
+
|
113
|
+
it('When the user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container with all correct answers along with numeration should be displayed', () => {
|
114
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, incorrectAnswerArray[0]);
|
115
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
|
116
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
|
117
|
+
fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
|
118
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
119
|
+
fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
|
120
|
+
fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
|
121
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
122
|
+
fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
|
123
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
|
124
|
+
fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
125
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
|
126
|
+
cy.log('When the user attempts the question incorrectly and clicks on the \'Check answer\' button, then red cross-mark icons should be displayed beside all incorrect the options, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
|
127
|
+
fillInTheGapsOverImageTextPage.steps.checkAnswer();
|
128
|
+
fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
|
129
|
+
fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
|
130
|
+
fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
|
131
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
132
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
|
133
|
+
});
|
134
|
+
|
135
|
+
fillInTheGapsOverImageTextPage.tests.verifyCSSAndA11yOfIncorrectAnswerLabel('fill in the gaps over image - text');
|
136
|
+
|
137
|
+
it('When the user attempts the question partially correct, then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points, green check-mark icons should be displayed beside the correct response fields, red cross-mark icons should be displayed beside the incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container with correct answers for responses marked incorrect along with numeration should be displayed', () => {
|
138
|
+
fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
|
139
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
|
140
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
|
141
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
|
142
|
+
fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
|
143
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
144
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
145
|
+
fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
|
146
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
147
|
+
fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
|
148
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1]], ['2']);
|
149
|
+
fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
150
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
|
151
|
+
cy.log('When user attempts the question partially correct and clicks on the \'Check answer\' button, green check-mark icons should be displayed beside the correct response fields, red cross-mark icons should be displayed beside the incorrect response fields, a label \'Incorrect answer\' and incorrect answer border should be displayed below the question preview and the correct answer container should not be displayed')
|
152
|
+
fillInTheGapsOverImageTextPage.steps.checkAnswer();
|
153
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
154
|
+
fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
|
155
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
156
|
+
fillInTheGapsOverImageTextPage.steps.verifyIncorrectAttemptBorder();
|
157
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
|
158
|
+
});
|
159
|
+
|
160
|
+
it('When user attempts the question correctly then on selecting \'Show correct answer\' checkbox, the user should be awarded full points and green check-mark icons should be displayed beside all the response fields, a label \'Correct answer\' and correct answer border should be displayed below the question preview and the correct answer container should not be displayed', () => {
|
161
|
+
fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
|
162
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
|
163
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
|
164
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
|
165
|
+
fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
|
166
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
167
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
168
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
|
169
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
170
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
|
171
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
|
172
|
+
fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
173
|
+
cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, green check-mark icons should be displayed beside the correct response fields, a label \'Correct answer\' and correct answer border should be displayed below the question preview and the correct answer container should not be displayed')
|
174
|
+
fillInTheGapsOverImageTextPage.steps.checkAnswer();
|
175
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
176
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
|
177
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
178
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAttemptBorder();
|
179
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
|
180
|
+
});
|
181
|
+
|
182
|
+
fillInTheGapsOverImageTextPage.tests.verifyCSSAndA11yOfCorrectAnswerIcon();
|
183
|
+
|
184
|
+
fillInTheGapsOverImageTextPage.tests.verifyCSSAndA11yOfFullScoreTextAndCorrectAnswerLabel('fill in the gaps over image - text');
|
185
|
+
|
186
|
+
fillInTheGapsOverImageTextPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(1, 20);
|
187
|
+
});
|
188
|
+
});
|