itemengine-cypress-automation 1.0.85 → 1.0.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/Dockerfile +2 -1
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +30 -30
  3. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  4. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +568 -0
  5. package/cypress/e2e/ILC/EssayResponse/editAndPreviewTabScoringSection.js +86 -0
  6. package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +389 -0
  7. package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +112 -0
  8. package/cypress/e2e/ILC/EssayResponse/headerSection.js +68 -0
  9. package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +290 -0
  10. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +79 -0
  11. package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +379 -0
  12. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
  13. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +115 -0
  14. package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +79 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/partialDifferentWeightsBasic.js +159 -0
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +507 -29
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +6 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +272 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +300 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +204 -0
  22. package/cypress/e2e/ILC/Protractor/protractorEditTabBasicsSection.js +4 -4
  23. package/cypress/e2e/ILC/Protractor/protractorEditTabFunctionality.js +1 -1
  24. package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +4 -4
  25. package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -1
  26. package/cypress/e2e/ILC/SingleSelection/editTabScoringSection.js +1 -3
  27. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +205 -0
  28. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +259 -0
  29. package/cypress/e2e/ILC/TextEntryMath/evaluationMethods2.js +217 -0
  30. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +202 -0
  31. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +613 -0
  32. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +71 -0
  33. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +318 -318
  34. package/cypress/fixtures/theme/ilc.json +3 -0
  35. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -2
  36. package/cypress/pages/components/colorPopupComponent.js +26 -3
  37. package/cypress/pages/components/createCustomCategoryFlyout.js +351 -46
  38. package/cypress/pages/components/customizeSpecialCharacterComponent.js +165 -0
  39. package/cypress/pages/components/equationEditorFlyout.js +124 -0
  40. package/cypress/pages/components/essayResponseCommonComponents.js +3 -0
  41. package/cypress/pages/components/figOverImageCanvasComponent.js +316 -7
  42. package/cypress/pages/components/index.js +3 -1
  43. package/cypress/pages/components/opacityComponent.js +31 -4
  44. package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +1 -0
  45. package/cypress/pages/components/specialCharactersFlyoutComponent.js +1 -0
  46. package/cypress/pages/drawingResponsePage.js +33 -138
  47. package/cypress/pages/essayResponsePage.js +612 -26
  48. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +48 -7
  49. package/cypress/pages/fillInTheGapsOverImageTextPage.js +267 -13
  50. package/package.json +1 -1
