itemengine-cypress-automation 1.0.90 → 1.0.91
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/Desmos/desmosGeometryToolPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +3 -3
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +418 -0
- package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +79 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/conditionalCheckboxScoring.js +335 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +64 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +334 -0
- package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +180 -0
- package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +55 -0
- package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +257 -0
- package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +68 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +773 -0
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +1 -1
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +50 -50
- package/cypress/fixtures/theme/ilc.json +1 -1
- package/cypress/pages/components/commonComponents.js +1 -1
- package/cypress/pages/components/desmosToolComponent.js +1 -1
- package/cypress/pages/components/equationEditorFlyout.js +118 -7
- package/cypress/pages/components/essayResponseCommonComponents.js +26 -1
- package/cypress/pages/components/figOverImageCanvasComponent.js +1 -1
- package/cypress/pages/drawingResponsePage.js +1 -1
- package/cypress/pages/essayResponsePage.js +106 -1
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +270 -8
- package/cypress/pages/readingRulerPage.js +64 -5
- package/cypress/pages/textEntryMathPage.js +112 -8
- package/package.json +1 -1
@@ -0,0 +1,334 @@
|
|
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
|
+
|
6
|
+
describe('Create item page - Fill in the gaps over image with text: Set limit section', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('fill in the gaps over image with text: Set limit section - Edit tab contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
});
|
17
|
+
|
18
|
+
it('\'Set limit\' label should be displayed', () => {
|
19
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.setLimitLabel(), 'Set limit');
|
20
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.setLimitLabel(), 'visible');
|
21
|
+
});
|
22
|
+
|
23
|
+
it('\'Character\' and \'None\' labels and radio buttons should be displayed and by default \'Character\' should be selected', () => {
|
24
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.characterLabel(), 'Character');
|
25
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.characterLabel(), 'visible');
|
26
|
+
fillInTheGapsOverImageTextPage.steps.verifyCharacterRadioButtonSelected();
|
27
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.noneLabel(), 'None');
|
28
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.noneLabel(), 'visible');
|
29
|
+
fillInTheGapsOverImageTextPage.steps.verifyNoneRadioButtonNotSelected();
|
30
|
+
});
|
31
|
+
|
32
|
+
it('\'Minimum character limit\' and \'Maximum character limit\' labels should be displayed', () => {
|
33
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.minimumCharacterLimitLabel(), 'Minimum character limit');
|
34
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.minimumCharacterLimitLabel(), 'visible');
|
35
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.maximumCharacterLimitLabel(), 'Maximum character limit');
|
36
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.maximumCharacterLimitLabel(), 'visible');
|
37
|
+
});
|
38
|
+
|
39
|
+
it('\'Minimum character limit\' and \'Maximum character limit\' input fields should be displayed and have 0 and 50 value by default', () => {
|
40
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.minimumCharacterLimitInputField(), 'visible');
|
41
|
+
fillInTheGapsOverImageTextPage.steps.verifyMinimumCharacterLimitInputField(0);
|
42
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.maximumCharacterLimitInputField(), 'visible');
|
43
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumCharacterLimitInputField(50);
|
44
|
+
});
|
45
|
+
|
46
|
+
it('User should be able to update values in both the input fields', () => {
|
47
|
+
fillInTheGapsOverImageTextPage.steps.setMinimumLimit(10);
|
48
|
+
fillInTheGapsOverImageTextPage.steps.setMaximumLimit(40);
|
49
|
+
});
|
50
|
+
|
51
|
+
it('When the user clears the minimum character limit input field and focuses out of it, then error message \'Error: Minimum character limit is required\' should be displayed below the input field', () => {
|
52
|
+
fillInTheGapsOverImageTextPage.steps.clearAndFocusOutOfMinimumCharacterLimitInputField();
|
53
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.errorMessage(), 'Error: Minimum character limit is required.');
|
54
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.errorMessage(), 'visible');
|
55
|
+
});
|
56
|
+
|
57
|
+
fillInTheGapsOverImageTextPage.tests.verifyErrorMessageCSSAndA11y();
|
58
|
+
|
59
|
+
it('When the user enters value in minimum character limit input field then the error message should disappear', () => {
|
60
|
+
fillInTheGapsOverImageTextPage.steps.setMinimumLimit(0);
|
61
|
+
fillInTheGapsOverImageTextPage.steps.verifyErrorMessageIsNotDisplayed();
|
62
|
+
});
|
63
|
+
|
64
|
+
it('When the user clears the maximum character limit input field and focuses out of it, then error message \'Error: Maximum character limit is required.\' should be displayed below the input field', () => {
|
65
|
+
fillInTheGapsOverImageTextPage.steps.clearAndFocusOutOfMaximumCharacterLimitInputField();
|
66
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.errorMessage(), 'Error: Maximum character limit is required.');
|
67
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.errorMessage(), 'visible');
|
68
|
+
});
|
69
|
+
|
70
|
+
it('When the user enters value in maximum character limit input field then the error message should disappear', () => {
|
71
|
+
fillInTheGapsOverImageTextPage.steps.setMaximumLimit(40);
|
72
|
+
fillInTheGapsOverImageTextPage.steps.verifyErrorMessageIsNotDisplayed();
|
73
|
+
});
|
74
|
+
|
75
|
+
it('When the user sets minimum limit input field value greater than maximum limit input field value then error message \'Error: Minimum limit must be less than or equal to maximum limit.\' and \'Error: Maximum limit must be greater than or equal to minimum limit.\'should be displayed below the minimum and maximum input field respectively', () => {
|
76
|
+
fillInTheGapsOverImageTextPage.steps.setMinimumLimit(45);
|
77
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumLimitErrorMessage();
|
78
|
+
fillInTheGapsOverImageTextPage.steps.verifyMinimumLimitErrorMessage();
|
79
|
+
});
|
80
|
+
|
81
|
+
fillInTheGapsOverImageTextPage.tests.verifyErrorMessageCSSAndA11y();
|
82
|
+
|
83
|
+
it('When the user sets minimum limit input field value less than or equal to maximum limit input field value then error message should disappear', () => {
|
84
|
+
fillInTheGapsOverImageTextPage.steps.setMinimumLimit(30);
|
85
|
+
fillInTheGapsOverImageTextPage.steps.verifyErrorMessageIsNotDisplayed();
|
86
|
+
});
|
87
|
+
|
88
|
+
it('When the user sets maximum limit input field value less than minimum limit input field value then error message \'Error: Minimum limit must be less than or equal to maximum limit.\' and \'Error: Maximum limit must be greater than or equal to minimum limit.\'should be displayed below the minimum and maximum input field respectively', () => {
|
89
|
+
fillInTheGapsOverImageTextPage.steps.setMaximumLimit(26);
|
90
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumLimitErrorMessage();
|
91
|
+
fillInTheGapsOverImageTextPage.steps.verifyMinimumLimitErrorMessage();
|
92
|
+
});
|
93
|
+
|
94
|
+
it('When the user sets maximum limit input field value greater than or equal to minimum limit input field value then error message should disappear', () => {
|
95
|
+
fillInTheGapsOverImageTextPage.steps.setMaximumLimit(45);
|
96
|
+
fillInTheGapsOverImageTextPage.steps.verifyErrorMessageIsNotDisplayed();
|
97
|
+
});
|
98
|
+
|
99
|
+
it('CSS of \'Set character limit\' sections', { tags: 'css' }, () => {
|
100
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.setLimitLabel(), {
|
101
|
+
'color': css.color.labels,
|
102
|
+
'font-size': css.fontSize.normal,
|
103
|
+
'font-weight': css.fontWeight.semibold
|
104
|
+
});
|
105
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.characterLabel(), {
|
106
|
+
'color': css.color.labelText,
|
107
|
+
'font-size': css.fontSize.normal,
|
108
|
+
'font-weight': css.fontWeight.regular
|
109
|
+
});
|
110
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.characterLabel(), {
|
111
|
+
'color': css.color.labelText,
|
112
|
+
'font-size': css.fontSize.normal,
|
113
|
+
'font-weight': css.fontWeight.regular
|
114
|
+
});
|
115
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.noneLabel(), {
|
116
|
+
'color': css.color.labelText,
|
117
|
+
'font-size': css.fontSize.normal,
|
118
|
+
'font-weight': css.fontWeight.regular
|
119
|
+
});
|
120
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.minimumCharacterLimitLabel(), {
|
121
|
+
'color': css.color.labels,
|
122
|
+
'font-size': css.fontSize.normal,
|
123
|
+
'font-weight': css.fontWeight.semibold
|
124
|
+
});
|
125
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.minimumCharacterLimitLabel(), {
|
126
|
+
'color': css.color.labels,
|
127
|
+
'font-size': css.fontSize.normal,
|
128
|
+
'font-weight': css.fontWeight.semibold
|
129
|
+
});
|
130
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.minimumCharacterLimitInputField(), {
|
131
|
+
'color': css.color.text,
|
132
|
+
'font-size': css.fontSize.default,
|
133
|
+
'font-weight': css.fontWeight.regular
|
134
|
+
});
|
135
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.maximumCharacterLimitInputField(), {
|
136
|
+
'color': css.color.text,
|
137
|
+
'font-size': css.fontSize.default,
|
138
|
+
'font-weight': css.fontWeight.regular
|
139
|
+
});
|
140
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.characterRadioButton().parent().find('svg'), {
|
141
|
+
'fill': css.color.activeButtons
|
142
|
+
});
|
143
|
+
});
|
144
|
+
|
145
|
+
it('Accessibility of \'Set limit\' section', { tags: 'a11y' }, () => {
|
146
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.setLimitLabel().parents('[class*="SetLimitWrapper"]'));
|
147
|
+
});
|
148
|
+
|
149
|
+
it('When user enters zero in maximum limit input field, then error message \'Error: Maximum limit must be greater than 0.\' should be displayed', () => {
|
150
|
+
fillInTheGapsOverImageTextPage.steps.setMaximumLimit(0);
|
151
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.errorMessage(), 'Error: Maximum limit must be greater than 0.');
|
152
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.errorMessage(), 'visible');
|
153
|
+
});
|
154
|
+
|
155
|
+
it('When user enters limit more than zero in maximum limit input field, then error message should disappear', () => {
|
156
|
+
fillInTheGapsOverImageTextPage.steps.setMaximumLimit(50);
|
157
|
+
fillInTheGapsOverImageTextPage.steps.verifyErrorMessageIsNotDisplayed();
|
158
|
+
});
|
159
|
+
|
160
|
+
it('When user should not be able to add limit more than 50 inside minimum and maximum limit input field', () => {
|
161
|
+
fillInTheGapsOverImageTextPage.steps.setMinimumLimit(60);
|
162
|
+
fillInTheGapsOverImageTextPage.steps.verifyMinimumLimit(6);
|
163
|
+
fillInTheGapsOverImageTextPage.steps.setMaximumLimit(60);
|
164
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumLimit(6);
|
165
|
+
});
|
166
|
+
|
167
|
+
it('When the user selects \'None\' radio button then the maximum and minimum character limit labels and input field should not be displayed', () => {
|
168
|
+
fillInTheGapsOverImageTextPage.steps.selectNoneRadioButton();
|
169
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.minMaxLabelAndInputFieldWrapper(), 'notExist');
|
170
|
+
});
|
171
|
+
});
|
172
|
+
|
173
|
+
// TODO after https://redmine.zeuslearning.com/issues/556897 gets resolved
|
174
|
+
describe('fill in the gaps over image with text: Set limit section : Edit tab functionality', () => {
|
175
|
+
abortEarlySetup();
|
176
|
+
before(() => {
|
177
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
178
|
+
cy.barsPreLoaderWait();
|
179
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
180
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
181
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(60);
|
182
|
+
});
|
183
|
+
|
184
|
+
it('When maximum character limit input field value is 50 then maximum character limit should be 50 in the specify correct answer section', () => {
|
185
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumCharacterLimitInputField(50);
|
186
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumCharacterLimit(0, 50);
|
187
|
+
});
|
188
|
+
|
189
|
+
it('When the user updates the maximum character limit input field value then maximum character limit should update in the specify correct answer section', () => {
|
190
|
+
fillInTheGapsOverImageTextPage.steps.setMaximumLimit(10);
|
191
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumCharacterLimit(0, 10);
|
192
|
+
});
|
193
|
+
|
194
|
+
it('User should able to enter characters in the answer input field', () => {
|
195
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }]);
|
196
|
+
});
|
197
|
+
|
198
|
+
it('When the user reaches the character limit, then the warning message \'Maximum 10 characters have been entered\' should be displayed', () => {
|
199
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'pots' }]);
|
200
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseAccordionAnswerInputField([{ responseIndex: 0, responseText: 'Flowerpots' }])
|
201
|
+
fillInTheGapsOverImageTextPage.steps.verifyLimitReachedWarningMessageExist('Maximum 10 words have been entered.');
|
202
|
+
});
|
203
|
+
|
204
|
+
it('CSS of error message', { tags: 'css' }, () => {
|
205
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.limitReachedWarningMessage(), {
|
206
|
+
'color': css.color.warningMessage,
|
207
|
+
'font-size': css.fontSize.normal,
|
208
|
+
'font-weight': css.fontWeight.regular
|
209
|
+
});
|
210
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.limitReachedWarningMessageContainer().find('svg'), {
|
211
|
+
'color': css.color.warningMessage,
|
212
|
+
});
|
213
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.limitReachedWarningMessageContainer(), {
|
214
|
+
'border': `1px solid ${css.color.warningContainerBorder}`
|
215
|
+
});
|
216
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.limitReachedWarningMessageContainer(), {
|
217
|
+
'background-color': css.color.warningContainerBackground
|
218
|
+
});
|
219
|
+
});
|
220
|
+
|
221
|
+
it('Accessibility of error message', { tags: 'a11y' }, () => {
|
222
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.limitReachedWarningMessage());
|
223
|
+
});
|
224
|
+
|
225
|
+
it('When the user removes/deletes some characters to make the number of characters less than the set maximum limit, the warning message should disappear', () => {
|
226
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: '{backspace}' }]);
|
227
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseAccordionAnswerInputField([{ responseIndex: 0, responseText: 'Flowerpot' }])
|
228
|
+
fillInTheGapsOverImageTextPage.steps.verifyLimitReachedWarningMessageNotExist();
|
229
|
+
});
|
230
|
+
|
231
|
+
it('When the user updates minimum character limit and enters character less than the minimum character limit value set and focus out of response field, then the warning message \'Minimum 6 characters are required\' should be displayed in specify correct answer', () => {
|
232
|
+
fillInTheGapsOverImageTextPage.steps.setMinimumLimit(6);
|
233
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Air' }]);
|
234
|
+
fillInTheGapsOverImageTextPage.steps.verifyLimitReachedWarningMessageExist('Minimum 6 words are required.');
|
235
|
+
});
|
236
|
+
|
237
|
+
it('When the user enters the character greater than the minimum character limit value set by the user, then the warning message should disappear', () => {
|
238
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Airwater' }]);
|
239
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInResponseAccordionAnswerInputField([{ responseIndex: 0, responseText: 'Airwater' }])
|
240
|
+
fillInTheGapsOverImageTextPage.steps.verifyLimitReachedWarningMessageNotExist();
|
241
|
+
});
|
242
|
+
|
243
|
+
it('When the user selects \'None\' radio button then maximum limit should not be displayed in the preview tab and when user types anything in the response field then error message should not be displayed', () => {
|
244
|
+
fillInTheGapsOverImageTextPage.steps.selectNoneRadioButton();
|
245
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumCharacterLimitNotExistInPreviewTab(0);
|
246
|
+
fillInTheGapsOverImageTextPage.steps.addTextInAnswerInputFieldsPreviewTab(0, 'water');
|
247
|
+
fillInTheGapsOverImageTextPage.steps.verifyLimitReachedWarningMessageNotExist();
|
248
|
+
});
|
249
|
+
});
|
250
|
+
|
251
|
+
describe('fill in the gaps over image with text: Set limit section : Preview tab functionality', () => {
|
252
|
+
abortEarlySetup();
|
253
|
+
before(() => {
|
254
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
255
|
+
cy.barsPreLoaderWait();
|
256
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
257
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
258
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(60);
|
259
|
+
});
|
260
|
+
|
261
|
+
it('When maximum character limit input field value is 50 then maximum character limit should be 50 in the preview tab', () => {
|
262
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumCharacterLimitInputField(50);
|
263
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
264
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumCharacterLimitInPreviewTab(0, 50);
|
265
|
+
});
|
266
|
+
|
267
|
+
it('When the user updates the maximum character limit input field value then maximum character limit should update in the preview tab', () => {
|
268
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
269
|
+
fillInTheGapsOverImageTextPage.steps.setMaximumLimit(10);
|
270
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
271
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumCharacterLimitInPreviewTab(0, 10);
|
272
|
+
});
|
273
|
+
|
274
|
+
it('User should able to enter characters in the response field', () => {
|
275
|
+
fillInTheGapsOverImageTextPage.steps.addTextInAnswerInputFieldsPreviewTab(0, 'Flower');
|
276
|
+
});
|
277
|
+
|
278
|
+
it('When the user reaches the character limit, then the warning message \'Maximum 10 characters have been entered\' should be displayed', () => {
|
279
|
+
fillInTheGapsOverImageTextPage.steps.addTextInAnswerInputFieldsPreviewTab(0, 'pots');
|
280
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flowerpots' }])
|
281
|
+
fillInTheGapsOverImageTextPage.steps.verifyLimitReachedWarningMessageExist('Maximum 10 words have been entered.');
|
282
|
+
});
|
283
|
+
|
284
|
+
it('CSS of error message', { tags: 'css' }, () => {
|
285
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.limitReachedWarningMessage(), {
|
286
|
+
'color': css.color.warningMessage,
|
287
|
+
'font-size': css.fontSize.normal,
|
288
|
+
'font-weight': css.fontWeight.regular
|
289
|
+
});
|
290
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.limitReachedWarningMessageContainer().find('svg'), {
|
291
|
+
'color': css.color.warningMessage,
|
292
|
+
});
|
293
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.limitReachedWarningMessageContainer(), {
|
294
|
+
'border': `1px solid ${css.color.warningContainerBorder}`
|
295
|
+
});
|
296
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.limitReachedWarningMessageContainer(), {
|
297
|
+
'background-color': css.color.warningContainerBackground
|
298
|
+
});
|
299
|
+
});
|
300
|
+
|
301
|
+
it('Accessibility of error message', { tags: 'a11y' }, () => {
|
302
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.limitReachedWarningMessage());
|
303
|
+
});
|
304
|
+
|
305
|
+
it('When the user removes/deletes some characters to make the number of characters less than the set maximum limit, the warning message should disappear', () => {
|
306
|
+
fillInTheGapsOverImageTextPage.steps.addTextInAnswerInputFieldsPreviewTab(0, '{backspace}');
|
307
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flowerpot' }])
|
308
|
+
fillInTheGapsOverImageTextPage.steps.verifyLimitReachedWarningMessageNotExist();
|
309
|
+
});
|
310
|
+
|
311
|
+
it('When the user updates minimum character limit in edit tab and enters character less than the minimum character limit value set and focus out of response field, then the warning message \'Minimum 6 characters are required\' should be displayed in preview tab', () => {
|
312
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
313
|
+
fillInTheGapsOverImageTextPage.steps.setMinimumLimit(6);
|
314
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
315
|
+
fillInTheGapsOverImageTextPage.steps.addTextInAnswerInputFieldsPreviewTab(0, 'Air');
|
316
|
+
fillInTheGapsOverImageTextPage.steps.verifyLimitReachedWarningMessageExist('Minimum 6 words are required.');
|
317
|
+
});
|
318
|
+
|
319
|
+
it('When the user enters the character greater than the minimum character limit value set by the user, then the warning message should disappear', () => {
|
320
|
+
fillInTheGapsOverImageTextPage.steps.addTextInAnswerInputFieldsPreviewTab(0, 'water');
|
321
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Airwater' }])
|
322
|
+
fillInTheGapsOverImageTextPage.steps.verifyLimitReachedWarningMessageNotExist();
|
323
|
+
});
|
324
|
+
|
325
|
+
it('When the user selects \'None\' radio button then maximum limit should not be displayed in the preview tab and when user types anything in the response field then error message should not be displayed', () => {
|
326
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
327
|
+
fillInTheGapsOverImageTextPage.steps.selectNoneRadioButton();
|
328
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
329
|
+
fillInTheGapsOverImageTextPage.steps.verifyMaximumCharacterLimitNotExistInPreviewTab(0);
|
330
|
+
fillInTheGapsOverImageTextPage.steps.addTextInAnswerInputFieldsPreviewTab(0, 'water');
|
331
|
+
fillInTheGapsOverImageTextPage.steps.verifyLimitReachedWarningMessageNotExist();
|
332
|
+
});
|
333
|
+
});
|
334
|
+
});
|
@@ -0,0 +1,180 @@
|
|
1
|
+
import { readingRulerPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Create Item page - Reading ruler: Edit Tab', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
//TODO: update below to lower case after https://redmine.zeuslearning.com/issues/542832 gets resolved
|
11
|
+
describe('\'Conditional checkboxes\', \'Color\', \'Default number of lines\' section -Edit Tab', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
cy.log('Navigating to \'Reading ruler\' resource tool');
|
15
|
+
readingRulerPage.steps.navigateToCreateResource('reading ruler');
|
16
|
+
});
|
17
|
+
|
18
|
+
it('\'Display button to student\' label and checkbox should be displayed and by default the checkbox should be checked', () => {
|
19
|
+
utilities.verifyInnerText(readingRulerPage.displayButtonToStudentLabel(), 'Display button to student');
|
20
|
+
utilities.verifyElementVisibilityState(readingRulerPage.displayButtonToStudentLabel(), 'visible');
|
21
|
+
readingRulerPage.steps.verifyDisplayButtonToStudentCheckboxIsChecked();
|
22
|
+
});
|
23
|
+
|
24
|
+
it('\'Allow student to resize\' label and checkbox should be displayed and by default the checkbox should be checked', () => {
|
25
|
+
utilities.verifyInnerText(readingRulerPage.allowStudentToResizeLabel(), 'Allow student to resize');
|
26
|
+
utilities.verifyElementVisibilityState(readingRulerPage.allowStudentToResizeLabel(), 'visible');
|
27
|
+
readingRulerPage.steps.verifyAllowStudentToResizeCheckboxIsChecked();
|
28
|
+
});
|
29
|
+
|
30
|
+
it('\'Visible on landing\' label and checkbox should be displayed and by default the checkbox should be unchecked', () => {
|
31
|
+
utilities.verifyInnerText(readingRulerPage.visibleOnLandingLabel(), 'Visible on landing');
|
32
|
+
utilities.verifyElementVisibilityState(readingRulerPage.visibleOnLandingLabel(), 'visible');
|
33
|
+
readingRulerPage.steps.verifyVisibleOnLandingCheckboxIsUnchecked();
|
34
|
+
});
|
35
|
+
|
36
|
+
//Failing due to https://redmine.zeuslearning.com/issues/541620
|
37
|
+
it('CSS of \'Conditional checkboxes\' label in Edit tab', { tags: 'css' }, () => {
|
38
|
+
const labels = [readingRulerPage.displayButtonToStudentLabel, readingRulerPage.allowStudentToResizeLabel, readingRulerPage.visibleOnLandingLabel]
|
39
|
+
labels.forEach(label => {
|
40
|
+
utilities.verifyCSS(label(), {
|
41
|
+
'color': css.color.labelText,
|
42
|
+
'font-size': css.fontSize.normal,
|
43
|
+
'font-weight': css.fontWeight.regular
|
44
|
+
});
|
45
|
+
});
|
46
|
+
});
|
47
|
+
|
48
|
+
it('\'Color\' label should be displayed', () => {
|
49
|
+
utilities.verifyInnerText(readingRulerPage.colorLabel(), 'Color');
|
50
|
+
utilities.verifyElementVisibilityState(readingRulerPage.colorLabel(), 'visible');
|
51
|
+
});
|
52
|
+
|
53
|
+
it('Five solid colors with the label \'Grey\', \'Black\', \'Blue\',\'Green\' and \'Red\' respectively should be displayed ', () => {
|
54
|
+
const colors = ['Gray', 'Black', 'Blue', 'Green', 'Red'];
|
55
|
+
const colorValues = ['rgb(112, 112, 112)', 'rgb(26, 26, 26)', 'rgb(0, 134, 153)', 'rgb(0, 159, 106)', 'rgb(153, 29, 0)'];
|
56
|
+
utilities.verifyElementCount(readingRulerPage.colorBlock(), 5);
|
57
|
+
colors.forEach((color, blockIndex) => {
|
58
|
+
readingRulerPage.steps.verifyColorBlock(blockIndex, color, colorValues[blockIndex]);
|
59
|
+
});
|
60
|
+
});
|
61
|
+
|
62
|
+
it('\'Grey\' color radio button should be preselected by default.', () => {
|
63
|
+
readingRulerPage.steps.verifyColorBlockSelectedState(0);
|
64
|
+
});
|
65
|
+
|
66
|
+
it('CSS of \'Color\' Section in Edit tab', { tags: 'css' }, () => {
|
67
|
+
utilities.verifyCSS(readingRulerPage.colorLabel(), {
|
68
|
+
'color': css.color.labels,
|
69
|
+
'font-size': css.fontSize.normal,
|
70
|
+
'font-weight': css.fontWeight.semibold
|
71
|
+
});
|
72
|
+
utilities.verifyCSS(readingRulerPage.colorBlockLabel(), {
|
73
|
+
'color': css.color.labelText,
|
74
|
+
'font-size': css.fontSize.normal,
|
75
|
+
'font-weight': css.fontWeight.regular
|
76
|
+
});
|
77
|
+
});
|
78
|
+
|
79
|
+
it('Accessibility of edit tab when \'Display button to student\' and \'Allow student to resize\' checkbox are checked', { tags: 'a11y' }, () => {
|
80
|
+
cy.checkAccessibility(readingRulerPage.displayButtonToStudentCheckbox().parents('.ngie-checkbox-form-group'));
|
81
|
+
});
|
82
|
+
|
83
|
+
it('When the user selects a color block from the \'Color\' section then the selected color should change and the selected icon should be displayed on the newly selected color', () => {
|
84
|
+
readingRulerPage.steps.selectColorBlock(2);
|
85
|
+
readingRulerPage.steps.verifyColorBlockSelectedState(2);
|
86
|
+
readingRulerPage.steps.verifyColorBlockUnSelectedState(0);
|
87
|
+
});
|
88
|
+
|
89
|
+
it('Accessibility of newly selected color', { tags: 'a11y' }, () => {
|
90
|
+
cy.checkAccessibility(readingRulerPage.colorBlock().parents('[aria-label="color"]'));
|
91
|
+
});
|
92
|
+
|
93
|
+
it('\'Default number of lines\' label and input field should be displayed and by default the input field should be prefilled with value 4', () => {
|
94
|
+
utilities.verifyInnerText(readingRulerPage.defaultNumberOfLinesLabel(), 'Default number of lines'
|
95
|
+
);
|
96
|
+
utilities.verifyElementVisibilityState(readingRulerPage.defaultNumberOfLinesLabel(), 'visible');
|
97
|
+
readingRulerPage.steps.verifyDefaultNumberOfLinesInputFieldValue('4');
|
98
|
+
utilities.verifyElementVisibilityState(readingRulerPage.defaultNumberOfLinesInputField(), 'visible');
|
99
|
+
});
|
100
|
+
|
101
|
+
it('User should able to update value in \'Default number of lines\' input field', () => {
|
102
|
+
readingRulerPage.steps.addInputToDefaultNumberOfLinesInputField('2')
|
103
|
+
readingRulerPage.steps.verifyDefaultNumberOfLinesInputFieldValue('2');
|
104
|
+
});
|
105
|
+
|
106
|
+
it('CSS of \'Default number of lines\' Section in Edit tab', { tags: 'css' }, () => {
|
107
|
+
utilities.verifyCSS(readingRulerPage.defaultNumberOfLinesLabel(), {
|
108
|
+
'color': css.color.labels,
|
109
|
+
'font-size': css.fontSize.normal,
|
110
|
+
'font-weight': css.fontWeight.semibold
|
111
|
+
});
|
112
|
+
utilities.verifyCSS(readingRulerPage.defaultNumberOfLinesInputField(), {
|
113
|
+
'color': css.color.text,
|
114
|
+
'font-size': css.fontSize.default,
|
115
|
+
'font-weight': css.fontWeight.regular
|
116
|
+
});
|
117
|
+
});
|
118
|
+
|
119
|
+
it('Accessibility of \'Default number of lines\' input field', { tags: 'a11y' }, () => {
|
120
|
+
cy.checkAccessibility(readingRulerPage.defaultNumberOfLinesInputField());
|
121
|
+
});
|
122
|
+
});
|
123
|
+
|
124
|
+
describe('Opacity section - Edit Tab contents', () => {
|
125
|
+
abortEarlySetup();
|
126
|
+
before(() => {
|
127
|
+
cy.log('Navigating to \'Reading ruler\' resource tool');
|
128
|
+
readingRulerPage.steps.navigateToCreateResource('reading ruler');
|
129
|
+
});
|
130
|
+
|
131
|
+
it('\'Opacity\' label and input field with the value 80 should be displayed', () => {
|
132
|
+
utilities.verifyInnerText(readingRulerPage.opacityLabel(), 'Opacity');
|
133
|
+
utilities.verifyElementVisibilityState(readingRulerPage.opacityLabel(), 'visible');
|
134
|
+
readingRulerPage.steps.verifyOpacityInputFieldValue(80);
|
135
|
+
utilities.verifyElementVisibilityState(readingRulerPage.opacityInputField(), 'visible');
|
136
|
+
});
|
137
|
+
|
138
|
+
it('Opacity slider should be displayed and by default the slider of \'Opacity\' should be set to 80 percent', () => {
|
139
|
+
utilities.verifyElementVisibilityState(readingRulerPage.opacitySlider(), 'visible');
|
140
|
+
readingRulerPage.steps.verifyOpacitySliderValue(80);
|
141
|
+
});
|
142
|
+
|
143
|
+
it('The maximum value of \'Opacity\' slider should be 100', () => {
|
144
|
+
readingRulerPage.steps.verifyMaxOpacitySliderValue(100)
|
145
|
+
});
|
146
|
+
|
147
|
+
it('CSS of \'Opacity\' Section in Edit tab', { tags: 'css' }, () => {
|
148
|
+
utilities.verifyCSS(readingRulerPage.opacityLabel(), {
|
149
|
+
'color': css.color.labels,
|
150
|
+
'font-size': css.fontSize.normal,
|
151
|
+
'font-weight': css.fontWeight.semibold
|
152
|
+
});
|
153
|
+
utilities.verifyCSS(readingRulerPage.opacityInputField(), {
|
154
|
+
'color': css.color.text,
|
155
|
+
'font-size': css.fontSize.default,
|
156
|
+
'font-weight': css.fontWeight.regular
|
157
|
+
});
|
158
|
+
utilities.verifyCSS(readingRulerPage.opacitySlider(), {
|
159
|
+
'color': css.color.activeButtons,
|
160
|
+
'font-weight': css.fontWeight.regular
|
161
|
+
});
|
162
|
+
});
|
163
|
+
|
164
|
+
it('Accessibility of opacity section', { tags: 'a11y' }, () => {
|
165
|
+
cy.checkAccessibility(readingRulerPage.opacityLabel().parents('.MuiGrid-root'));
|
166
|
+
});
|
167
|
+
|
168
|
+
it('When the user changes value in the opacity input field, the slider value should also change accordingly', () => {
|
169
|
+
readingRulerPage.steps.addInputToOpacityInputField(30);
|
170
|
+
readingRulerPage.steps.verifyOpacityInputFieldValue(30);
|
171
|
+
readingRulerPage.steps.verifyOpacitySliderValue(30);
|
172
|
+
});
|
173
|
+
|
174
|
+
it('When the user changes the opacity slider value, value in the opacity input field should also change', () => {
|
175
|
+
readingRulerPage.steps.clickOnOpacitySlider();
|
176
|
+
readingRulerPage.steps.verifyOpacitySliderValue(50);
|
177
|
+
readingRulerPage.steps.verifyOpacityInputFieldValue(50);
|
178
|
+
});
|
179
|
+
});
|
180
|
+
});
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { readingRulerPage } from "../../../pages";
|
2
|
+
import { commonComponents } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
|
5
|
+
describe('Create question page - Reading ruler: Header section and saving resource tool', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Header section contents', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
cy.log('Navigating to Reading ruler resource tool');
|
14
|
+
readingRulerPage.steps.navigateToCreateResource('reading ruler');
|
15
|
+
});
|
16
|
+
|
17
|
+
readingRulerPage.tests.verifyCreateQuestionPageQuestionTypeHeader('Reading ruler');
|
18
|
+
});
|
19
|
+
|
20
|
+
describe('Tabs section', () => {
|
21
|
+
abortEarlySetup();
|
22
|
+
before(() => {
|
23
|
+
cy.log('Navigating to Reading ruler resource tool');
|
24
|
+
readingRulerPage.steps.navigateToCreateResource('reading ruler');
|
25
|
+
});
|
26
|
+
|
27
|
+
readingRulerPage.tests.verifyTabsSection();
|
28
|
+
});
|
29
|
+
|
30
|
+
describe('Cancel button', () => {
|
31
|
+
abortEarlySetup();
|
32
|
+
before(() => {
|
33
|
+
cy.log('Navigating to Reading ruler resource tool');
|
34
|
+
readingRulerPage.steps.navigateToCreateResource('reading ruler');
|
35
|
+
});
|
36
|
+
|
37
|
+
readingRulerPage.tests.verifyCancelButton();
|
38
|
+
});
|
39
|
+
|
40
|
+
//TODO: Need to update cases after https://redmine.zeuslearning.com/issues/542818
|
41
|
+
describe('Save button', () => {
|
42
|
+
abortEarlySetup();
|
43
|
+
before(() => {
|
44
|
+
cy.log('Navigating to Reading ruler resource tool');
|
45
|
+
readingRulerPage.steps.navigateToCreateResource('reading ruler');
|
46
|
+
});
|
47
|
+
commonComponents.tests.verifyCreateItemWrapperContentsA11y();
|
48
|
+
|
49
|
+
it('When user has filled all the mandatory fields then on clicking on Save button the resource tool should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
50
|
+
readingRulerPage.steps.saveAQuestionAndVerifySnackbar();
|
51
|
+
});
|
52
|
+
|
53
|
+
readingRulerPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
54
|
+
});
|
55
|
+
});
|