itemengine-cypress-automation 1.0.132 → 1.0.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/cypress/e2e/ILC/DesmosGraphing/previewTabContent.smoke.js +1 -2
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +53 -54
  3. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +0 -149
  4. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +312 -0
  5. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsBasic.js +71 -0
  6. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  7. package/cypress/e2e/ILC/GeogebraActivity/additionalSettings.js +98 -0
  8. package/cypress/e2e/ILC/GeogebraActivity/editTabScoringSection.js +56 -0
  9. package/cypress/e2e/ILC/GeogebraActivity/gradingViewAndCorrectAnswerViewContents.smoke.js +106 -0
  10. package/cypress/e2e/ILC/GeogebraActivity/headerSection.js +74 -0
  11. package/cypress/e2e/ILC/GeogebraActivity/previewTabContent.smoke.js +91 -0
  12. package/cypress/e2e/ILC/GeogebraActivity/questionInstructions.js +28 -0
  13. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingPenaltyScoring.js +79 -0
  14. package/cypress/e2e/ILC/Graphing/Scoring/manuallyAndNonScoredScoring.js +253 -0
  15. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +307 -0
  16. package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +84 -0
  17. package/cypress/e2e/ILC/Graphing/editTabScoringSection.js +105 -0
  18. package/cypress/e2e/ILC/Graphing/headerSection.js +77 -0
  19. package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +916 -0
  20. package/cypress/e2e/ILC/Graphing/minimumScoringPenaltyPointsAndRoundingDropdown.js +57 -0
  21. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +1 -1
  22. package/cypress/e2e/ILC/Graphing/specifyCorrectAnswerSection.js +72 -0
  23. package/cypress/e2e/ILC/Graphing/studentViewSettings.js +120 -0
  24. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +858 -0
  25. package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +337 -4
  26. package/cypress/fixtures/constants.js +1 -1
  27. package/cypress/fixtures/theme/ilc.json +3 -1
  28. package/cypress/pages/components/additionalSettingsAccessibilitySectionComponent.js +66 -0
  29. package/cypress/pages/components/additionalSettingsPanel.js +95 -90
  30. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +9 -7
  31. package/cypress/pages/components/backgroundImageUploadComponent.js +16 -14
  32. package/cypress/pages/components/colorPopupComponent.js +14 -17
  33. package/cypress/pages/components/commonComponents.js +1 -1
  34. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -1
  35. package/cypress/pages/components/imageCanvasComponent.js +3 -3
  36. package/cypress/pages/components/index.js +2 -2
  37. package/cypress/pages/components/opacityComponent.js +1 -1
  38. package/cypress/pages/components/scoringSectionBaseEditTab.js +18 -0
  39. package/cypress/pages/components/studentResponseAreaAndLayoutComponent.js +1 -1
  40. package/cypress/pages/dialogBoxBase.js +1 -1
  41. package/cypress/pages/drawingResponsePage.js +35 -4
  42. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +2 -2
  43. package/cypress/pages/fillInTheGapsOverImageTextPage.js +2 -0
  44. package/cypress/pages/geogebraActivityPage.js +106 -0
  45. package/cypress/pages/graphingPage.js +1458 -77
  46. package/cypress/pages/index.js +1 -0
  47. package/cypress/pages/multipleSelectionPage.js +0 -1
  48. package/cypress/pages/shortTextResponsePage.js +155 -3
  49. package/cypress/pages/uploadResponsePage.js +0 -2
  50. package/package.json +1 -1
