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
package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettings.js
ADDED
@@ -0,0 +1,450 @@
|
|
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
|
+
let symbolsString = specialOrMathCharacters['specialCharacters'].characters.map((icon) => icon.symbol);
|
7
|
+
symbolsString = symbolsString.join('');
|
8
|
+
|
9
|
+
describe('Fill In the gaps over image - text - Additional settings', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Additional settings: Placeholder text - Contents and set correct answer section', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
18
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
21
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
22
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
23
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
24
|
+
});
|
25
|
+
|
26
|
+
it('\'Advanced settings for all response areas\' label should be displayed', () => {
|
27
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.advanceSettingsforAllResponseAreasLabel(), 'Advanced settings for all response areas');
|
28
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.advanceSettingsforAllResponseAreasLabel(), 'visible');
|
29
|
+
});
|
30
|
+
|
31
|
+
it('\'Placeholder text\' label and input field should be displayed and by default, the input field should be empty', () => {
|
32
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.placeholderTextLabel(), 'Placeholder text');
|
33
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.placeholderTextLabel(), 'visible');
|
34
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.placeholderTextInputField(), 'visible');
|
35
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderTextInputFieldValue('');
|
36
|
+
});
|
37
|
+
|
38
|
+
it('When \'Placeholder text\' input field is empty then no \'Placeholder text\' should be displayed in the set correct answer response field', () => {
|
39
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderAttributeInSetCorrectAnswerSectionResponseFieldNotExists(0);
|
40
|
+
});
|
41
|
+
|
42
|
+
it('When the user adds a text in the Placeholder input field, the added placeholder should be displayed in the set correct answer response field', () => {
|
43
|
+
fillInTheGapsOverImageTextPage.steps.setResponseFieldPlaceholderTextGlobal('Enter response');
|
44
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderAttributeInSetCorrectAnswerSectionResponseField(0, 'Enter response');
|
45
|
+
});
|
46
|
+
|
47
|
+
//Note: not possible to check css of placeholder since it is added as an attribute, properties of placeholder is not visible in dev tools
|
48
|
+
|
49
|
+
it('Accessibility of \'Placeholder text\'', { tags: 'a11y' }, () => {
|
50
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.responseFieldSetCorrectAnswerSection().parents('.response-input-field'));
|
51
|
+
});
|
52
|
+
|
53
|
+
it('When the user starts typing in the response field, then the placeholder text should disappear and on clearing the input field the placeholder text should re-appear for the set correct answer section response fields', () => {
|
54
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'Flower');
|
55
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderAttributeInSetCorrectAnswerSectionResponseFieldNotExists(0);
|
56
|
+
fillInTheGapsOverImageTextPage.steps.clearResponseFieldSetCorrectAnswerSection(0);
|
57
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderAttributeInSetCorrectAnswerSectionResponseField(0, 'Enter response');
|
58
|
+
});
|
59
|
+
|
60
|
+
it('When the user clears the placeholder text input field, the placeholder text should get removed from the set correct answer section response fields', () => {
|
61
|
+
fillInTheGapsOverImageTextPage.steps.clearPlaceholderTextInputFieldGlobal();
|
62
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderAttributeInSetCorrectAnswerSectionResponseFieldNotExists(0);
|
63
|
+
});
|
64
|
+
|
65
|
+
it('CSS of \'Placeholder text\' label and input field', { tags: 'css' }, () => {
|
66
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.placeholderTextLabel(), {
|
67
|
+
'color': css.color.labels,
|
68
|
+
'font-size': css.fontSize.normal,
|
69
|
+
'font-weight': css.fontWeight.semibold
|
70
|
+
});
|
71
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.placeholderTextInputField(), {
|
72
|
+
'color': css.color.text,
|
73
|
+
'font-size': css.fontSize.default,
|
74
|
+
'font-weight': css.fontWeight.regular
|
75
|
+
});
|
76
|
+
});
|
77
|
+
|
78
|
+
//Note: a11y covered in Additional settings accordion, verifyAdditonalSettingsAccordionProperties
|
79
|
+
});
|
80
|
+
|
81
|
+
describe('Additional settings: Placeholder text - Preview tab', () => {
|
82
|
+
abortEarlySetup();
|
83
|
+
before(() => {
|
84
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
85
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
86
|
+
cy.barsPreLoaderWait();
|
87
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
88
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
89
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
90
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
91
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
92
|
+
});
|
93
|
+
|
94
|
+
it('When \'Placeholder text\' input field is empty then no \'Placeholder text\' should be displayed in the preview tab response field', () => {
|
95
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderAttributeInPreviewTabResponseFieldNotExists(0);
|
96
|
+
});
|
97
|
+
|
98
|
+
it('When the user adds a text in the Placeholder input field, the added placeholder should be displayed in the preview tab response field', () => {
|
99
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
100
|
+
fillInTheGapsOverImageTextPage.steps.setResponseFieldPlaceholderTextGlobal('Enter response');
|
101
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
102
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderAttributeInPreviewTabResponseField(0, 'Enter response');
|
103
|
+
});
|
104
|
+
|
105
|
+
//Note: not possible to check css of placeholder since it is added as an attribute, properties of placeholder is not visible in dev tools
|
106
|
+
|
107
|
+
it('Accessibility of \'Placeholder text\'', { tags: 'a11y' }, () => {
|
108
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.responseFieldPreviewTab().parents('.response-input-field'));
|
109
|
+
});
|
110
|
+
|
111
|
+
it('When the user starts typing in the response field, then the placeholder text should disappear and on clearing the input field the placeholder text should re-appear for the preview tab response fields', () => {
|
112
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Flower');
|
113
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderAttributeInPreviewTabResponseFieldNotExists(0);
|
114
|
+
fillInTheGapsOverImageTextPage.steps.clearResponseFieldPreviewTab(0);
|
115
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderAttributeInPreviewTabResponseField(0, 'Enter response');
|
116
|
+
});
|
117
|
+
|
118
|
+
it('When the user clears the placeholder text input field, the placeholder text should get removed from the preview tab response fields', () => {
|
119
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
120
|
+
fillInTheGapsOverImageTextPage.steps.clearPlaceholderTextInputFieldGlobal();
|
121
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
122
|
+
fillInTheGapsOverImageTextPage.steps.verifyPlaceholderAttributeInPreviewTabResponseFieldNotExists(0);
|
123
|
+
});
|
124
|
+
});
|
125
|
+
|
126
|
+
describe('Additional settings: Type of answer input - Contents and set correct answer section', () => {
|
127
|
+
const typeOfAnswerInputs = ['Text', 'Number'];
|
128
|
+
abortEarlySetup();
|
129
|
+
before(() => {
|
130
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
131
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
132
|
+
cy.barsPreLoaderWait();
|
133
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
134
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
135
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
136
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
137
|
+
});
|
138
|
+
|
139
|
+
it('\'Type of answer input\' label and dropdown should be displayed and in \'Type of answer input\' dropdown \'Text\' option should be selected by default', () => {
|
140
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.typeOfAnswerInputLabel(), 'Type of answer input');
|
141
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.typeOfAnswerInputLabel(), 'visible');
|
142
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.typeOfAnswerInputDropdown(), 'visible');
|
143
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.typeOfAnswerInputDropdown(), 'Text');
|
144
|
+
});
|
145
|
+
|
146
|
+
it('CSS of \'Type of answer input\' dropdown in default state', { tags: 'css' }, () => {
|
147
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.typeOfAnswerInputDropdown(), {
|
148
|
+
'background-color': css.color.secondaryBtnBg,
|
149
|
+
'border': `1px solid ${css.color.defaultDropdownBorder}`
|
150
|
+
});
|
151
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.typeOfAnswerInputDropdown().find('.dropdown-label-text'), {
|
152
|
+
'color': css.color.liText,
|
153
|
+
'font-size': css.fontSize.default,
|
154
|
+
'font-weight': css.fontWeight.regular
|
155
|
+
});
|
156
|
+
fillInTheGapsOverImageTextPage.typeOfAnswerInputDropdown()
|
157
|
+
.verifyPseudoClassBeforeProperty('color', css.color.secondaryBtn);
|
158
|
+
});
|
159
|
+
|
160
|
+
it(`Clicking on \'Type of answer input\' dropdown should open a list of 2 options - ${typeOfAnswerInputs}`, () => {
|
161
|
+
fillInTheGapsOverImageTextPage.steps.clickOnTypeOfAnswerDropdown();
|
162
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.dropdownList(), 'visible');
|
163
|
+
fillInTheGapsOverImageTextPage.steps.verifyTypeOfAnswerDropdownOptions(typeOfAnswerInputs);
|
164
|
+
});
|
165
|
+
|
166
|
+
it('CSS of \'Type of answer input\' dropdown in active state', { tags: 'css' }, () => {
|
167
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.typeOfAnswerInputDropdownListOptions().eq(0), {
|
168
|
+
'color': css.color.liText,
|
169
|
+
'font-size': css.fontSize.default,
|
170
|
+
'font-weight': css.fontWeight.regular,
|
171
|
+
'background-color': css.color.liTextSelectedBg
|
172
|
+
});
|
173
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.typeOfAnswerInputDropdownListOptions().eq(1), {
|
174
|
+
'color': css.color.liText,
|
175
|
+
'font-size': css.fontSize.default,
|
176
|
+
'font-weight': css.fontWeight.regular,
|
177
|
+
'background-color': css.color.transparent
|
178
|
+
});
|
179
|
+
});
|
180
|
+
|
181
|
+
it('Accessibility of \'Type of answer input\' dropdown in active state', { tags: 'a11y' }, () => {
|
182
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.dropdownList());
|
183
|
+
});
|
184
|
+
|
185
|
+
it('When \'Text\' option is set in the dropdown, then user should be able to add alpha-numeric characters in the \'Set correct answer\' section', () => {
|
186
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, '1 Flower');
|
187
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldSetCorrectAnswerSection(0, '1 Flower');
|
188
|
+
});
|
189
|
+
|
190
|
+
it('When the user selects \'Number\' option from the dropdown, the previously added text should get removed from the set correct answer section response field and the user should be able to add only numeric characters in the set correct answer response field', () => {
|
191
|
+
fillInTheGapsOverImageTextPage.steps.clickOnTypeOfAnswerDropdown();
|
192
|
+
fillInTheGapsOverImageTextPage.steps.selectTypeOfAnswerDropdownOption('Number');
|
193
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldSetCorrectAnswerSection(0, '');
|
194
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, '1 Flower');
|
195
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldSetCorrectAnswerSection(0, '1');
|
196
|
+
});
|
197
|
+
});
|
198
|
+
|
199
|
+
describe('Additional settings: Type of answer input - Preview tab', () => {
|
200
|
+
abortEarlySetup();
|
201
|
+
before(() => {
|
202
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
203
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
204
|
+
cy.barsPreLoaderWait();
|
205
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
206
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
207
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
208
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
209
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
210
|
+
});
|
211
|
+
|
212
|
+
it('When \'Text\' option is set in the dropdown, then user should be able to add alpha-numeric characters in preview tab response fields', () => {
|
213
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, '1 Flower');
|
214
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(0, '1 Flower');
|
215
|
+
});
|
216
|
+
|
217
|
+
it('When the user selects \'Number\' option from the dropdown then the user should be able to add only numeric characters in the preview tab input field', () => {
|
218
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
219
|
+
fillInTheGapsOverImageTextPage.steps.clickOnTypeOfAnswerDropdown();
|
220
|
+
fillInTheGapsOverImageTextPage.steps.selectTypeOfAnswerDropdownOption('Number');
|
221
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
222
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, '1 Flower');
|
223
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(0, '1');
|
224
|
+
});
|
225
|
+
});
|
226
|
+
|
227
|
+
describe('Additional settings: Set character limit - Contents and set correct answer section', () => {
|
228
|
+
abortEarlySetup();
|
229
|
+
before(() => {
|
230
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
231
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
232
|
+
cy.barsPreLoaderWait();
|
233
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
234
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
235
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
236
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
237
|
+
});
|
238
|
+
|
239
|
+
it('\'Set character limit\' label and input field should be displayed and in \'Set character limit\' input field the default value should be \'20\'', () => {
|
240
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.setCharacterLimitLabel(), 'Set character limit');
|
241
|
+
fillInTheGapsOverImageTextPage.steps.verifySetCharacterLimitInputFieldValue(20);
|
242
|
+
});
|
243
|
+
|
244
|
+
it('User should not be able to add characters more than the default \'Set character limit\' value in the Set correct answer response fields', () => {
|
245
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'This is a marigold flower');
|
246
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldSetCorrectAnswerSection(0, 'This is a marigold f');
|
247
|
+
});
|
248
|
+
|
249
|
+
it('When the user removes the default set characters limit then user should be able to enter more than \'20\' characters', () => {
|
250
|
+
fillInTheGapsOverImageTextPage.steps.clearSetCharacterLimitInputField();
|
251
|
+
fillInTheGapsOverImageTextPage.steps.clearResponseFieldSetCorrectAnswerSection(0);
|
252
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'This is a marigold flower');
|
253
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldSetCorrectAnswerSection(0, 'This is a marigold flower');
|
254
|
+
});
|
255
|
+
|
256
|
+
it('When the user tries to enter a response using Enter key in the response fields then the user should not be able to do so and should be able to enter the specified number of characters only for the set correct answer section response field', () => {
|
257
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'This {enter}f{enter}l{enter}o{enter}we{enter}r{enter}');
|
258
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldSetCorrectAnswerSection(0, 'This flower');
|
259
|
+
});
|
260
|
+
|
261
|
+
//Failing due to https://redmine.zeuslearning.com/issues/547505
|
262
|
+
it('User should not be able to Set character limit value below 1', () => {
|
263
|
+
fillInTheGapsOverImageTextPage.steps.setCharacterLimit(0);
|
264
|
+
fillInTheGapsOverImageTextPage.steps.verifySetCharacterLimitInputFieldMinimumValue();
|
265
|
+
});
|
266
|
+
|
267
|
+
it('The user should be able to update the set character limit, after updating the character limit value, user should not be able to add characters more than the set value in the set correct answer section response field', () => {
|
268
|
+
fillInTheGapsOverImageTextPage.steps.setCharacterLimit(45);
|
269
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'This is a marigold flower with 6 petals and four leaves and a branch');
|
270
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldSetCorrectAnswerSection(0, 'This is a marigold flower with 6 petals and f');
|
271
|
+
});
|
272
|
+
|
273
|
+
it('CSS of \'Set character limit\' label and input field', { tags: 'css' }, () => {
|
274
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.setCharacterLimitLabel(), {
|
275
|
+
'color': css.color.labels,
|
276
|
+
'font-size': css.fontSize.normal,
|
277
|
+
'font-weight': css.fontWeight.semibold
|
278
|
+
});
|
279
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.setCharacterLimitInputField(), {
|
280
|
+
'color': css.color.text,
|
281
|
+
'font-size': css.fontSize.default,
|
282
|
+
'font-weight': css.fontWeight.regular
|
283
|
+
});
|
284
|
+
});
|
285
|
+
|
286
|
+
//Note: a11y covered in Additional settings accordion, verifyAdditonalSettingsAccordionProperties
|
287
|
+
});
|
288
|
+
|
289
|
+
describe('Additional settings: Set character limit - Preview tab', () => {
|
290
|
+
abortEarlySetup();
|
291
|
+
before(() => {
|
292
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
293
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
294
|
+
cy.barsPreLoaderWait();
|
295
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
296
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
297
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
298
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
299
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
300
|
+
});
|
301
|
+
|
302
|
+
it('User should not be able to add characters more than the default \'Set character limit\' value in the preview tab response fields', () => {
|
303
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'This is a marigold flower');
|
304
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(0, 'This is a marigold f');
|
305
|
+
});
|
306
|
+
|
307
|
+
it('When the user removes the default set characters limit then user should be able to enter more than \'20\' characters', () => {
|
308
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
309
|
+
fillInTheGapsOverImageTextPage.steps.clearSetCharacterLimitInputField();
|
310
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
311
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'This is a marigold flower');
|
312
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(0, 'This is a marigold flower');
|
313
|
+
});
|
314
|
+
|
315
|
+
it('When the user tries to enter a response using Enter key in the response fields then the user should not be able to do so and should be able to enter the specified number of characters only for the preview tab response field', () => {
|
316
|
+
fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
|
317
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'This {enter}f{enter}l{enter}o{enter}we{enter}r{enter}');
|
318
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(0, 'This flower');
|
319
|
+
});
|
320
|
+
|
321
|
+
it('The user should be able to update the set character limit, after updating the character limit value, user should not be able to add characters more than the set value in the preview tab response field', () => {
|
322
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
323
|
+
fillInTheGapsOverImageTextPage.steps.setCharacterLimit(45);
|
324
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
325
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'This is a marigold flower with 6 petals and four leaves and a branch');
|
326
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(0, 'This is a marigold flower with 6 petals and f');
|
327
|
+
});
|
328
|
+
});
|
329
|
+
|
330
|
+
describe('Additional settings: Height and Width - Contents and set correct answer section', () => {
|
331
|
+
abortEarlySetup();
|
332
|
+
before(() => {
|
333
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
334
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
335
|
+
cy.barsPreLoaderWait();
|
336
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
337
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
338
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
339
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
340
|
+
});
|
341
|
+
|
342
|
+
it('\'Height (px)\' and \'Width (px)\' labels and input fields should be displayed and by default, the input fields should be empty', () => {
|
343
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.responseFieldHeightLabel(), 'Height (px)');
|
344
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseFieldHeightLabel(), 'visible');
|
345
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseFieldHeightInputField(), 'visible');
|
346
|
+
fillInTheGapsOverImageTextPage.steps.verifyAdditionalSettingsHeightInputFieldValue('');
|
347
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.responseFieldWidthLabel(), 'Width (px)');
|
348
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseFieldWidthLabel(), 'visible');
|
349
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseFieldWidthInputField(), 'visible');
|
350
|
+
fillInTheGapsOverImageTextPage.steps.verifyAdditionalSettingsWidthInputFieldValue('');
|
351
|
+
});
|
352
|
+
|
353
|
+
it('When the input field of \'Height\' and \'Width\' is kept empty, the default dimension of the response field should be (197x46)px in the \'Set correct answer\' section response field', () => {
|
354
|
+
fillInTheGapsOverImageTextPage.steps.verifyHeightResponseFieldSetCorrectAnswerSection(0, '46px');
|
355
|
+
fillInTheGapsOverImageTextPage.steps.verifyWidthResponseFieldSetCorrectAnswerSection(0, '13.7em');
|
356
|
+
});
|
357
|
+
|
358
|
+
it('When the user adds \'Height\' for the response field then the height of the response field should get updated accordingly in the \'Set correct answer\' section', () => {
|
359
|
+
fillInTheGapsOverImageTextPage.steps.setResponseFieldHeightGlobal(100);
|
360
|
+
fillInTheGapsOverImageTextPage.steps.verifyHeightResponseFieldSetCorrectAnswerSection(0, '100px');
|
361
|
+
});
|
362
|
+
|
363
|
+
it('When the user adds \'Width\' for the response field then the Width of the response field should get updated accordingly in the \'Set correct answer\' section', () => {
|
364
|
+
fillInTheGapsOverImageTextPage.steps.setResponseFieldWidthGlobal(100);
|
365
|
+
fillInTheGapsOverImageTextPage.steps.verifyWidthResponseFieldSetCorrectAnswerSection(0, '100px');
|
366
|
+
});
|
367
|
+
|
368
|
+
it('When the user enters a value below 80px in the \'Width\' input field then the width of the input field should remain 80px in \'Set correct answer\' section', () => {
|
369
|
+
fillInTheGapsOverImageTextPage.steps.setResponseFieldWidthGlobal(20);
|
370
|
+
fillInTheGapsOverImageTextPage.steps.verifyWidthResponseFieldSetCorrectAnswerSection(0, '80px');
|
371
|
+
});
|
372
|
+
|
373
|
+
it('When the user enters a value above 400px in the \'Width\' input field then the width of the input field should remain 400px in \'Set correct answer\' section', () => {
|
374
|
+
fillInTheGapsOverImageTextPage.steps.setResponseFieldWidthGlobal(800);
|
375
|
+
fillInTheGapsOverImageTextPage.steps.verifyWidthResponseFieldSetCorrectAnswerSection(0, '400px');
|
376
|
+
});
|
377
|
+
|
378
|
+
it('CSS of \'Height (px)\' and \'Width (px)\' labels and input fields', { tags: 'css' }, () => {
|
379
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.heightLabel(), {
|
380
|
+
'color': css.color.labels,
|
381
|
+
'font-size': css.fontSize.normal,
|
382
|
+
'font-weight': css.fontWeight.semibold
|
383
|
+
});
|
384
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.heightInputField(), {
|
385
|
+
'color': css.color.text,
|
386
|
+
'font-size': css.fontSize.default,
|
387
|
+
'font-weight': css.fontWeight.regular
|
388
|
+
});
|
389
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.widthLabel(), {
|
390
|
+
'color': css.color.labels,
|
391
|
+
'font-size': css.fontSize.normal,
|
392
|
+
'font-weight': css.fontWeight.semibold
|
393
|
+
});
|
394
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.widthInputField(), {
|
395
|
+
'color': css.color.text,
|
396
|
+
'font-size': css.fontSize.default,
|
397
|
+
'font-weight': css.fontWeight.regular
|
398
|
+
});
|
399
|
+
});
|
400
|
+
|
401
|
+
//Note: a11y covered in Additional settings accordion, verifyAdditonalSettingsAccordionProperties
|
402
|
+
});
|
403
|
+
|
404
|
+
describe('Additional settings: Height and Width - Preview tab', () => {
|
405
|
+
abortEarlySetup();
|
406
|
+
before(() => {
|
407
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
408
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
409
|
+
cy.barsPreLoaderWait();
|
410
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
411
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
412
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
413
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
|
414
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
415
|
+
});
|
416
|
+
|
417
|
+
it('When the input field of \'Height\' and \'Width\' is kept empty, the default dimension of the response field should be (197x46)px for the preview tab', () => {
|
418
|
+
fillInTheGapsOverImageTextPage.steps.verifyHeightResponseFieldPreviewTab(0, '46px');
|
419
|
+
fillInTheGapsOverImageTextPage.steps.verifyWidthResponseFieldPreviewTab(0, '13.7em');
|
420
|
+
});
|
421
|
+
|
422
|
+
it('When the user adds \'Height\' for the response field then the height of the response field should get updated accordingly in the preview tab', () => {
|
423
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
424
|
+
fillInTheGapsOverImageTextPage.steps.setResponseFieldHeightGlobal(100);
|
425
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
426
|
+
fillInTheGapsOverImageTextPage.steps.verifyHeightResponseFieldPreviewTab(0, '100px');
|
427
|
+
});
|
428
|
+
|
429
|
+
it('When the user adds \'Width\' for the response field then the response fields should get updated accordingly in the preview tab', () => {
|
430
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
431
|
+
fillInTheGapsOverImageTextPage.steps.setResponseFieldWidthGlobal(100);
|
432
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
433
|
+
fillInTheGapsOverImageTextPage.steps.verifyWidthResponseFieldPreviewTab(0, '100px');
|
434
|
+
});
|
435
|
+
|
436
|
+
it('When the user enters a value below 80px in the \'Width\' input field then the input field should remain 80px for the preview tab response fields', () => {
|
437
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
438
|
+
fillInTheGapsOverImageTextPage.steps.setResponseFieldWidthGlobal(20);
|
439
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
440
|
+
fillInTheGapsOverImageTextPage.steps.verifyWidthResponseFieldPreviewTab(0, '80px');
|
441
|
+
});
|
442
|
+
|
443
|
+
it('When the user enters a value above 400px in the \'Width\' input field then the input field should remain 400px for preview tab response field', () => {
|
444
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
445
|
+
fillInTheGapsOverImageTextPage.steps.setResponseFieldWidthGlobal(800);
|
446
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
447
|
+
fillInTheGapsOverImageTextPage.steps.verifyHeightResponseFieldPreviewTab(0, '400px');
|
448
|
+
});
|
449
|
+
});
|
450
|
+
});
|