itemengine-cypress-automation 1.0.180-essayResponseLazyLoadingFix-63cd8a3.0 → 1.0.182-repoUpdate22April-92d01da.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
  3. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +4 -5
  4. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +64 -3
  5. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
  6. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +29 -1
  7. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
  9. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
  17. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
  18. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -4
  19. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  20. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +1 -0
  21. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
  22. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  23. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
  24. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
  25. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
  26. package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
  27. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
  28. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
  29. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +216 -0
  30. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +214 -0
  31. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +251 -0
  32. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
  33. package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +243 -0
  34. package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
  35. package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -0
  36. package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
  37. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +1 -0
  38. package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
  39. package/cypress/e2e/ILC/NumberLine/LayoutSection.js +530 -0
  40. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
  41. package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +119 -0
  42. package/cypress/e2e/ILC/NumberLine/numberLineSection.js +263 -0
  43. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
  44. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
  45. package/cypress/e2e/ILC/NumberLine/toolSettings.js +2 -1
  46. package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
  47. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +49 -1
  48. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
  49. package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
  50. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
  51. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -1
  52. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -1
  53. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -1
  54. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +0 -1
  55. package/cypress/e2e/ILC/TextSelection/additionalSettings.js +125 -0
  56. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -1
  57. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
  58. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +5 -4
  59. package/cypress/e2e/ILC/TextSelection/headerSection.js +73 -0
  60. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +2 -2
  61. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.smoke.js +179 -0
  62. package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +89 -0
  63. package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +436 -0
  64. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +277 -0
  65. package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +222 -0
  66. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +260 -0
  67. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +380 -0
  68. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
  69. package/cypress/fixtures/constants.js +1 -1
  70. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
  71. package/cypress/fixtures/theme/ilc.json +16 -16
  72. package/cypress/pages/audioPlayerPage.js +55 -543
  73. package/cypress/pages/brainingCampManipulativePage.js +1 -1
  74. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
  75. package/cypress/pages/components/autoScoredStudentViewSettings.js +4 -4
  76. package/cypress/pages/components/commonComponents.js +1 -0
  77. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  78. package/cypress/pages/components/equationEditorFlyout.js +3 -2
  79. package/cypress/pages/components/essayResponseCommonComponents.js +8 -2
  80. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -0
  81. package/cypress/pages/components/imageCanvasComponent.js +2 -1
  82. package/cypress/pages/components/index.js +1 -0
  83. package/cypress/pages/components/optionsWrapperComponent.js +11 -0
  84. package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
  85. package/cypress/pages/components/toolSettingsComponent.js +6 -0
  86. package/cypress/pages/contentBlocksPage.js +2 -2
  87. package/cypress/pages/createItemPage.js +29 -0
  88. package/cypress/pages/dialogBoxBase.js +2 -2
  89. package/cypress/pages/drawingResponsePage.js +23 -4
  90. package/cypress/pages/feedbackScalePage.js +3 -0
  91. package/cypress/pages/graphingPage.js +18 -0
  92. package/cypress/pages/gridFillPage.js +18 -2
  93. package/cypress/pages/index.js +1 -1
  94. package/cypress/pages/itemPreviewSettingsPage.js +4 -0
  95. package/cypress/pages/listOrderingPage.js +122 -647
  96. package/cypress/pages/matchingPage.js +1 -1
  97. package/cypress/pages/multipleSelectionPage.js +23 -1
  98. package/cypress/pages/numberLinePage.js +1196 -59
  99. package/cypress/pages/rulerPage.js +6 -2
  100. package/cypress/pages/textSelectionPage.js +460 -22
  101. package/cypress/support/migrationHelpers/extractLrnQuestionData.js +2 -1
  102. package/cypress/support/migrationHelpers/verifyIeQuestionData.js +4 -1
  103. package/package.json +1 -1
  104. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -432
  105. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +0 -134