@@ -1,5 +1,10 @@
1
1
  import { shortTextResponsePage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
7
+ const clipboardFunctions = ['Cut', 'Copy', 'Paste'];
3
8
 
4
9
  describe('Create Item page - Short text response - drag and drop: Additional settings', () => {
5
10
  before(() => {
@@ -14,30 +19,358 @@ describe('Create Item page - Short text response - drag and drop: Additional set
14
19
  cy.barsPreLoaderWait();
15
20
  });
16
21
 
17
- shortTextResponsePage.tests.verifyAdditonalSettingsAccordionProperties();
22
+ shortTextResponsePage.tests.verifyAdditionalSettingsAccordionProperties();
23
+ });
24
+
25
+ describe('Additional settings: Student response area and layout', () => {
26
+ abortEarlySetup();
27
+ before(() => {
28
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
29
+ cy.barsPreLoaderWait();
30
+ shortTextResponsePage.steps.expandAdditionalSettings();
31
+ });
32
+
33
+ shortTextResponsePage.tests.verifyStudentResponseAreaAndLayoutLabelAndCSS();
34
+ });
35
+
36
+ describe('Additional settings: Clipboard functions - contents', () => {
37
+ abortEarlySetup();
38
+ before(() => {
39
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
40
+ cy.barsPreLoaderWait();
41
+ shortTextResponsePage.steps.expandAdditionalSettings();
42
+ });
43
+
44
+ it('Clipboard functions label should be displayed', () => {
45
+ utilities.verifyInnerText(shortTextResponsePage.clipboardFunctionLabel(), 'Clipboard functions');
46
+ utilities.verifyElementVisibilityState(shortTextResponsePage.clipboardFunctionLabel(), 'visible');
47
+ });
48
+
49
+ it(`3 clipboard function buttons ${clipboardFunctions.join(', ')} should be displayed and by default all of them should be in selected`, () => {
50
+ for (var i = 0; i < 3; i++) {
51
+ shortTextResponsePage.steps.verifyClipBoardButton(i);
52
+ }
53
+ });
54
+
55
+ clipboardFunctions.forEach((functionName, index) => {
56
+ it(`When user hovers over '${functionName}' clipboard function button, then tooltip '${functionName}' should be displayed`, () => {
57
+ shortTextResponsePage.clipboardFunctionButton(index)
58
+ .verifyTooltip(functionName);
59
+ });
60
+ });
61
+
62
+ it('User should be able to unselect all the buttons', () => {
63
+ for (var i = 0; i < 3; i++) {
64
+ shortTextResponsePage.steps.unselectClipboardFunctionButton(i);
65
+ }
66
+ });
67
+ });
68
+
69
+ describe('Additional settings: Placeholder text', () => {
70
+ abortEarlySetup();
71
+ before(() => {
72
+ cy.log('Navigating to short text response - question type');
73
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
74
+ cy.barsPreLoaderWait();
75
+ shortTextResponsePage.steps.expandAdditionalSettings();
76
+ });
77
+
78
+ it('\'Placeholder text\' label and input field should be displayed and by default the input field should be empty', () => {
79
+ utilities.verifyInnerText(shortTextResponsePage.placeholderTextLabel(), 'Placeholder text');
80
+ utilities.verifyElementVisibilityState(shortTextResponsePage.placeholderTextLabel(), 'visible');
81
+ utilities.verifyInnerText(shortTextResponsePage.placeholderTextInputField(), '');
82
+ });
83
+
84
+ it('CSS of \'Placeholder text\' section', { tags: 'css' }, () => {
85
+ utilities.verifyCSS(shortTextResponsePage.placeholderTextLabel(), {
86
+ 'color': css.color.labels,
87
+ 'font-size': css.fontSize.normal,
88
+ 'font-weight': css.fontWeight.semibold
89
+ })
90
+ utilities.verifyCSS(shortTextResponsePage.placeholderTextInputField(), {
91
+ 'color': css.color.text,
92
+ 'font-size': css.fontSize.default,
93
+ 'font-weight': css.fontWeight.regular
94
+ })
95
+ utilities.verifyCSS(shortTextResponsePage.clipboardFunctionButton(0), {
96
+ 'background-color': css.color.activeButtons,
97
+ 'border': `1px solid ${css.color.activeButtons}`
98
+ });
99
+ });
100
+
101
+ it('Accessibility of \'Placeholder text\' section', { tags: 'a11y' }, () => {
102
+ cy.checkAccessibility(shortTextResponsePage.placeholderTextLabel().parent('[class*="ShortTextResponsestyle__PlaceholderWrapper"]'))
103
+ });
104
+
105
+ it('When \'Placeholder text\' input field is empty then no \'Placeholder text\' should be displayed in the specify correct answer response field', () => {
106
+ shortTextResponsePage.steps.verifyPlaceholderAttributeInSpecifyCorrectAnswerSectionResponseFieldEmpty();
107
+ });
108
+
109
+ it('When the user adds a text in the Placeholder input field, the added placeholder should be displayed in the specify correct answer response field', () => {
110
+ shortTextResponsePage.steps.enterTextInPlaceholderTextInputField('Enter correct answer');
111
+ shortTextResponsePage.steps.verifyPlaceholderTextAnswerInputFieldSpecifyCorrectAnswerSection('Enter correct answer');
112
+ });
113
+
114
+ it('Accessibility of \'Placeholder text\'', { tags: 'a11y' }, () => {
115
+ cy.checkAccessibility(shortTextResponsePage.answerInputFieldSpecifyCorrectAnswerSection());
116
+ });
117
+
118
+ it('When the user enters text in the response field, then the placeholder text should disappear and on clearing the input field the placeholder text should re-appear for the specify correct answer section response fields', () => {
119
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Flower');
120
+ shortTextResponsePage.steps.verifyPlaceholderAttributeInSpecifyCorrectAnswerSectionResponseFieldNotExists();
121
+ shortTextResponsePage.steps.clearAndFocusOutOfSpecifyCorrectAnswerInputField();
122
+ shortTextResponsePage.steps.verifyPlaceholderTextAnswerInputFieldSpecifyCorrectAnswerSection('Enter correct answer');
123
+ });
124
+
125
+ it('When the user clears the placeholder text input field, the placeholder text should get removed from the specify correct answer section response fields', () => {
126
+ shortTextResponsePage.steps.clearAndFocusOutOfPlaceholderTextInputField();
127
+ shortTextResponsePage.steps.verifyPlaceholderAttributeInSpecifyCorrectAnswerSectionResponseFieldEmpty();
128
+ });
129
+ });
130
+
131
+ describe('Additional settings: Placeholder text - Preview tab', () => {
132
+ abortEarlySetup();
133
+ before(() => {
134
+ cy.log('Navigate to short text response question type');
135
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
136
+ cy.barsPreLoaderWait();
137
+ shortTextResponsePage.steps.expandAdditionalSettings();
138
+ shortTextResponsePage.steps.switchToPreviewTab();
139
+ });
140
+
141
+ it('When \'Placeholder text\' input field is empty then no \'Placeholder text\' should be displayed in the preview tab response field', () => {
142
+ shortTextResponsePage.steps.verifyPlaceholderAttributeInResponseFieldPreviewTabEmpty();
143
+ });
144
+
145
+ it('When the user adds a text in the Placeholder input field, the added placeholder should be displayed in the preview tab response field', () => {
146
+ shortTextResponsePage.steps.switchToEditTab();
147
+ shortTextResponsePage.steps.enterTextInPlaceholderTextInputField('Enter response');
148
+ shortTextResponsePage.steps.switchToPreviewTab();
149
+ shortTextResponsePage.steps.verifyPlaceholderTextResponseFieldPreviewTab('Enter response');
150
+ });
151
+
152
+ it('When the user starts typing in the response field, then the placeholder text should disappear and on clearing the input field the placeholder text should re-appear for the preview tab response fields', () => {
153
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Flower');
154
+ shortTextResponsePage.steps.verifyPlaceholderAttributeInResponseFieldPreviewTabNotExists();
155
+ shortTextResponsePage.steps.clearAndFocusOutOfResponseInputFieldPreviewTab();
156
+ shortTextResponsePage.steps.verifyPlaceholderTextResponseFieldPreviewTab('Enter response');
157
+ });
158
+
159
+ it('When the user clears the placeholder text input field, the placeholder text should get removed from the preview tab response fields', () => {
160
+ shortTextResponsePage.steps.switchToEditTab();
161
+ shortTextResponsePage.steps.clearAndFocusOutOfPlaceholderTextInputField();
162
+ shortTextResponsePage.steps.switchToPreviewTab();
163
+ shortTextResponsePage.steps.verifyPlaceholderAttributeInResponseFieldPreviewTabEmpty();
164
+ });
165
+ });
166
+
167
+ describe('Setting tab: Accessibility section', () => {
168
+ abortEarlySetup();
169
+ before(() => {
170
+ cy.log('Navigating to short text response question type');
171
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
172
+ shortTextResponsePage.steps.expandAdditionalSettings();
173
+ });
174
+
175
+ it('When the user expands additional settings accordion then \'Accessibility\' label should be displayed', () => {
176
+ utilities.verifyInnerText(shortTextResponsePage.accessibilityLabel(), 'Accessibility');
177
+ utilities.verifyElementVisibilityState(shortTextResponsePage.accessibilityLabel(), 'visible');
178
+ });
179
+
180
+ it('In \'Accessibility\' section, \'Flag this question as non-accessible\' label with checkbox should be displayed and it should be unchecked by default', () => {
181
+ utilities.verifyElementVisibilityState(shortTextResponsePage.flagNonAccessibleCheckbox(), 'exist');
182
+ utilities.verifyInnerText(shortTextResponsePage.flagNonAccessibleLabel(), 'Flag this question as non-accessible');
183
+ utilities.verifyElementVisibilityState(shortTextResponsePage.flagNonAccessibleLabel(), 'visible');
184
+ shortTextResponsePage.steps.verifyFlagThisItemNonAccessibleCheckboxIsUnchecked();
185
+ });
186
+
187
+
188
+ it('User should be able to check the \'Flag this question as non-accessible\' checkbox', () => {
189
+ shortTextResponsePage.steps.checkFlagThisItemNonAccessibleCheckbox();
190
+ });
191
+
192
+ it('CSS of \'Accessibility\' section', { tags: 'css' }, () => {
193
+ utilities.verifyCSS(shortTextResponsePage.accessibilityLabel(), {
194
+ 'color': css.color.labels,
195
+ 'font-size': css.fontSize.default,
196
+ 'font-weight': css.fontWeight.semibold
197
+ });
198
+ utilities.verifyCSS(shortTextResponsePage.flagNonAccessibleLabel(), {
199
+ 'color': css.color.labelText,
200
+ 'font-size': css.fontSize.normal,
201
+ 'font-weight': css.fontWeight.regular
202
+ });
203
+ utilities.verifyCSS(shortTextResponsePage.flagNonAccessibleCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
204
+ 'fill': css.color.activeButtons
205
+ });
206
+ });
207
+
208
+ it('Accessibility of checked \'Flag this question as non-accessible\' checkbox', { tags: 'a11y' }, () => {
209
+ cy.checkAccessibility(shortTextResponsePage.flagNonAccessibleCheckbox());
210
+ });
18
211
  });
19
212
 
20
213
  describe('Additional settings: Font size contents', () => {
21
214
  abortEarlySetup();
22
215
  before(() => {
23
- cy.log('Navigating to Highlight question type');
216
+ cy.log('Navigating to short text response question type');
24
217
  shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
25
218
  cy.barsPreLoaderWait();
26
- shortTextResponsePage.steps.expandAdditonalSettings();
219
+ shortTextResponsePage.steps.expandAdditionalSettings();
27
220
  });
28
221
 
29
222
  shortTextResponsePage.tests.verifyFontSizeSectionContents();
30
223
  });
31
224
 
225
+ describe('Additional settings: Font size - Specify correct answer section', () => {
226
+ abortEarlySetup();
227
+ before(() => {
228
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
229
+ cy.barsPreLoaderWait();
230
+ shortTextResponsePage.steps.addTextInQuestionInstructionsInputField('question instruction');
231
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct answer');
232
+ shortTextResponsePage.steps.allotPoints(10);
233
+ shortTextResponsePage.steps.expandAdditionalSettings();
234
+ });
235
+
236
+ Object.keys(fontSizes).forEach((option) => {
237
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${fontSizes[option]} accordingly`, () => {
238
+ shortTextResponsePage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
239
+ utilities.verifyInnerText(shortTextResponsePage.fontSizeDropdown(), `${option}`);
240
+ utilities.verifyCSS(shortTextResponsePage.answerInputFieldSpecifyCorrectAnswerSection(), {
241
+ 'font-size': fontSizes[option]
242
+ });
243
+ });
244
+ });
245
+ });
246
+
247
+ describe('Additional settings: Font size - preview tab', () => {
248
+ abortEarlySetup();
249
+ before(() => {
250
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
251
+ cy.barsPreLoaderWait();
252
+ shortTextResponsePage.steps.addTextInQuestionInstructionsInputField('question instruction');
253
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct answer');
254
+ shortTextResponsePage.steps.allotPoints(10);
255
+ shortTextResponsePage.steps.expandAdditionalSettings();
256
+ });
257
+
258
+ Object.keys(fontSizes).forEach((option) => {
259
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${fontSizes[option]} accordingly`, () => {
260
+ shortTextResponsePage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
261
+ utilities.verifyInnerText(shortTextResponsePage.fontSizeDropdown(), `${option}`);
262
+ shortTextResponsePage.steps.switchToPreviewTab();
263
+ utilities.verifyCSS(shortTextResponsePage.questionInstructionsText(), {
264
+ 'font-size': fontSizes[option]
265
+ });
266
+ utilities.verifyCSS(shortTextResponsePage.previewTabResponseField(), {
267
+ 'font-size': fontSizes[option]
268
+ });
269
+ utilities.verifyCSS(shortTextResponsePage.characterWordCountLabelPreviewTab(), {
270
+ 'font-size': fontSizes[option]
271
+ });
272
+ shortTextResponsePage.steps.switchToGradingView();
273
+ utilities.verifyCSS(shortTextResponsePage.previewTabCorrectAnswerLabel(), {
274
+ 'font-size': fontSizes[option]
275
+ });
276
+ utilities.verifyCSS(shortTextResponsePage.previewTabCorrectAnswerResponse(), {
277
+ 'font-size': fontSizes[option]
278
+ });
279
+ shortTextResponsePage.steps.switchToStudentView();
280
+ shortTextResponsePage.steps.switchToEditTab();
281
+ });
282
+ });
283
+ });
284
+
32
285
  describe('Additional Settings: Details section', () => {
33
286
  abortEarlySetup();
34
287
  before(() => {
35
288
  cy.log('Navigating to fill in the gaps over image - drag and drop question type');
36
289
  shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
37
290
  cy.barsPreLoaderWait();
38
- shortTextResponsePage.steps.expandAdditonalSettings();
291
+ shortTextResponsePage.steps.expandAdditionalSettings();
39
292
  });
40
293
 
41
294
  shortTextResponsePage.tests.verifyDetailsSection();
42
295
  });
