itemengine-cypress-automation 1.0.24 → 1.0.25
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsAdvanceSettingsForAllResponseAreas.js +511 -0
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsBasic.js +263 -0
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsResponseAccordions.js +734 -0
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsStudentResponseAreaAndLayout.js +603 -0
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAllOrNothingWithAlternateAnswer.js +54 -0
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAutoScoredScoring.js +0 -46
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextPartialDifferentWeights.js +47 -0
- package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextScoringPartialDifferentWeights.js → fillInTheGapsTextPartialDifferentWeightsWithAlternateAnswer.js} +1 -38
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextPartialEqualWeights.js +45 -0
- package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextScoringPartialEqualWeights.js → fillInTheGapsTextPartialEqualWeightsWithAlternateAnswer.js} +0 -37
- package/package.json +1 -1
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettings.js +0 -2060
@@ -0,0 +1,263 @@
|
|
1
|
+
import { specialOrMathCharacters } from "../../../fixtures/specialAndMathCharacters";
|
2
|
+
import { dialogBoxBase, fillInTheGapsTextPage } from "../../../pages";
|
3
|
+
import { commonComponents } from "../../../pages/components";
|
4
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
describe('Fill In the Gaps Additional settings', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Additional Settings accordion', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
16
|
+
});
|
17
|
+
|
18
|
+
fillInTheGapsTextPage.tests.verifyAdditonalSettingsAccordionProperties();
|
19
|
+
});
|
20
|
+
|
21
|
+
//Failing due to https://redmine.zeuslearning.com/issues/535989
|
22
|
+
describe('Additional Settings: Font Size dropdown', () => {
|
23
|
+
abortEarlySetup();
|
24
|
+
before(() => {
|
25
|
+
cy.log('Navigating to fill in the gaps - text type, adding question instructions and options, allotting points and expanding additional settings accordion')
|
26
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
27
|
+
fillInTheGapsTextPage.questionInstructionsInputField()
|
28
|
+
.type('Question Instructions');
|
29
|
+
fillInTheGapsTextPage.pointsInputField()
|
30
|
+
.type('4');
|
31
|
+
fillInTheGapsTextPage.setCorrectAnswerResponseField()
|
32
|
+
.each(($element) => {
|
33
|
+
cy.wrap($element)
|
34
|
+
.type('Answer input');
|
35
|
+
});
|
36
|
+
fillInTheGapsTextPage.steps.expandAdditonalSettings();
|
37
|
+
});
|
38
|
+
|
39
|
+
fillInTheGapsTextPage.tests.verifyFontSizeSectionContents();
|
40
|
+
|
41
|
+
const fontsizes = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
|
42
|
+
const font = ['16px', '12px', '14px', '17px', '20px', '24px'];
|
43
|
+
fontsizes.forEach((option, count) => {
|
44
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab contents should be changed to ${option} in the \'Set Correct Answer\' section as well as in the \'Preview\' tab`, () => {
|
45
|
+
fillInTheGapsTextPage.fontSizeDropdown()
|
46
|
+
.click();
|
47
|
+
fillInTheGapsTextPage.fontSizeListOptions(count)
|
48
|
+
.click();
|
49
|
+
fillInTheGapsTextPage.fontSizeDropdown()
|
50
|
+
.verifyInnerText(`${option}`);
|
51
|
+
cy.log('Checking correct answer section font size')
|
52
|
+
fillInTheGapsTextPage.setCorrectAnswerResponseField()
|
53
|
+
.each(($element) => {
|
54
|
+
cy.wrap($element)
|
55
|
+
.parent()
|
56
|
+
.should('have.attr', 'font-size', font[count]);
|
57
|
+
});
|
58
|
+
cy.log('Switching to Preview tab')
|
59
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
60
|
+
cy.log('Checking Preview section font size')
|
61
|
+
fillInTheGapsTextPage.questionInstructionsText()
|
62
|
+
.should('have.css', 'font-size', font[count]);
|
63
|
+
commonComponents.previewTabQuestionWrapper()
|
64
|
+
.within(() => {
|
65
|
+
fillInTheGapsTextPage.previewTabResponseField()
|
66
|
+
.each(($element) => {
|
67
|
+
cy.wrap($element)
|
68
|
+
.parent()
|
69
|
+
.should('have.attr', 'font-size', font[count]);
|
70
|
+
});
|
71
|
+
});
|
72
|
+
fillInTheGapsTextPage.previewTabQuestionContainer()
|
73
|
+
.should('have.css', 'font-size', font[count]);
|
74
|
+
cy.log('Post step: Switch to Edit tab')
|
75
|
+
fillInTheGapsTextPage.steps.switchToEditTab();
|
76
|
+
});
|
77
|
+
});
|
78
|
+
});
|
79
|
+
|
80
|
+
describe('Additional Settings: Student response area and layout', () => {
|
81
|
+
abortEarlySetup();
|
82
|
+
before(() => {
|
83
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
84
|
+
fillInTheGapsTextPage.steps.expandAdditonalSettings();
|
85
|
+
});
|
86
|
+
|
87
|
+
it('\'Student response area and layout\' label should be displayed', () => {
|
88
|
+
fillInTheGapsTextPage.studentResponseAreaAndLayoutLabel()
|
89
|
+
.verifyInnerText('Student response area and layout')
|
90
|
+
.should('be.visible');
|
91
|
+
});
|
92
|
+
|
93
|
+
it('CSS of \'Student response area and layout\' section', { tags: 'css' }, () => {
|
94
|
+
fillInTheGapsTextPage.studentResponseAreaAndLayoutLabel()
|
95
|
+
.verifyCSS(css.color.labels, css.fontSize.default, css.fontWeight.semibold);
|
96
|
+
});
|
97
|
+
|
98
|
+
//Note: a11y covered in Additional settings accordion, verifyAdditonalSettingsAccordionProperties
|
99
|
+
});
|
100
|
+
|
101
|
+
describe('Additional Settings: Check Answer', () => {
|
102
|
+
abortEarlySetup();
|
103
|
+
before(() => {
|
104
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
105
|
+
fillInTheGapsTextPage.questionInstructionsInputField()
|
106
|
+
.type('Question Instructions');
|
107
|
+
fillInTheGapsTextPage.pointsInputField()
|
108
|
+
.type('4');
|
109
|
+
fillInTheGapsTextPage.setCorrectAnswerResponseField()
|
110
|
+
.each(($element) => {
|
111
|
+
cy.wrap($element)
|
112
|
+
.type('Answer input');
|
113
|
+
});
|
114
|
+
fillInTheGapsTextPage.steps.expandAdditonalSettings();
|
115
|
+
});
|
116
|
+
|
117
|
+
fillInTheGapsTextPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
|
118
|
+
});
|
119
|
+
|
120
|
+
describe('Additional Settings: Check Answer - Functionality', () => {
|
121
|
+
abortEarlySetup();
|
122
|
+
before(() => {
|
123
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
124
|
+
fillInTheGapsTextPage.questionInstructionsInputField()
|
125
|
+
.type('Question Instructions');
|
126
|
+
fillInTheGapsTextPage.pointsInputField()
|
127
|
+
.type('4');
|
128
|
+
fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
|
129
|
+
fillInTheGapsTextPage.steps.expandAdditonalSettings();
|
130
|
+
fillInTheGapsTextPage.steps.setMaximumCheckAnswerAttempts(2);
|
131
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
132
|
+
});
|
133
|
+
|
134
|
+
it('When the user has not set any responses then on clicking on the Check Answer button icons should not be displayed beside both empty responses, label should not be displayed below the box', () => {
|
135
|
+
fillInTheGapsTextPage.previewTabResponseField()
|
136
|
+
.each(($el) => {
|
137
|
+
cy.wrap($el)
|
138
|
+
.should('have.value', '');
|
139
|
+
});
|
140
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
141
|
+
.click();
|
142
|
+
fillInTheGapsTextPage.correctIcon()
|
143
|
+
.should('not.exist');
|
144
|
+
fillInTheGapsTextPage.incorrectIcon()
|
145
|
+
.should('not.exist');
|
146
|
+
fillInTheGapsTextPage.correctIncorectAnswerLabel()
|
147
|
+
.should('not.exist');
|
148
|
+
fillInTheGapsTextPage.previewTabCorrectAnswerContainer()
|
149
|
+
.should('not.exist')
|
150
|
+
});
|
151
|
+
|
152
|
+
it('When the user has added correct response for one option then on clicking on the Check Answer button, green checkmark icon should be displayed besides the correct response, red crossmark should not be displayed beside empty response and \'Incorrect Answer\' label should be displayed below the box', () => {
|
153
|
+
fillInTheGapsTextPage.steps.enterAnswerResponsesInPreviewTab(['Response 1']);
|
154
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
155
|
+
.click();
|
156
|
+
fillInTheGapsTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
157
|
+
fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotVisible(1);
|
158
|
+
fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
159
|
+
fillInTheGapsTextPage.steps.verifyIncorrectAttemptBorder();
|
160
|
+
});
|
161
|
+
|
162
|
+
it('When the user has added correct responses 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', () => {
|
163
|
+
fillInTheGapsTextPage.previewTabResponseField()
|
164
|
+
.eq(1)
|
165
|
+
.type('Response 2')
|
166
|
+
.should('have.value', 'Response 2');
|
167
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
168
|
+
.click();
|
169
|
+
fillInTheGapsTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
170
|
+
fillInTheGapsTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
|
171
|
+
fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
172
|
+
fillInTheGapsTextPage.steps.verifyCorrectAttemptBorder();
|
173
|
+
});
|
174
|
+
|
175
|
+
|
176
|
+
fillInTheGapsTextPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y()
|
177
|
+
|
178
|
+
it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
|
179
|
+
cy.log('Pre step: Switching to Edit tab')
|
180
|
+
fillInTheGapsTextPage.steps.switchToEditTab();
|
181
|
+
fillInTheGapsTextPage.maximumCheckAnswerAttemptsInputField()
|
182
|
+
.clear()
|
183
|
+
.type(1)
|
184
|
+
.should('have.value', '1');
|
185
|
+
cy.log('Switching to Preview tab');
|
186
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
187
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
188
|
+
.should('be.enabled');
|
189
|
+
fillInTheGapsTextPage.steps.enterAnswerResponsesInPreviewTab(['Response 1', 'Response 2']);
|
190
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
191
|
+
.click()
|
192
|
+
.should('be.disabled');
|
193
|
+
});
|
194
|
+
|
195
|
+
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', () => {
|
196
|
+
fillInTheGapsTextPage.steps.switchToEditTab();
|
197
|
+
fillInTheGapsTextPage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
198
|
+
fillInTheGapsTextPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
|
199
|
+
cy.log('Switching to Preview tab')
|
200
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
201
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
202
|
+
.should('be.enabled');
|
203
|
+
cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
|
204
|
+
fillInTheGapsTextPage.steps.enterAnswerResponsesInPreviewTab(['Incorrect Answer', 'Incorrect Answer'])
|
205
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
206
|
+
.click();
|
207
|
+
fillInTheGapsTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
|
208
|
+
fillInTheGapsTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
|
209
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
210
|
+
.should('be.enabled');
|
211
|
+
fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
212
|
+
fillInTheGapsTextPage.steps.verifyIncorrectAttemptBorder()
|
213
|
+
cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
|
214
|
+
fillInTheGapsTextPage.steps.enterAnswerResponsesInPreviewTab(['Response 1', 'Response 2'])
|
215
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
216
|
+
.click();
|
217
|
+
fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct')
|
218
|
+
fillInTheGapsTextPage.steps.verifyCorrectAttemptBorder()
|
219
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
220
|
+
.should('be.enabled');
|
221
|
+
});
|
222
|
+
|
223
|
+
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', () => {
|
224
|
+
cy.log('Pre step: Switching to Edit tab')
|
225
|
+
fillInTheGapsTextPage.steps.switchToEditTab();
|
226
|
+
fillInTheGapsTextPage.maximumCheckAnswerAttemptsInputField()
|
227
|
+
.clear()
|
228
|
+
.should('have.value', '');
|
229
|
+
cy.log('Switching to Preview tab');
|
230
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
231
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
232
|
+
.should('be.enabled');
|
233
|
+
cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
|
234
|
+
fillInTheGapsTextPage.steps.enterAnswerResponsesInPreviewTab(['Incorrect Answer', 'Incorrect Answer'])
|
235
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
236
|
+
.click();
|
237
|
+
fillInTheGapsTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
|
238
|
+
fillInTheGapsTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
|
239
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
240
|
+
.should('be.enabled');
|
241
|
+
fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
242
|
+
fillInTheGapsTextPage.steps.verifyIncorrectAttemptBorder()
|
243
|
+
cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
|
244
|
+
fillInTheGapsTextPage.steps.enterAnswerResponsesInPreviewTab(['Response 1', 'Response 2'])
|
245
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
246
|
+
.click();
|
247
|
+
fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('Correct')
|
248
|
+
fillInTheGapsTextPage.steps.verifyCorrectAttemptBorder()
|
249
|
+
fillInTheGapsTextPage.checkAnswerButton()
|
250
|
+
.should('be.enabled');
|
251
|
+
});
|
252
|
+
});
|
253
|
+
|
254
|
+
describe('Additional Settings: Details section', () => {
|
255
|
+
abortEarlySetup();
|
256
|
+
before(() => {
|
257
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
258
|
+
fillInTheGapsTextPage.steps.expandAdditonalSettings();
|
259
|
+
});
|
260
|
+
|
261
|
+
fillInTheGapsTextPage.tests.verifyDetailsSection();
|
262
|
+
});
|
263
|
+
});
|