@@ -258,7 +258,7 @@ export const verifyIeQuestionData = {
258
258
  let textAreaPlaceholder = $element[0].attributes["data-cke-editorplaceholder"]?.nodeValue;
259
259
  expect(textAreaPlaceholder).to.be.eq(expectedQuestionData.textAreaPlaceholder);
260
260
  });
261
- if (expectedQuestionData.toolbarButtons.length != 0) {
261
+ if (expectedQuestionData.toolbarButtons.length !== 0) {
262
262
  let ieButtonsTitle = [];
263
263
  let ieButtonsExpected = expectedQuestionData.toolbarButtons.map((button) => {
264
264
  return essayResponseToolbarOptionsENUM[button];
@@ -270,6 +270,9 @@ export const verifyIeQuestionData = {
270
270
  }).then(() => {
271
271
  expect(ieButtonsTitle).to.have.deep.members(ieButtonsExpected);
272
272
  });
273
+ } else {
274
+ essayResponsePage.previewTabToolbarOption()
275
+ .should('not.exist');
273
276
  }
274
277
  if (expectedQuestionData.hasWordLimit || expectedQuestionData.hasWordCount) {
275
278
  if (expectedQuestionData.hasWordLimit) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.180-essayResponseLazyLoadingFix-63cd8a3.0",
3
+ "version": "1.0.182-repoUpdate22April-92d01da.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,432 +0,0 @@
1
- import abortEarlySetup from "../../../support/helpers/abortEarly";
2
- import { essayResponsePage } from "../../../pages";
3
- import { ckEditorToolbar } from "../../../pages/components";
4
- const css = Cypress.env('css');
5
-
6
- let specialCharacters = [':', ')', '`']
7
- describe('Create question page - Essay Response: Additional Settings', () => {
8
- before(() => {
9
- cy.loginAs('admin');
10
- });
11
-
12
- describe('Additional Settings: Predefined text', () => {
13
- abortEarlySetup();
14
- before(() => {
15
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
16
- essayResponsePage.steps.setWordLimit(5);
17
- essayResponsePage.steps.expandAdditionalSettings();
18
- });
19
-
20
- it('\'Predefined text\' label and input field should be displayed and by default, the input field should be empty', () => {
21
- essayResponsePage.predefinedTextLabel()
22
- .verifyInnerText('Predefined text')
23
- essayResponsePage.predefinedTextInputField()
24
- .should('have.text', '');
25
- });
26
-
27
- it('CSS of \'Predefined text\' section', { tags: 'css' }, () => {
28
- essayResponsePage.predefinedTextLabel()
29
- .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
30
- essayResponsePage.predefinedTextInputField()
31
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
32
- });
33
-
34
- it('Accessibility of \'Predefined text\' section', { tags: 'css' }, () => {
35
- cy.checkAccessibility(essayResponsePage.predefinedTextLabel().parent('[class*="StudentResponseAreaLayoutstyles__StyledDiv"]'));
36
- });
37
-
38
- it('The user should be able to add \'Predefined text\' and the \'Predefined text\' added by the user should be displayed in the response field in the preview tab. Also, the word count displayed by default should have value - word count of predefined text/word limit', () => {
39
- essayResponsePage.predefinedTextInputField()
40
- .type('Lorem Ipsum')
41
- .should('have.text', 'Lorem Ipsum');
42
- essayResponsePage.steps.switchToPreviewTab();
43
- essayResponsePage.responseField()
44
- .should('have.text', 'Lorem Ipsum');
45
- essayResponsePage.steps.verifyResponseFieldWordCount('2/5');
46
- });
47
-
48
- it('The user should not be able to enter words more than the set word limit in the \'Predefined text\' input field', () => {
49
- cy.log('Switching to edit tab')
50
- essayResponsePage.steps.switchToEditTab()
51
- essayResponsePage.predefinedTextInputField()
52
- .type(' dolor sit amet c');
53
- essayResponsePage.predefinedTextInputField()
54
- .should('have.text', 'Lorem Ipsum dolor sit amet\u00a0');
55
- });
56
-
57
- it('When the user adds same number of words as the word limit in the \'Predefined text\' input field, \'word limit reached\' warning message should be displayed in the preview tab', () => {
58
- essayResponsePage.steps.switchToPreviewTab();
59
- essayResponsePage.steps.verifyResponseFieldWordCount('5/5');
60
- essayResponsePage.steps.verifyWordLimitReachedWarningMessage();
61
- });
62
-
63
- it('The word count should increase/decrease in the preview tab when the user adds/removes some words from predefined text in the response field', () => {
64
- cy.log('checking update in word count after removing a word from predefined text')
65
- essayResponsePage.responseField()
66
- .type('{backspace}{backspace}{backspace}{backspace}{backspace}')
67
- .should('have.text', 'Lorem Ipsum dolor sit');
68
- essayResponsePage.steps.verifyResponseFieldWordCount('4/5');
69
- essayResponsePage.wordLimitReachedWarningMessage()
70
- .should('not.exist');
71
- cy.log('checking update in word count after adding a word after predefined text')
72
- essayResponsePage.responseField()
73
- .type(' amet')
74
- .should('have.text', 'Lorem Ipsum dolor sit amet');
75
- essayResponsePage.steps.verifyResponseFieldWordCount('5/5');
76
- });
77
- });
78
-
79
- //Failing due to https://redmine.zeuslearning.com/issues/551117
80
- describe('Additional Settings: Placeholder text', () => {
81
- abortEarlySetup();
82
- before(() => {
83
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
84
- essayResponsePage.steps.setWordLimit(5);
85
- essayResponsePage.steps.expandAdditionalSettings();
86
- });
87
-
88
- it('CSS of \'Placeholder text\' section', { tags: 'css' }, () => {
89
- essayResponsePage.placeholderTextLabel()
90
- .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
91
- essayResponsePage.placeholderTextInputField()
92
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
93
- });
94
-
95
- it('Accessibility of \'Placeholder text\' section', { tags: 'a11y' }, () => {
96
- cy.checkAccessibility(essayResponsePage.placeholderTextLabel().parent('[class*="StudentResponseAreaLayoutstyles__PlaceHolderWrapper"]'))
97
- });
98
-
99
- it('\'Placeholder text\' label and input field should be displayed and by default, the input field should be empty', () => {
100
- essayResponsePage.placeholderTextLabel()
101
- .verifyInnerText('Placeholder text');
102
- essayResponsePage.placeholderTextInputField()
103
- .should('have.value', '');
104
- });
105
-
106
- it('The user should be able to add \'Placeholder text\' and the \'Placeholder text\' added by the user should be displayed in the response field in the preview tab.', () => {
107
- essayResponsePage.placeholderTextInputField()
108
- .type('Lorem Ipsum')
109
- .should('have.value', 'Lorem Ipsum');
110
- essayResponsePage.steps.switchToPreviewTab();
111
- essayResponsePage.responseField()
112
- .and('have.attr', 'data-cke-editorplaceholder', 'Lorem Ipsum');
113
- essayResponsePage.responseFieldWordCount()
114
- .should('have.text', '0/5');
115
- });
116
-
117
- it('CSS of \'Placeholder text\' in preview tab', { tags: 'css' }, () => {
118
- essayResponsePage.responseField()
119
- .verifyPseudoClassBeforeProperty('color', css.color.placeholderText);
120
- });
121
-
122
- //Comment: The placeholder text is present as a pseudo element, how to check accessibility?
123
- it('Accessibility of \'Placeholder text\' in preview tab', { tags: 'a11y' }, () => {
124
- });
125
-
126
- it('The word count displayed by default should not consider the word count of placedholder text and the word count displayed should be - 0/*word limit*', () => {
127
- essayResponsePage.steps.verifyResponseFieldWordCount('0/5');
128
- });
129
-
130
- it('When the user starts typing in the response field in the preview tab, then the placeholder text should disappear', () => {
131
- essayResponsePage.steps.enterTextInResponseField('dolor sit amet');
132
- essayResponsePage.responseField()
133
- .should('not.have.attr', 'data-cke-editorplaceholder');
134
- });
135
-
136
- it('When the user clears the entered text in the response field, then the placeholder text should appear again', () => {
137
- essayResponsePage.responseField()
138
- .clear()
139
- .should('not.have.text', 'dolor sit amet')
140
- .blur();
141
- essayResponsePage.responseField()
142
- .and('have.attr', 'data-cke-editorplaceholder', 'Lorem Ipsum');
143
- });
144
-
145
- it('When the user has defined both, \'Predefined text\' and \'Placeholder text\', then in the preview tab the placeholder text should not be displayed and the word count displayed should be - word count of predefined text/*word limit*', () => {
146
- cy.log('Go to edit tab and define \'Predefined text\'')
147
- essayResponsePage.steps.switchToEditTab();
148
- essayResponsePage.predefinedTextInputField()
149
- .type('Dolor set amet')
150
- .should('have.text', 'Dolor set amet');
151
- essayResponsePage.steps.switchToPreviewTab();
152
- essayResponsePage.responseField()
153
- .should('have.text', 'Dolor set amet');
154
- essayResponsePage.responseFieldWordCount()
155
- .should('have.text', '3/5');
156
- })
157
- });
158
-
159
- describe('Additional Settings: Minimum height and Maximum height', () => {
160
- abortEarlySetup();
161
- before(() => {
162
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
163
- essayResponsePage.steps.expandAdditionalSettings();
164
- });
165
-
166
- it('CSS of \'Minimum height\' and \'Maximum height\' section', { tags: 'css' }, () => {
167
- essayResponsePage.minHeightLabel()
168
- .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
169
- essayResponsePage.minHeightInputField()
170
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
171
- essayResponsePage.maxHeightLabel()
172
- .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
173
- essayResponsePage.maxHeightInputField()
174
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
175
- });
176
-
177
- it('Accessibility of \'Minimum height\' and \'Maximum height\' section', { tags: 'a11y' }, () => {
178
- cy.checkAccessibility(essayResponsePage.minHeightLabel().parents('[class*="StudentResponseAreaLayoutstyles__SizeWrapper"]'));
179
- });
180
-
181
- it('\'Minimum height\' and \'Maximum height\' labels and input fields should be displayed and by default, the input fields should be empty', () => {
182
- essayResponsePage.minHeightLabel()
183
- .verifyInnerText('Minimum height (px)');
184
- essayResponsePage.minHeightInputField()
185
- .should('have.value', '');
186
- essayResponsePage.maxHeightLabel()
187
- .verifyInnerText('Maximum height (px)');
188
- essayResponsePage.maxHeightInputField()
189
- .should('have.value', '');
190
- });
191
-
192
- it('When the input field of \'Minimum height\' is kept empty, the default minimum height of the response field in the preview tab should be 232px', () => {
193
- cy.log('Switching to preview tab')
194
- essayResponsePage.steps.switchToPreviewTab();
195
- essayResponsePage.responseField()
196
- .should('have.css', 'min-height', '232px');
197
- });
198
-
199
- it('User should be able to add \'Minimum height\' for the response field and in the preview tab the minimum height of the response field should get updated accordingly', () => {
200
- cy.log('Switching to edit tab')
201
- essayResponsePage.steps.switchToEditTab();
202
- essayResponsePage.minHeightInputField()
203
- .type(50)
204
- .should('have.value', '50');
205
- cy.log('Switching to preview tab')
206
- essayResponsePage.steps.switchToPreviewTab();
207
- essayResponsePage.responseField()
208
- .should('have.css', 'min-height', '50px');
209
- });
210
-
211
- it('When the user adds \'Maximum height\' for the response field then in the preview tab, the maximum height of the response field should get updated accordingly', () => {
212
- cy.log('Switching to edit tab')
213
- essayResponsePage.steps.switchToEditTab();
214
- essayResponsePage.maxHeightInputField()
215
- .type(100)
216
- .should('have.value', '100');
217
- cy.log('Switching to preview tab')
218
- essayResponsePage.steps.switchToPreviewTab();
219
- essayResponsePage.responseField()
220
- .should('have.css', 'max-height', '100px');
221
- });
222
- });
223
-
224
- describe('Additional Settings: Disable cut, copy and paste section', () => {
225
- abortEarlySetup();
226
- before(() => {
227
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
228
- essayResponsePage.steps.expandAdditionalSettings();
229
- essayResponsePage.steps.setWordLimit(15);
230
- });
231
-
232
- it('\'Disable cut, copy and paste\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
233
- essayResponsePage.disableCutCopyPasteLabel()
234
- .verifyInnerText('Disable cut, copy and paste');
235
- essayResponsePage.disableCutCopyPasteCheckbox()
236
- .should('not.be.checked');
237
- });
238
-
239
- it('CSS of \'Disable cut, copy and paste\' section - unchecked state', { tags: 'css' }, () => {
240
- essayResponsePage.disableCutCopyPasteLabel()
241
- .verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
242
- essayResponsePage.disableCutCopyPasteCheckbox()
243
- .parent()
244
- .find('svg')
245
- .should('have.css', 'fill', css.color.uncheckedCheckbox);
246
- });
247
-
248
- it('Accessibility of \'Disable cut, copy and paste\' section - unchecked state', { tags: 'a11y' }, () => {
249
- cy.checkAccessibility(essayResponsePage.additionalSettingsRegion());
250
- });
251
-
252
- //TODO: Need to verify the code for cut, changes are required
253
- //Comment: We are currently checking only cut action, copy and paste actions need to be tested manually
254
- it('When the \'Disable cut, copy and paste\' functionality is disabled, the user should be able to perform cut, copy and paste actions', () => {
255
- essayResponsePage.steps.switchToPreviewTab();
256
- essayResponsePage.responseField()
257
- .type('Lorem')
258
- essayResponsePage.responseField()
259
- .type('{selectAll}')
260
- .type('{ctrl}x');
261
- essayResponsePage.responseField()
262
- .should('not.have.text', 'Lorem');
263
- });
264
-
265
- it('When the user enables the \'Disable cut, copy and paste\' functionality, the user should not be able to perform cut, copy and paste actions', () => {
266
- cy.log('Switching to edit tab')
267
- essayResponsePage.steps.switchToEditTab();
268
- essayResponsePage.disableCutCopyPasteCheckbox()
269
- .click()
270
- .should('be.checked');
271
- essayResponsePage.steps.switchToPreviewTab();
272
- essayResponsePage.responseField()
273
- .type('Lorem{selectall}')
274
- essayResponsePage.responseField()
275
- .focus()
276
- .trigger('keydown', { key: 'x', ctrlKey: true })
277
- essayResponsePage.responseField()
278
- .should('have.text', 'Lorem');
279
- });
280
-
281
- it('CSS of \'Disable cut, copy and paste\' section - checked state', { tags: 'css' }, () => {
282
- cy.log('Switching to edit tab')
283
- essayResponsePage.steps.switchToEditTab();
284
- essayResponsePage.disableCutCopyPasteCheckbox()
285
- .parents('[data-ngie-testid="disable-cut,-copy-and-paste-checkbox"]')
286
- .find('svg g')
287
- .eq(1)
288
- .should('have.css', 'fill', css.color.activeButtons);
289
- });
290
-
291
- it('Accessibility of \'Disable cut, copy and paste\' section - checked state', { tags: 'a11y' }, () => {
292
- cy.checkAccessibility(essayResponsePage.additionalSettingsRegion());
293
- });
294
- });
295
-
296
- describe('Additional Settings: Disable automatic hyperlinking section', () => {
297
- abortEarlySetup();
298
- before(() => {
299
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
300
- essayResponsePage.steps.expandAdditionalSettings();
301
- });
302
-
303
- it('\'Disable automatic hyperlinking\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
304
- essayResponsePage.disableAutoHyperlinkingLabel()
305
- .verifyInnerText('Disable automatic hyperlinking');
306
- essayResponsePage.disableAutoHyperlinkingCheckbox()
307
- .should('not.be.checked');
308
- });
309
-
310
- it('CSS of \'Disable automatic hyperlinking\' section - unchecked state', { tags: 'css' }, () => {
311
- essayResponsePage.disableAutoHyperlinkingLabel()
312
- .verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
313
- essayResponsePage.disableAutoHyperlinkingCheckbox()
314
- .parent()
315
- .find('svg')
316
- .should('have.css', 'fill', css.color.uncheckedCheckbox);
317
- });
318
-
319
- it('Accessibility of \'Disable automatic hyperlinking\' section - unchecked state', { tags: 'a11y' }, () => {
320
- cy.checkAccessibility(essayResponsePage.disableAutoHyperlinkingLabel().parents('.MuiFormGroup-root'));
321
- });
322
-
323
- it('When the \'Disable automatic hyperlinking\' functionality is disabled and the user types any link text in the response field in the preview tab, then the link text should be displayed as a hyperlink', () => {
324
- cy.log('Switching to preview tab')
325
- essayResponsePage.steps.switchToPreviewTab();
326
- essayResponsePage.responseField()
327
- .type('https://www.google.com ');
328
- essayResponsePage.responseField()
329
- .find('a')
330
- .should('have.attr', 'href', 'https://www.google.com');
331
- });
332
-
333
- //https://redmine.zeuslearning.com/issues/530056
334
- it('CSS of \'hyperlink\' text in the response field', { tags: 'css' }, () => {
335
- essayResponsePage.responseField()
336
- .find('a')
337
- .verifyCSS(css.color.linkText, css.fontSize.default, css.fontWeight.regular);
338
- });
339
-
340
- it('Accessibility of \'hyperlink\' text in the response field', { tags: 'a11y' }, () => {
341
- cy.checkAccessibility(essayResponsePage.previewTabQuestionWrapper());
342
- });
343
-
344
- it('When the user enables the \'Disable automatic hyperlinking\' functionality, then even if the user types any link text in the response field in the preview tab, it should appear as a plain text', () => {
345
- cy.log('Switching to edit tab')
346
- essayResponsePage.steps.switchToEditTab();
347
- essayResponsePage.disableAutoHyperlinkingCheckbox()
348
- .click()
349
- .should('be.checked');
350
- cy.log('Switching to preview tab')
351
- essayResponsePage.steps.switchToPreviewTab();
352
- essayResponsePage.responseField()
353
- .type('https://www.google.com');
354
- essayResponsePage.responseField()
355
- .find('a')
356
- .should('not.exist');
357
- cy.log('Post step: Switching to edit tab')
358
- essayResponsePage.steps.switchToEditTab();
359
- });
360
-
361
- it('CSS of \'Disable automatic hyperlinking\' section - checked state', { tags: 'css' }, () => {
362
- essayResponsePage.disableAutoHyperlinkingCheckbox()
363
- .parents('[data-ngie-testid="disable-automatic-hyperlinking-checkbox"]')
364
- .find('svg g')
365
- .eq(1)
366
- .should('have.css', 'fill', css.color.activeButtons);
367
- });
368
-
369
- it('Accessibility of \'Disable automatic hyperlinking\' section - checked state', { tags: 'a11y' }, () => {
370
- cy.checkAccessibility(essayResponsePage.disableAutoHyperlinkingLabel().parents('.MuiFormGroup-root'));
371
- });
372
- });
373
-
374
- describe('Additional Settings: Spell check section', () => {
375
- abortEarlySetup();
376
- before(() => {
377
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
378
- essayResponsePage.steps.expandAdditionalSettings();
379
- });
380
-
381
- it('\'Spell check\' functionality label and checkbox should be displayed and by default it should be checked', () => {
382
- essayResponsePage.spellCheckLabel()
383
- .verifyInnerText('Spell check');
384
- essayResponsePage.spellCheckCheckbox()
385
- .should('be.checked');
386
- });
387
-
388
- it('CSS of \'Spell check\' section - checked state', { tags: 'css' }, () => {
389
- essayResponsePage.spellCheckLabel()
390
- .verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
391
- essayResponsePage.spellCheckCheckbox()
392
- .parents('[data-ngie-testid="spell-check-checkbox"]')
393
- .find('svg g')
394
- .eq(1)
395
- .should('have.css', 'fill', css.color.activeButtons);
396
- });
397
-
398
- it('Accessibility of \'Spell check\' section - checked state', { tags: 'a11y' }, () => {
399
- cy.checkAccessibility(essayResponsePage.spellCheckLabel().parents('.MuiFormGroup-root'))
400
- });
401
-
402
- it('When the \'Spell check\' functionality is enabled, the response field in preview tab should have \'spellcheck\' attribute set as \'true\'', () => {
403
- essayResponsePage.steps.switchToPreviewTab();
404
- essayResponsePage.responseField()
405
- .should('have.attr', 'spellcheck', 'true');
406
- });
407
-
408
- it('When the user disables the \'Spell check\' functionality, the response field in preview tab should not have \'spellcheck\' attribute set as \'false\'', () => {
409
- cy.log('Switching to edit tab')
410
- essayResponsePage.steps.switchToEditTab();
411
- essayResponsePage.spellCheckCheckbox()
412
- .click()
413
- .should('not.be.checked');
414
- essayResponsePage.steps.switchToPreviewTab();
415
- essayResponsePage.responseField()
416
- .should('have.attr', 'spellcheck', 'false');
417
- cy.log('Post step: Switch to edit tab')
418
- essayResponsePage.steps.switchToEditTab();
419
- });
420
-
421
- it('CSS of \'Spell check\' section - unchecked state', { tags: 'css' }, () => {
422
- essayResponsePage.spellCheckCheckbox()
423
- .parents('[data-ngie-testid="spell-check-checkbox"]')
424
- .find('svg')
425
- .should('have.css', 'fill', css.color.uncheckedCheckbox);
426
- });
427
-
428
- it('Accessibility of \'Spell check\' section - unchecked state', { tags: 'a11y' }, () => {
429
- cy.checkAccessibility(essayResponsePage.spellCheckLabel().parents('.MuiFormGroup-root'))
430
- });
431
- });
432
- });
@@ -1,134 +0,0 @@
1
- import abortEarlySetup from "../../../support/helpers/abortEarly";
2
- import { essayResponsePage } from "../../../pages";
3
- import { ckEditorToolbar } from "../../../pages/components";
4
- const css = Cypress.env('css');
5
-
6
- let specialCharacters = [':', ')', '`']
7
- describe('Create question page - Essay Response: Additional Settings basic', () => {
8
- before(() => {
9
- cy.loginAs('admin');
10
- });
11
-
12
- describe('Additional Settings accordion', () => {
13
- abortEarlySetup();
14
- before(() => {
15
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
16
- });
17
-
18
- essayResponsePage.tests.verifyAdditionalSettingsAccordionProperties();
19
- });
20
-
21
- describe('\'Student response area and layout\' section', () => {
22
- abortEarlySetup();
23
- before(() => {
24
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
25
- essayResponsePage.steps.expandAdditionalSettings();
26
- });
27
-
28
- it('\'Student response area and layout\' label should be displayed', () => {
29
- essayResponsePage.studentResponseAndLayoutLabel()
30
- .verifyInnerText('Student response area and layout')
31
- .should('be.visible');
32
- });
33
-
34
- it('CSS of \'Student response area and layout\' section', { tags: 'css' }, () => {
35
- essayResponsePage.studentResponseAndLayoutLabel()
36
- .verifyCSS(css.color.labels, css.fontSize.default, css.fontWeight.semibold);
37
- });
38
-
39
- it('Accessibility of \'Student response area and layout\' section', { tags: 'a11y' }, () => {
40
- cy.checkAccessibility(essayResponsePage.studentResponseAndLayoutLabel())
41
- });
42
- });
43
-
44
- //Failing due to https://redmine.zeuslearning.com/issues/551117
45
- describe('Additional Settings: Custom special characters section', () => {
46
- abortEarlySetup();
47
- before(() => {
48
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
49
- essayResponsePage.steps.expandAdditionalSettings();
50
- });
51
-
52
- it('\'Custom special characters\' label and \'Custom special characters\' input field should be displayed, by default the input field should be empty and user should be able to enter \'Custom special characters', () => {
53
- essayResponsePage.customSpecialCharacterLabel()
54
- .verifyInnerText('Custom special characters');
55
- essayResponsePage.customSpecialCharacterInputField()
56
- .should('have.value', '');
57
- essayResponsePage.customSpecialCharacterInputField()
58
- .type(':)`')
59
- .should('have.value', ':)`');
60
- });
61
-
62
- it('When the user has added the \'Custom special characters\' then in the preview tab, on clicking on the special character toolbar option, only the custom special characters should appear in the dialog box and the user should be able to enter custom special characters in the response field', () => {
63
- essayResponsePage.steps.switchToPreviewTab();
64
- essayResponsePage.previewTabToolbarOption('Special characters')
65
- .click();
66
- ckEditorToolbar.ckeDialogbox()
67
- .should('be.visible');
68
- specialCharacters.forEach((character, count) => {
69
- essayResponsePage.specialCharacterFlyoutIcon(count)
70
- .should('have.text', character);
71
- });
72
- });
73
-
74
- it('User should be able to add all special characters in the response field and word count should update accordingly.', () => {
75
- for (let index = 0; index < specialCharacters.length; index++) {
76
- essayResponsePage.specialCharacterFlyoutIcon(index)
77
- .click();
78
- };
79
- essayResponsePage.responseField()
80
- .should('have.text', ':)`');
81
- essayResponsePage.responseFieldWordCount()
82
- .should('have.text', '1/10000');
83
- });
84
- });
85
-
86
- describe('Additional Settings: Font Size dropdown', () => {
87
- abortEarlySetup();
88
- before(() => {
89
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
90
- essayResponsePage.steps.expandAdditionalSettings();
91
- essayResponsePage.steps.setWordLimit(2);
92
- });
93
- const fontsizes = ['Tiny', 'Small', 'Default', 'Normal', 'Big', 'Huge'];
94
- const font = ['16px', '12px', '14px', '17px', '20px', '24px'];
95
-
96
- essayResponsePage.tests.verifyFontSizeSectionContents();
97
-
98
- fontsizes.forEach((option, count) => {
99
- it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size for the entire question in the student player should be changed to ${option} in the \'Preview\' tab`, () => {
100
- essayResponsePage.fontSizeDropdown()
101
- .click();
102
- essayResponsePage.fontSizeListOptions(count)
103
- .click();
104
- essayResponsePage.fontSizeDropdown()
105
- .verifyInnerText(`${option}`);
106
- cy.log('Switching to Preview tab.');
107
- essayResponsePage.steps.switchToPreviewTab();
108
- essayResponsePage.previewTabToolbarOption('Special characters')
109
- .should('have.css', 'font-size', font[count]);
110
- essayResponsePage.responseField()
111
- .should('have.css', 'font-size', font[count]);
112
- essayResponsePage.responseFieldWordCount()
113
- .should('have.css', 'font-size', font[count]);
114
- cy.log('Reaching word limit to verify font size of warning message');
115
- essayResponsePage.responseField()
116
- .type('Lorem Ipsum')
117
- .should('have.text', 'Lorem Ipsum');
118
- essayResponsePage.wordLimitReachedWarningMessage()
119
- .should('have.css', 'font-size', font[count]);
120
- essayResponsePage.steps.switchToEditTab()
121
- });
122
- });
123
- });
124
-
125
- describe('Additional Settings: Details section', () => {
126
- abortEarlySetup();
127
- before(() => {
128
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
129
- essayResponsePage.steps.expandAdditionalSettings();
130
- });
131
-
132
- essayResponsePage.tests.verifyDetailsSection();
133
- });
134
- });