296
+
297
+ describe('Additional settings: ARIA label', () => {
298
+ abortEarlySetup();
299
+ before(() => {
300
+ cy.log('Navigating to short text response - question type');
301
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
302
+ cy.barsPreLoaderWait();
303
+ shortTextResponsePage.steps.expandAdditionalSettings();
304
+ });
305
+
306
+ it('\'ARIA label\' label and input field should be displayed and by default the input field should be empty', () => {
307
+ utilities.verifyInnerText(shortTextResponsePage.ariaLabelLabel(), 'ARIA label');
308
+ utilities.verifyElementVisibilityState(shortTextResponsePage.ariaLabelLabel(), 'visible');
309
+ utilities.verifyInnerText(shortTextResponsePage.ariaLabelInputField(), '\n');
310
+ });
311
+
312
+ it('CSS of \'ARIA label\' section', { tags: 'css' }, () => {
313
+ utilities.verifyCSS(shortTextResponsePage.ariaLabelLabel(), {
314
+ 'color': css.color.labels,
315
+ 'font-size': css.fontSize.normal,
316
+ 'font-weight': css.fontWeight.semibold
317
+ })
318
+ utilities.verifyCSS(shortTextResponsePage.ariaLabelInputField(), {
319
+ 'color': css.color.text,
320
+ 'font-size': css.fontSize.default,
321
+ 'font-weight': css.fontWeight.regular
322
+ })
323
+ });
324
+
325
+ it('Accessibility of \'ARIA label\' section', { tags: 'a11y' }, () => {
326
+ cy.checkAccessibility(shortTextResponsePage.ariaLabelLabel().parent('.aria-label-wrapper'))
327
+ });
328
+
329
+ it('When \'ARIA label\' input field is empty then input field should have default aria label in the specify correct answer response field', () => {
330
+ shortTextResponsePage.steps.verifyAnswerInputFieldHasDefaultAriaLabelInSpecifyCorrectAnswerSection();
331
+ });
332
+
333
+ it('When the user adds a text in the ARIA label input field, the added Aria label should be displayed in the specify correct answer response field', () => {
334
+ shortTextResponsePage.steps.enterTextInARIALabelInputField('Enter correct answer');
335
+ shortTextResponsePage.steps.verifyAriaLabelAddedResponseFieldSpecifyCorrectAnswerSection('Enter correct answer');
336
+ });
337
+
338
+ it('Accessibility of \'ARIA label\'', { tags: 'a11y' }, () => {
339
+ cy.checkAccessibility(shortTextResponsePage.answerInputFieldSpecifyCorrectAnswerSection());
340
+ });
341
+
342
+ it('When the user clears the ARIA label text input field, then input field should have default aria label in the specify correct answer response field', () => {
343
+ shortTextResponsePage.steps.clearAndFocusOutOfARIALabelInputField();
344
+ shortTextResponsePage.steps.verifyAnswerInputFieldHasDefaultAriaLabelInSpecifyCorrectAnswerSection();
345
+ });
346
+ });
347
+
348
+ describe('Additional settings: ARIA label - Preview tab', () => {
349
+ abortEarlySetup();
350
+ before(() => {
351
+ cy.log('Navigate to short text response question type');
352
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
353
+ cy.barsPreLoaderWait();
354
+ shortTextResponsePage.steps.expandAdditionalSettings();
355
+ shortTextResponsePage.steps.switchToPreviewTab();
356
+ });
357
+
358
+ it('When \'Aria label\' input field is empty then input field should have default aria label in the preview tab', () => {
359
+ shortTextResponsePage.steps.verifyResponseFieldHasDefaultAriaLabelInPreviewTab();
360
+ });
361
+
362
+ it('When the user adds a text in the ARIA label input field, the added aria label should be displayed in the preview tab response field', () => {
363
+ shortTextResponsePage.steps.switchToEditTab();
364
+ shortTextResponsePage.steps.enterTextInARIALabelInputField('Enter response');
365
+ shortTextResponsePage.steps.switchToPreviewTab();
366
+ shortTextResponsePage.steps.verifyAriaLabelAddedResponseFieldPreviewTab('Enter response');
367
+ });
368
+
369
+ it('When the user clears the placeholder text input field, the placeholder text should get removed from the preview tab response fields', () => {
370
+ shortTextResponsePage.steps.switchToEditTab();
371
+ shortTextResponsePage.steps.clearAndFocusOutOfARIALabelInputField();
372
+ shortTextResponsePage.steps.switchToPreviewTab();
373
+ shortTextResponsePage.steps.verifyResponseFieldHasDefaultAriaLabelInPreviewTab();
374
+ });
375
+ });
43
376
  });