@@ -0,0 +1,389 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { essayResponsePage } from "../../../pages";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create question page - Essay Response: Question Instructions, Set limit', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Question Instructions input field - Edit tab', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ cy.log('Navigating to Essay response question type');
15
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
16
+ cy.barsPreLoaderWait();
17
+ });
18
+
19
+ essayResponsePage.tests.verifyQuestionInstructionsInputFieldEditTab();
20
+ });
21
+
22
+ describe('Question Instructions input field - Preview tab', () => {
23
+ abortEarlySetup();
24
+ before(() => {
25
+ cy.log('Navigating to Essay response question type');
26
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
27
+ cy.barsPreLoaderWait();
28
+ });
29
+
30
+ essayResponsePage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
31
+ });
32
+
33
+ describe('Essay response: Set limit section - Edit tab contents', () => {
34
+ abortEarlySetup();
35
+ before(() => {
36
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
37
+ cy.barsPreLoaderWait();
38
+ });
39
+
40
+ it('\'Set limit\' label should be displayed', () => {
41
+ utilities.verifyInnerText(essayResponsePage.setLimitLabel(), 'Set limit');
42
+ utilities.verifyElementVisibilityState(essayResponsePage.setLimitLabel(), 'visible');
43
+ });
44
+
45
+ it('\'Word\', \'Character\' and \'None\' labels and radio buttons should be displayed and by default \'Word\' should be selected', () => {
46
+ utilities.verifyInnerText(essayResponsePage.wordLabel(), 'Word');
47
+ utilities.verifyElementVisibilityState(essayResponsePage.wordLabel(), 'visible');
48
+ essayResponsePage.steps.verifyWordRadioButtonChecked();
49
+ utilities.verifyInnerText(essayResponsePage.characterLabel(), 'Character');
50
+ utilities.verifyElementVisibilityState(essayResponsePage.characterLabel(), 'visible');
51
+ essayResponsePage.steps.verifyCharacterRadioButtonUnchecked();
52
+ utilities.verifyInnerText(essayResponsePage.noneLabel(), 'None');
53
+ utilities.verifyElementVisibilityState(essayResponsePage.noneLabel(), 'visible');
54
+ essayResponsePage.steps.verifyNoneRadioButtonUnchecked();
55
+ });
56
+
57
+ it('\'Minimum word limit\' and \'Maximum word limit\' labels should be displayed', () => {
58
+ utilities.verifyInnerText(essayResponsePage.minimumLimitLabel(), 'Minimum word limit');
59
+ utilities.verifyElementVisibilityState(essayResponsePage.minimumLimitLabel(), 'visible');
60
+ utilities.verifyInnerText(essayResponsePage.maximumLimitLabel(), 'Maximum word limit');
61
+ utilities.verifyElementVisibilityState(essayResponsePage.maximumLimitLabel(), 'visible');
62
+ });
63
+
64
+ it('\'Minimum word limit\' and \'Maximum word limit\' input fields should be displayed and have 0 and 1000 value by default', () => {
65
+ utilities.verifyElementVisibilityState(essayResponsePage.minimumLimitInputField(), 'visible');
66
+ essayResponsePage.steps.verifyMinimumLimitInputField(0)
67
+ utilities.verifyElementVisibilityState(essayResponsePage.maximumLimitInputField(), 'visible');
68
+ essayResponsePage.steps.verifyMaximumLimitInputField(1000)
69
+ });
70
+
71
+ it('User should be able to update values in both the input fields', () => {
72
+ essayResponsePage.steps.setMinimumLimit(100);
73
+ essayResponsePage.steps.setMaximumLimit(500);
74
+ });
75
+
76
+ it('When the user clears the minimum word limit input field and focuses out of it, then error message \'Error: Minimum word limit is required\' should be displayed below the input field', () => {
77
+ essayResponsePage.steps.clearAndFocusOutOfMinimumLimitInputField();
78
+ utilities.verifyInnerText(essayResponsePage.errorMessage(), 'Error: Minimum word limit is required.');
79
+ utilities.verifyElementVisibilityState(essayResponsePage.errorMessage(), 'visible');
80
+ });
81
+
82
+ essayResponsePage.tests.verifyErrorMessageCSSAndA11y();
83
+
84
+ it('When the user enters value in minimum word limit input field then the error message should disappear', () => {
85
+ essayResponsePage.steps.setMinimumLimit(0);
86
+ utilities.verifyElementVisibilityState(essayResponsePage.errorMessage(), 'notExist');
87
+ });
88
+
89
+ it('When the user clears the maximum word limit input field and focuses out of it, then error message \'Error: Maximum word limit is required.\' should be displayed below the input field', () => {
90
+ essayResponsePage.steps.clearAndFocusOutOfMaximumLimitInputField();
91
+ utilities.verifyInnerText(essayResponsePage.errorMessage(), 'Error: Maximum word limit is required.');
92
+ utilities.verifyElementVisibilityState(essayResponsePage.errorMessage(), 'visible');
93
+ });
94
+
95
+ it('When the user enters value in maximum word limit input field then the error message should disappear', () => {
96
+ essayResponsePage.steps.setMaximumLimit(500);
97
+ utilities.verifyElementVisibilityState(essayResponsePage.errorMessage(), 'notExist');
98
+ });
99
+
100
+ 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', () => {
101
+ essayResponsePage.steps.setMinimumLimit(700);
102
+ essayResponsePage.steps.verifyMaximumLimitErrorMessage();
103
+ essayResponsePage.steps.verifyMinimumLimitErrorMessage();
104
+ });
105
+
106
+ essayResponsePage.tests.verifyErrorMessageCSSAndA11y();
107
+
108
+ 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', () => {
109
+ essayResponsePage.steps.setMinimumLimit(500);
110
+ utilities.verifyElementVisibilityState(essayResponsePage.errorMessage(), 'notExist');
111
+ });
112
+
113
+ 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', () => {
114
+ essayResponsePage.steps.setMaximumLimit(400);
115
+ essayResponsePage.steps.verifyMaximumLimitErrorMessage();
116
+ essayResponsePage.steps.verifyMinimumLimitErrorMessage();
117
+ });
118
+
119
+ 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', () => {
120
+ essayResponsePage.steps.setMaximumLimit(800);
121
+ utilities.verifyElementVisibilityState(essayResponsePage.errorMessage(), 'notExist');
122
+ });
123
+
124
+ it('\'Always show maximum limit\' and \'Always show minimum limit\' labels and checkbox should be displayed and by default \'Always show maximum limit\' should be checked', () => {
125
+ utilities.verifyInnerText(essayResponsePage.alwaysShowMaxLimitLabel(), 'Always show maximum limit');
126
+ utilities.verifyElementVisibilityState(essayResponsePage.alwaysShowMaxLimitLabel(), 'visible');
127
+ utilities.verifyInnerText(essayResponsePage.alwaysShowMinLimitLabel(), 'Always show minimum limit');
128
+ utilities.verifyElementVisibilityState(essayResponsePage.alwaysShowMinLimitLabel(), 'visible');
129
+ essayResponsePage.steps.verifyAlwaysShowMaximumLimitCheckboxIsChecked();
130
+ });
131
+
132
+ it('When the user selects \'Character\' radio button then labels should change to \'Minimum character limit\' and \'Maximum character limit\'', () => {
133
+ essayResponsePage.steps.checkCharacterRadioButton();
134
+ utilities.verifyInnerText(essayResponsePage.minimumLimitLabel(), 'Minimum character limit');
135
+ utilities.verifyInnerText(essayResponsePage.maximumLimitLabel(), 'Maximum character limit');
136
+ });
137
+
138
+ it('\'Minimum character limit\' and \'Maximum character limit\' input fields should be updated to 0 and 20000 by default', () => {
139
+ essayResponsePage.steps.verifyMinimumLimitInputField(0)
140
+ essayResponsePage.steps.verifyMaximumLimitInputField(20000)
141
+ });
142
+
143
+ it('User should be able to update values in both the input fields', () => {
144
+ essayResponsePage.steps.setMinimumLimit(750);
145
+ essayResponsePage.steps.setMaximumLimit(12000);
146
+ });
147
+
148
+ 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', () => {
149
+ essayResponsePage.steps.clearAndFocusOutOfMinimumLimitInputField();
150
+ utilities.verifyInnerText(essayResponsePage.errorMessage(), 'Error: Minimum character limit is required.');
151
+ utilities.verifyElementVisibilityState(essayResponsePage.errorMessage(), 'visible');
152
+ });
153
+
154
+ essayResponsePage.tests.verifyErrorMessageCSSAndA11y();
155
+
156
+ it('When the user enters value in minimum character limit input field then the error message should disappear', () => {
157
+ essayResponsePage.steps.setMinimumLimit(0);
158
+ utilities.verifyElementVisibilityState(essayResponsePage.errorMessage(), 'notExist');
159
+ });
160
+
161
+ 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', () => {
162
+ essayResponsePage.steps.clearAndFocusOutOfMaximumLimitInputField();
163
+ utilities.verifyInnerText(essayResponsePage.errorMessage(), 'Error: Maximum character limit is required.');
164
+ utilities.verifyElementVisibilityState(essayResponsePage.errorMessage(), 'visible');
165
+ });
166
+
167
+ it('When the user enters value in maximum character limit input field then the error message should disappear', () => {
168
+ essayResponsePage.steps.setMaximumLimit(500);
169
+ utilities.verifyElementVisibilityState(essayResponsePage.errorMessage(), 'notExist');
170
+ });
171
+
172
+ it('CSS of \'Set word limit\' sections', { tags: 'css' }, () => {
173
+ utilities.verifyCSS(essayResponsePage.setLimitLabel(), {
174
+ 'color': css.color.labels,
175
+ 'font-size': css.fontSize.normal,
176
+ 'font-weight': css.fontWeight.semibold
177
+ });
178
+ utilities.verifyCSS(essayResponsePage.wordLabel(), {
179
+ 'color': css.color.labelText,
180
+ 'font-size': css.fontSize.normal,
181
+ 'font-weight': css.fontWeight.regular
182
+ });
183
+ utilities.verifyCSS(essayResponsePage.characterLabel(), {
184
+ 'color': css.color.labelText,
185
+ 'font-size': css.fontSize.normal,
186
+ 'font-weight': css.fontWeight.regular
187
+ });
188
+ utilities.verifyCSS(essayResponsePage.noneLabel(), {
189
+ 'color': css.color.labelText,
190
+ 'font-size': css.fontSize.normal,
191
+ 'font-weight': css.fontWeight.regular
192
+ });
193
+ utilities.verifyCSS(essayResponsePage.minimumLimitLabel(), {
194
+ 'color': css.color.labels,
195
+ 'font-size': css.fontSize.normal,
196
+ 'font-weight': css.fontWeight.semibold
197
+ });
198
+ utilities.verifyCSS(essayResponsePage.minimumLimitLabel(), {
199
+ 'color': css.color.labels,
200
+ 'font-size': css.fontSize.normal,
201
+ 'font-weight': css.fontWeight.semibold
202
+ });
203
+ utilities.verifyCSS(essayResponsePage.minimumLimitInputField(), {
204
+ 'color': css.color.text,
205
+ 'font-size': css.fontSize.default,
206
+ 'font-weight': css.fontWeight.regular
207
+ });
208
+ utilities.verifyCSS(essayResponsePage.maximumLimitInputField(), {
209
+ 'color': css.color.text,
210
+ 'font-size': css.fontSize.default,
211
+ 'font-weight': css.fontWeight.regular
212
+ });
213
+ utilities.verifyCSS(essayResponsePage.alwaysShowMaxLimitLabel(), {
214
+ 'color': css.color.labelText,
215
+ 'font-size': css.fontSize.normal,
216
+ 'font-weight': css.fontWeight.regular
217
+ });
218
+ utilities.verifyCSS(essayResponsePage.alwaysShowMinLimitLabel(), {
219
+ 'color': css.color.labelText,
220
+ 'font-size': css.fontSize.normal,
221
+ 'font-weight': css.fontWeight.regular
222
+ });
223
+ utilities.verifyCSS(essayResponsePage.characterRadioButton().parent().find('svg'), {
224
+ 'fill': css.color.activeButtons
225
+ });
226
+ });
227
+
228
+ it('Accessibility of \'Set limit\' section', { tags: 'a11y' }, () => {
229
+ cy.checkAccessibility(essayResponsePage.setLimitLabel().parents('.essay-response-set-limit-wrapper'));
230
+ });
231
+
232
+ it('When the user selects \'None\' radio button then the maximum and minimum limit labels and input field and always show maximum/minimum limits labels and checkbox should not be displayed', () => {
233
+ essayResponsePage.steps.checkNoneRadioButton();
234
+ utilities.verifyElementVisibilityState(essayResponsePage.minMaxLabelAndInputFieldWrapper(), 'notExist');
235
+ utilities.verifyElementVisibilityState(essayResponsePage.alwaysShowMaxLimitLabel(), 'notExist');
236
+ utilities.verifyElementVisibilityState(essayResponsePage.alwaysShowMaxLimitLabel(), 'notExist');
237
+ utilities.verifyElementVisibilityState(essayResponsePage.alwaysShowMaxLimitCheckbox(), 'notExist');
238
+ utilities.verifyElementVisibilityState(essayResponsePage.alwaysShowMaxLimitCheckbox(), 'notExist');
239
+ });
240
+ });
241
+
242
+ describe('Essay response: Set limit section : Word - Edit tab functionality', () => {
243
+ abortEarlySetup();
244
+ before(() => {
245
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
246
+ cy.barsPreLoaderWait();
247
+ essayResponsePage.steps.switchToPreviewTab();
248
+ });
249
+
250
+ it('When user switched to the preview tab then \'Maximum 1000 words\' should be displayed in the preview tab', () => {
251
+ utilities.verifyElementVisibilityState(essayResponsePage.responseFieldWordCount(), 'visible');
252
+ essayResponsePage.steps.verifyWordLimitInPreviewTab(1000);
253
+ });
254
+
255
+ it('When the user updates the maximum word limit input field value then updated maximum word limit value should be displayed in the preview tab', () => {
256
+ essayResponsePage.steps.switchToEditTab();
257
+ essayResponsePage.steps.setMaximumLimit(5);
258
+ essayResponsePage.steps.switchToPreviewTab();
259
+ essayResponsePage.steps.verifyWordLimitInPreviewTab(5);
260
+ });
261
+
262
+ it('When the user updates the minimum word limit input field value and checks the \'Always show minimum limit\' checkbox then \'Minimum value - Maximum value words required\' should be displayed in the preview tab', () => {
263
+ essayResponsePage.steps.switchToEditTab();
264
+ essayResponsePage.steps.setMinimumLimit(3);
265
+ essayResponsePage.steps.checkAlwaysShowMinimumLimitCheckbox()
266
+ essayResponsePage.steps.switchToPreviewTab();
267
+ essayResponsePage.steps.verifyWordLimitInPreviewTab(5, 3);
268
+ });
269
+
270
+ it('User should able to enter text in the response field', () => {
271
+ essayResponsePage.steps.enterTextInResponseField('Lorem Ipsum');
272
+ });
273
+
274
+ it('When the user reaches the word limit, then the warning message \'Maximum 5 words have been entered\' should be displayed', () => {
275
+ essayResponsePage.steps.enterInputInResponseField(' dolor sit amet');
276
+ essayResponsePage.steps.verifyResponseFieldInput('Lorem Ipsum dolor sit amet')
277
+ essayResponsePage.steps.verifyLimitReachedWarningMessage('Maximum 5 words have been entered.')
278
+ });
279
+
280
+ it('CSS of \'word limit reached\' warning message and container', { tags: 'css' }, () => {
281
+ utilities.verifyCSS(essayResponsePage.limitReachedWarningMessage(), {
282
+ 'color': css.color.warningMessage,
283
+ 'font-size': css.fontSize.normal,
284
+ 'font-weight': css.fontWeight.regular
285
+ });
286
+ utilities.verifyCSS(essayResponsePage.limitReachedWarningMessageContainer().find('svg'), {
287
+ 'color': css.color.warningMessage,
288
+ });
289
+ utilities.verifyCSS(essayResponsePage.limitReachedWarningMessageContainer(), {
290
+ 'border': `1px solid ${css.color.warningContainerBorder}`
291
+ });
292
+ utilities.verifyCSS(essayResponsePage.limitReachedWarningMessageContainer().find('.error-icon-wrapper'), {
293
+ 'background-color': css.color.warningContainerBackground
294
+ });
295
+ });
296
+
297
+ it('Accessibility of \'word limit reached\' warning container', { tags: 'a11y' }, () => {
298
+ cy.checkAccessibility(essayResponsePage.limitReachedWarningMessageContainer());
299
+ });
300
+
301
+ it('When the user removes/deletes some words, the warning message should disappear', () => {
302
+ essayResponsePage.steps.enterInputInResponseField('{backspace}{backspace}{backspace}{backspace}{backspace}');
303
+ essayResponsePage.steps.verifyResponseFieldInput('Lorem Ipsum dolor sit');
304
+ essayResponsePage.steps.verifyLimitReachedWarningMessageNotExist();
305
+ });
306
+
307
+ it('When the user enters the word less than the minimum word limit value set by the user and focus out of response field, then the warning message \'Minimum 3 words are required\' should be displayed', () => {
308
+ cy.log('Pre-step: clearing the response field');
309
+ essayResponsePage.steps.clearResponseField();
310
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
311
+ essayResponsePage.steps.focusOutOfResponseField();
312
+ essayResponsePage.steps.verifyLimitReachedWarningMessage('Minimum 3 words are required.');
313
+ });
314
+
315
+ it('When the user enters the word greater than the minimum word limit value set by the user, then the warning message should disappear', () => {
316
+ essayResponsePage.steps.enterInputInResponseField(' dolor sit');
317
+ essayResponsePage.steps.verifyResponseFieldInput('Lorem Ipsum dolor sit');
318
+ essayResponsePage.steps.verifyLimitReachedWarningMessageNotExist();
319
+ });
320
+ });
321
+
322
+ describe('Essay response: Set limit section: Character, None: Edit tab functionality', () => {
323
+ abortEarlySetup();
324
+ before(() => {
325
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
326
+ cy.barsPreLoaderWait();
327
+ });
328
+
329
+ it('When the user selects \'Character\' radio button then \'Maximum 20000 characters\' should be displayed in the preview tab', () => {
330
+ essayResponsePage.steps.checkCharacterRadioButton();
331
+ essayResponsePage.steps.switchToPreviewTab();
332
+ essayResponsePage.steps.verifyCharacterLimitInPreviewTab(20000);
333
+ });
334
+
335
+ it('When the user updates the maximum character limit input field value then updated maximum character limit value should be displayed in the preview tab', () => {
336
+ essayResponsePage.steps.switchToEditTab();
337
+ essayResponsePage.steps.setMaximumLimit(10);
338
+ essayResponsePage.steps.switchToPreviewTab();
339
+ essayResponsePage.steps.verifyCharacterLimitInPreviewTab(10);
340
+ });
341
+
342
+ it('When the user updates the minimum character limit input field value and checks the \'Always show minimum limit\' checkbox then \'Minimum value - Maximum value characters required\' should be displayed in the preview tab', () => {
343
+ essayResponsePage.steps.switchToEditTab();
344
+ essayResponsePage.steps.setMinimumLimit(6);
345
+ essayResponsePage.steps.checkAlwaysShowMinimumLimitCheckbox()
346
+ essayResponsePage.steps.switchToPreviewTab();
347
+ essayResponsePage.steps.verifyCharacterLimitInPreviewTab(10, 6);
348
+ });
349
+
350
+ it('User should able to enter characters in the response field', () => {
351
+ essayResponsePage.steps.enterTextInResponseField('Lorem');
352
+ });
353
+
354
+ it('When the user reaches the character limit, then the warning message \'Maximum 10 characters have been entered\' should be displayed', () => {
355
+ essayResponsePage.steps.enterInputInResponseField('dolar');
356
+ essayResponsePage.steps.verifyResponseFieldInput('Loremdolar')
357
+ essayResponsePage.steps.verifyLimitReachedWarningMessage('Maximum 10 characters have been entered.')
358
+ });
359
+
360
+ it('When the user removes/deletes some characters, the warning message should disappear', () => {
361
+ essayResponsePage.steps.enterInputInResponseField('{backspace}');
362
+ essayResponsePage.steps.verifyResponseFieldInput('Loremdola');
363
+ essayResponsePage.steps.verifyLimitReachedWarningMessageNotExist();
364
+ });
365
+
366
+ it('When the user enters the character less than the minimum character limit value set by the user and focus out of response field, then the warning message \'Minimum 6 characters are required\' should be displayed', () => {
367
+ cy.log('Pre-step: Clearing the response field');
368
+ essayResponsePage.steps.clearResponseField();
369
+ essayResponsePage.steps.enterInputInResponseField('Lore');
370
+ essayResponsePage.steps.focusOutOfResponseField();
371
+ essayResponsePage.steps.verifyLimitReachedWarningMessage('Minimum 6 characters are required.');
372
+ });
373
+
374
+ it('When the user enters the character greater than the minimum character limt value set by the user, then the warning message should disappear', () => {
375
+ essayResponsePage.steps.enterInputInResponseField('mdola');
376
+ essayResponsePage.steps.verifyResponseFieldInput('Loremdola');
377
+ essayResponsePage.steps.verifyLimitReachedWarningMessageNotExist();
378
+ });
379
+
380
+ it('When the user selects \'None\' radio button then maximum and minimum limits should not be displayed in the preview tab and when user types anything in the response field then error message should not be displayed', () => {
381
+ essayResponsePage.steps.switchToEditTab();
382
+ essayResponsePage.steps.checkNoneRadioButton();
383
+ essayResponsePage.steps.switchToPreviewTab();
384
+ utilities.verifyElementVisibilityState(essayResponsePage.responseFieldWordCount(), 'notExist');
385
+ essayResponsePage.steps.enterInputInResponseField('Loremdola');
386
+ essayResponsePage.steps.verifyLimitReachedWarningMessageNotExist();
387
+ });
388
+ });
389
+ });
@@ -0,0 +1,112 @@
1
+ import { correctAnswerViewPage, essayResponsePage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import { gradingViewPage } from "../../../pages";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+ let gradingAndCorrectAnsView = ['Grading view', 'Correct answer view']
7
+ const views = utilities.getViews(gradingAndCorrectAnsView);
8
+ var itemReferenceID = "";
9
+
10
+ describe('Create item page - Essay response: Grading view, Correct answer view contents', () => {
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ });
14
+
15
+ if (views.includes('Grading view')) {
16
+ describe('Grading view contents', { tags: 'smoke' }, () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ cy.log('Navigating to Essay response question type');
20
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
21
+ cy.barsPreLoaderWait();
22
+ essayResponsePage.steps.addQuestionInstructions();
23
+ essayResponsePage.steps.allotPoints(10);
24
+ essayResponsePage.steps.clickOnSaveQuestionButton();
25
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
26
+ //Global variable issue, not working inside before
27
+ itemPreviewPage.referenceID()
28
+ .invoke('text')
29
+ .then(($refID) => {
30
+ itemReferenceID = $refID;
31
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
32
+ utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarOption(), 'visible');
33
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
34
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
35
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
36
+ essayResponsePage.steps.enterInputInResponseField('This is a test for grading view preview contents');
37
+ studentViewPage.steps.submitResponse();
38
+ studentViewPage.steps.clickOnGoToGradingViewButton();
39
+ });
40
+ });
41
+
42
+ it('Question instructions should be visible', () => {
43
+ utilities.verifyInnerText(essayResponsePage.questionInstructionsText(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
44
+ utilities.verifyElementVisibilityState(essayResponsePage.questionInstructionsText(), 'visible');
45
+ });
46
+
47
+ it('The response submitted by the student should be visible in the response field of the grading view. The formatting toolbar options should not be visible in grading view', () => {
48
+ essayResponsePage.responseField()
49
+ .verifyInnerHTML('<p><strong><em><u>This is a test for grading view preview contents</u></em></strong></p>');
50
+ utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarWrapper(), 'hidden');
51
+ });
52
+
53
+ it('The content in the response field should not be editable', () => {
54
+ essayResponsePage.steps.verifyGradingViewResponseFieldIsNonEditable();
55
+ });
56
+
57
+ it('Empty score input field and total score should be displayed', () => {
58
+ gradingViewPage.steps.verifyGradingViewScore('', 10);
59
+ });
60
+
61
+ it('CSS of content in the response field', { tags: 'css' }, () => {
62
+ utilities.verifyCSS(essayResponsePage.responseField(), {
63
+ 'color': css.color.text,
64
+ 'font-size': css.fontSize.default,
65
+ 'font-weight': css.fontWeight.normal
66
+ });
67
+ });
68
+
69
+ it('Accessibility of content in the response field', { tags: 'a11y' }, () => {
70
+ cy.checkAccessibility(essayResponsePage.responseField());
71
+ });
72
+ });
73
+ }
74
+
75
+ if (views.includes('Correct answer view')) {
76
+ describe('Correct answer view contents', { tags: 'smoke' }, () => {
77
+ abortEarlySetup();
78
+ before(() => {
79
+ cy.log('Navigating to Essay response question type');
80
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
81
+ cy.barsPreLoaderWait();
82
+ essayResponsePage.steps.addQuestionInstructions();
83
+ essayResponsePage.steps.allotPoints(10);
84
+ essayResponsePage.steps.clickOnSaveQuestionButton();
85
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
86
+ //Global variable issue, not working inside before
87
+ itemPreviewPage.referenceID()
88
+ .invoke('text')
89
+ .then(($refID) => {
90
+ itemReferenceID = $refID
91
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
92
+ });
93
+ });
94
+
95
+ it('Question instructions should be visible', () => {
96
+ utilities.verifyTextContent(correctAnswerViewPage.correctAnswerViewQuestionInstructions(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
97
+ utilities.verifyElementVisibilityState(correctAnswerViewPage.correctAnswerViewQuestionInstructions(), 'visible');
98
+ });
99
+
100
+ it('\'This is a manual scored question\' help text should be displayed in the correct answer view', () => {
101
+ utilities.verifyTextContent(correctAnswerViewPage.manualScoredQuestionHelpText(), 'This is a manual scored question.');
102
+ utilities.verifyElementVisibilityState(correctAnswerViewPage.manualScoredQuestionHelpText(), 'visible');
103
+ });
104
+
105
+ it('The points alloted to the question should be displayed', () => {
106
+ correctAnswerViewPage.steps.verifyAvailablePoints(10);
107
+ });
108
+
109
+ //Need to add CSS and A11y here once updated designs are available for correct answer
110
+ });
111
+ }
112
+ });
@@ -0,0 +1,68 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { essayResponsePage, dialogBoxBase } from "../../../pages";
3
+ import { commonComponents } from "../../../pages/components";
4
+
5
+ describe('Create question page - Essay response: Header section and Saving question', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Header section contents', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
14
+ });
15
+
16
+ essayResponsePage.tests.verifyCreateQuestionPageQuestionTypeHeader('Essay response');
17
+ });
18
+
19
+ describe('Tabs section', () => {
20
+ abortEarlySetup();
21
+ before(() => {
22
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
23
+ });
24
+
25
+ essayResponsePage.tests.verifyTabsSection();
26
+ });
27
+
28
+ describe('Cancel button', () => {
29
+ abortEarlySetup();
30
+ before(() => {
31
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
32
+ });
33
+
34
+ essayResponsePage.tests.verifyCancelButton('essay response');
35
+ });
36
+
37
+ describe('Save Question button', () => {
38
+ abortEarlySetup();
39
+ before(() => {
40
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
41
+ cy.barsPreLoaderWait();
42
+ });
43
+
44
+ describe('Validation error messages', () => {
45
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
46
+
47
+ it('Validation error messages should be displayed below required input fields', () => {
48
+ essayResponsePage.steps.verifyQuestionInstructionsErrorMessage();
49
+ essayResponsePage.steps.verifyPointsFieldErrorMessage();
50
+ });
51
+
52
+ it('Validation error messages should disappear when required input fields are filled', () => {
53
+ essayResponsePage.steps.addQuestionInstructions();
54
+ essayResponsePage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
55
+ essayResponsePage.steps.allotPoints(20);
56
+ essayResponsePage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
57
+ });
58
+ });
59
+
60
+ describe('Saving a question', () => {
61
+ it('When user has filled all the mandatory fields then on clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
62
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
63
+ });
64
+
65
+ essayResponsePage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
66
+ });
67
+ });
68
+ });