@@ -9,7 +9,7 @@ const constants = {
9
9
  sampleSVGLink: "https://www.svgrepo.com/show/128943/3-flowers.svg",
10
10
  CKEditorEquationEditorPopupInputFieldEnteredEquationText: "x=3√8,What is the value of x?",
11
11
  CKEditorInputFieldEnteredEquationText: "x=83,What is the value of x?",
12
- CKEditorInputFieldEnteredEquationAriaLabel: "x equals the cube root of 8 comma cap w h of A t i s t h of e v A l u e o f x question mark",
12
+ CKEditorInputFieldEnteredEquationAriaLabel: "x equals the cube root of 8 comma cap w h of A t i s t h of e v A l u e o f x question mark question mark",
13
13
  sampleMp3Link: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3",
14
14
  sampleWAVLink: "https://dl.espressif.com/dl/audio/ff-16b-1c-44100hz.wav",
15
15
  sampleAACLink: "https://dl.espressif.com/dl/audio/ff-16b-1c-44100hz.aac",
@@ -118,7 +118,9 @@
118
118
  "darkThemeBtnBg": "rgb(28, 28, 155)",
119
119
  "darkThemeBtnBorder": "rgb(117, 51, 255)",
120
120
  "lightThemeBtnBg": "rgb(82, 0, 255)",
121
- "lightThemeBtnBorder": "rgb(94, 110, 255)"
121
+ "lightThemeBtnBorder": "rgb(94, 110, 255)",
122
+ "enabledSwitchBg": "rgb(48, 160, 79)",
123
+ "geoGebraCanvasBorder": "rgb(102, 102, 102)"
122
124
  },
123
125
  "fontSize": {
124
126
  "extraSmall": "10px",
@@ -0,0 +1,66 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+
3
+ const selectors = {
4
+ accessibilityLabel: () => cy.get('[class*="Accessibilitystyles__AccessibilityLabelWrapper"]'),
5
+ flagNonAccessibleCheckbox: () => cy.get('[class*="Accessibilitystyles__OptionWrapper"] input'),
6
+ flagNonAccessibleLabel: () => cy.get('[class*="Accessibilitystyles__OptionWrapper"] span[class*="label"]')
7
+ }
8
+
9
+ const steps = {
10
+ verifyFlagThisItemNonAccessibleCheckboxIsUnchecked: () => {
11
+ additionalSettingsAccessibilitySectionComponent.flagNonAccessibleCheckbox()
12
+ .should('not.be.checked');
13
+ },
14
+
15
+ checkFlagThisItemNonAccessibleCheckbox: () => {
16
+ additionalSettingsAccessibilitySectionComponent.flagNonAccessibleCheckbox()
17
+ .click()
18
+ .should('be.checked');
19
+ },
20
+ }
21
+
22
+ const tests = {
23
+ verifyAdditionalSettingsAccessibilitySection: () => {
24
+ it('When the user expands additional settings accordion then \'Accessibility\' label should be displayed', () => {
25
+ utilities.verifyInnerText(additionalSettingsAccessibilitySectionComponent.accessibilityLabel(), 'Accessibility');
26
+ utilities.verifyElementVisibilityState(additionalSettingsAccessibilitySectionComponent.accessibilityLabel(), 'visible');
27
+ });
28
+
29
+ it('In \'Accessibility\' section, \'Flag this question as non-accessible\' label with checkbox should be displayed and it should be unchecked by default', () => {
30
+ utilities.verifyElementVisibilityState(additionalSettingsAccessibilitySectionComponent.flagNonAccessibleCheckbox(), 'exist');
31
+ utilities.verifyInnerText(additionalSettingsAccessibilitySectionComponent.flagNonAccessibleLabel(), 'Flag this question as non-accessible');
32
+ utilities.verifyElementVisibilityState(additionalSettingsAccessibilitySectionComponent.flagNonAccessibleLabel(), 'visible');
33
+ additionalSettingsAccessibilitySectionComponent.steps.verifyFlagThisItemNonAccessibleCheckboxIsUnchecked();
34
+ });
35
+
36
+ it('User should be able to check the \'Flag this question as non-accessible\' checkbox', () => {
37
+ additionalSettingsAccessibilitySectionComponent.steps.checkFlagThisItemNonAccessibleCheckbox();
38
+ });
39
+
40
+ it('CSS of \'Accessibility\' section', { tags: 'css' }, () => {
41
+ utilities.verifyCSS(additionalSettingsAccessibilitySectionComponent.accessibilityLabel(), {
42
+ 'color': css.color.labels,
43
+ 'font-size': css.fontSize.default,
44
+ 'font-weight': css.fontWeight.semibold
45
+ });
46
+ utilities.verifyCSS(additionalSettingsAccessibilitySectionComponent.flagNonAccessibleLabel(), {
47
+ 'color': css.color.labelText,
48
+ 'font-size': css.fontSize.normal,
49
+ 'font-weight': css.fontWeight.regular
50
+ });
51
+ utilities.verifyCSS(additionalSettingsAccessibilitySectionComponent.flagNonAccessibleCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
52
+ 'fill': css.color.activeButtons
53
+ });
54
+ });
55
+
56
+ it('Accessibility of checked \'Flag this question as non-accessible\' checkbox and \'Alternate accessible item id\' input field', { tags: 'a11y' }, () => {
57
+ cy.checkAccessibility(additionalSettingsAccessibilitySectionComponent.flagNonAccessibleCheckbox());
58
+ });
59
+ }
60
+ }
61
+
62
+ export const additionalSettingsAccessibilitySectionComponent = {
63
+ ...selectors,
64
+ steps,
65
+ tests,
66
+ }