itemengine-cypress-automation 1.0.113 → 1.0.115

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.js +489 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.js +482 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +488 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +92 -0
  5. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +229 -0
  6. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  7. package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +67 -0
  8. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -1
  9. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +11 -11
  10. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +529 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +108 -190
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +83 -155
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +104 -315
  14. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +121 -135
  15. package/cypress/e2e/ILC/EssayResponseMath/createItem.js +17 -0
  16. package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +203 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +121 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +236 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsBasic.js +255 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +237 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +236 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  23. package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +43 -0
  24. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +187 -0
  25. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
  26. package/cypress/e2e/ILC/ShortTextResponseNew/checkAnswerFunctionalityForAllViews.smoke.js +99 -0
  27. package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +97 -0
  28. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +74 -0
  29. package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +83 -0
  30. package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +109 -0
  31. package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +66 -0
  32. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +326 -0
  33. package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +163 -0
  34. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +8 -8
  35. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +3 -3
  36. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +154 -0
  37. package/cypress/pages/audioResponsePage.js +523 -66
  38. package/cypress/pages/components/autoScoredScoringPreviewTab.js +2 -0
  39. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +6 -5
  40. package/cypress/pages/components/equationEditorFlyout.js +11 -0
  41. package/cypress/pages/components/essayResponseCommonComponents.js +290 -19
  42. package/cypress/pages/components/figOverImageCanvasComponent.js +1 -1
  43. package/cypress/pages/components/maximumRecorderLengthComponent.js +32 -15
  44. package/cypress/pages/components/playbackControlsBaseComponent.js +9 -1
  45. package/cypress/pages/components/questionInputFieldComponent.js +0 -7
  46. package/cypress/pages/dragAndDropIntoCategoriesPage.js +3 -3
  47. package/cypress/pages/essayResponseBasicPage.js +1 -26
  48. package/cypress/pages/essayResponsePage.js +21 -284
  49. package/cypress/pages/shortTextResponsePage.js +142 -103
  50. package/cypress/pages/textEntryMathPage.js +58 -7
  51. package/package.json +1 -1
  52. package/scripts/sorry-cypress.mjs +1 -1
@@ -46,6 +46,8 @@ const steps = {
46
46
  return true;
47
47
  case 'single selection':
48
48
  return false;
49
+ case 'short text response':
50
+ return false;
49
51
  default:
50
52
  throw new Error('Invalid question type');
51
53
  }
@@ -127,9 +127,7 @@ const steps = {
127
127
  },
128
128
 
129
129
  verifySpecifyCorrectAnswerErrorMessage: () => {
130
- commonComponents.errorMessage()
131
- .last()
132
- .verifyInnerText('Error: Please set a correct answer.');
130
+ utilities.verifyInnerText(commonComponents.errorMessage().last(), 'Error: Please set a correct answer.');
133
131
  }
134
132
  }
135
133
 
@@ -155,7 +153,7 @@ const tests = {
155
153
  helpText = 'You can set the correct answer by entering the correct answer(s) in the response area(s).';
156
154
  break;
157
155
  case 'short text response':
158
- helpText = 'You can set the correct answer by entering the correct answer in the input field.';
156
+ helpText = 'You can set the correct answer by entering the correct answer(s) in the response area(s).';
159
157
  break;
160
158
  case 'fill in the gaps - dropdown':
161
159
  helpText = 'You can set the correct answer by selecting the correct answer(s) in the response area(s).';
@@ -347,9 +345,12 @@ const tests = {
347
345
  });
348
346
  utilities.verifyInnerText(utilities.getNthElement(scoringSectionBase.pleaseEnterPointsErrorMessage(), 0), 'Error: Please enter points.');
349
347
  utilities.verifyElementVisibilityState(scoringSectionBase.pleaseEnterPointsErrorMessage(), 'visible');
350
- if (questionType != 'list ordering') {
348
+ if (questionType != 'list ordering' && questionType != 'short text response') {
351
349
  steps.verifySpecifyCorrectAnswerErrorMessage();
352
350
  }
351
+ else if (questionType === 'short text response') {
352
+ utilities.verifyInnerText(utilities.getNthElement(commonComponents.errorMessage(), -1), 'Error: Answer is required.');
353
+ }
353
354
  if (questionType === 'fill in the gaps over image text' || questionType === 'text entry math') {
354
355
  utilities.verifyInnerText(commonComponents.errorMessage().last(), 'Error: Please enter points.');
355
356
  utilities.verifyElementVisibilityState(commonComponents.errorMessage().last(), 'visible');
@@ -325,6 +325,17 @@ const steps = {
325
325
  focusInPreviewInputField: () => {
326
326
  equationEditorFlyout.previewInputField()
327
327
  .click();
328
+ },
329
+
330
+
331
+ enterQuadraticEquation: () => {
332
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'keypad', symbolName: ['two'] }, { categoryName: 'basic', symbolName: ['x', 'square', 'y', 'square', 'add'] }, { categoryName: 'keypad', symbolName: ['four'] }, { categoryName: 'basic', symbolName: ['x', 'y', 'add'] }, { categoryName: 'keypad', symbolName: ['four'] }]);
333
+ equationEditorFlyout.steps.clickOnOkButton();
334
+ },
335
+
336
+ enterEquationUsingPiSymbol: () => {
337
+ equationEditorFlyout.steps.enterEquation([{ categoryName: 'keypad', symbolName: ['six', 'multiply'] }, { categoryName: 'greek', symbolName: ['pi'] }]);
338
+ equationEditorFlyout.steps.clickOnOkButton();
328
339
  }
329
340
  }
330
341
 
@@ -1,6 +1,9 @@
1
1
  import utilities from "../../support/helpers/utilities";
2
2
  import { commonComponents } from "./commonComponents";
3
3
 
4
+ let originalText;
5
+ let formattedText;
6
+
4
7
  const selectors = {
5
8
  //Basic section
6
9
  setLimitLabel: () => cy.get('[class*="SetLimitWrapper"] .essay-response-word-limit-label'),
@@ -27,7 +30,33 @@ const selectors = {
27
30
  return cy.get('.essay-preview-wrapper a[role="button"]')
28
31
  }
29
32
  },
30
- //Additional settings
33
+
34
+ //Customize Formatting options section
35
+ customizeFormattingOptionsAccordionLabel: () => cy.get('.customize-formatting-options-label'),
36
+ customizeFormattingOptionsSectionExpandIcon: () => cy.get('.customize-formatting-option-wrapper [class*="expandIconWrapper"]'),
37
+ customizeFormattingOptionsTiles: (formattingOption = null) => {
38
+ if (formattingOption) {
39
+ return cy.get(`.toolbar-options-wrapper .icon-button-custom-format[title="${formattingOption}"]`)
40
+ } else {
41
+ return cy.get('.toolbar-options-wrapper .icon-button-custom-format')
42
+ }
43
+ },
44
+ tickIcon: () => cy.get('[class*="TickIconWrapper"] svg'),
45
+ customizeFormattingOptionsLabel: () => cy.get('.icon-button-custom-format .drag-item-flex-wrapper svg'),
46
+ customizeFormattingOptionsWrapper: () => cy.get('.customize-formatting-option-wrapper'),
47
+ customizeFormattingOptionsAccordion: () => cy.get('.customize-formatting-option-wrapper .ngie-accordion-summary'),
48
+ customizeFormattingOptionsDragHandleButton: () => cy.get('.toolbar-options-wrapper [data-testid="drag-icon-wrapper"]'),
49
+
50
+ //wordCount
51
+ displayWordCountCheckbox: () => cy.get('[data-ngie-testid="display-word-count-checkbox"] input'),
52
+ wordCountWrapper: () => cy.get('[class*="indexstyle__WordCharCountWrapper"]'),
53
+
54
+ //Preview tab
55
+ responseField: () => cy.get('[title="Enter your response to the question here."]'),
56
+ responseFieldWordCount: () => cy.get('[class*="InputLimitLabelWrapper"]'),
57
+ responseFieldEquation: () => cy.get('.cke_widget_element'),
58
+
59
+ //Additional settings, These are old selectors. Need to update them along with additional settings file revamp
31
60
  studentResponseAndLayoutLabel: () => cy.get('.layout-text'),
32
61
  predefinedTextLabel: () => cy.get('[class*="EssayResponsestyles__PropertyLabel"]'),
33
62
  predefinedTextInputField: () => cy.get('[title="Predefined Text"]'),
@@ -44,11 +73,7 @@ const selectors = {
44
73
  customSpecialCharacterLabel: () => cy.get('[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]').eq(1),
45
74
  customSpecialCharacterInputField: () => cy.get('input[aria-label="Custom Special Characters"]'),
46
75
  limitReachedWarningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
47
- limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
48
- //Preview tab
49
- responseField: () => cy.get('[title="Enter your response to the question here."]'),
50
- responseFieldWordCount: () => cy.get('[class*="InputLimitLabelWrapper"]'),
51
- responseFieldEquation: () => cy.get('.cke_widget_element'),
76
+ limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]')
52
77
  }
53
78
 
54
79
  const steps = {
@@ -62,7 +87,6 @@ const steps = {
62
87
  .type(maxLimit)
63
88
  .blur()
64
89
  .should('have.value', maxLimit);
65
-
66
90
  },
67
91
 
68
92
  /**
@@ -98,7 +122,6 @@ const steps = {
98
122
  .should('have.value', maxLimit)
99
123
  },
100
124
 
101
-
102
125
  verifyMaximumLimitErrorMessage: () => {
103
126
  utilities.verifyInnerText(commonComponents.errorMessage().eq(1), 'Error: Maximum limit must be greater than or equal to Minimum limit.');
104
127
  utilities.verifyElementVisibilityState(commonComponents.errorMessage().eq(1), 'visible');
@@ -156,6 +179,12 @@ const steps = {
156
179
  .should('be.checked');
157
180
  },
158
181
 
182
+ verifyListItemLengthInResponseField: (length) => {
183
+ essayResponseCommonComponents.responseField()
184
+ .find('li')
185
+ .should('have.length', length);
186
+ },
187
+
159
188
  /**
160
189
  * verify response field equation text content
161
190
  * @param {number} equationIndex index of equation
@@ -181,15 +210,6 @@ const steps = {
181
210
  });
182
211
  },
183
212
 
184
- //TODO: need to improve this, we are passing two parameters here, only one should suffice
185
- openAndSelectOptionFromDisplayWordLimitDropdown: (optionIndex, optionName) => {
186
- essayResponseCommonComponents.displayWordLimitDropdown()
187
- .click();
188
- essayResponseCommonComponents.displayWordLimitDropdownListOptions(optionIndex)
189
- .click();
190
- essayResponseCommonComponents.displayWordLimitDropdown()
191
- .should('have.text', optionName);
192
- },
193
213
 
194
214
  enterTextInResponseField: (textContent) => {
195
215
  essayResponseCommonComponents.steps.enterInputInResponseField(textContent);
@@ -206,6 +226,11 @@ const steps = {
206
226
  .clear();
207
227
  },
208
228
 
229
+ focusInResponseField: () => {
230
+ essayResponseCommonComponents.responseField()
231
+ .click();
232
+ },
233
+
209
234
  focusOutOfResponseField: () => {
210
235
  essayResponseCommonComponents.responseField()
211
236
  .blur();
@@ -254,7 +279,7 @@ const steps = {
254
279
  },
255
280
 
256
281
  resetPreviewTabResponseField: () => {
257
- cy.log('clearing and resetting the response field');
282
+ cy.log('Clearing and resetting the response field');
258
283
  essayResponseCommonComponents.responseField()
259
284
  .clear()
260
285
  .blur();
@@ -315,10 +340,256 @@ const steps = {
315
340
  verifyLimitReachedWarningMessage: (warningText) => {
316
341
  utilities.verifyElementVisibilityState(essayResponseCommonComponents.limitReachedWarningMessage(), 'visible');
317
342
  utilities.verifyInnerText(essayResponseCommonComponents.limitReachedWarningMessage(), warningText);
343
+ },
344
+
345
+ expandCustomizeFormattingOptionsAccordion: () => {
346
+ essayResponseCommonComponents.customizeFormattingOptionsAccordion()
347
+ .click()
348
+ .should('have.attr', 'aria-expanded', 'true');
349
+ },
350
+
351
+ collapseCustomizeFormattingOptionsAccordion: () => {
352
+ essayResponseCommonComponents.customizeFormattingOptionsAccordion()
353
+ .click()
354
+ .should('have.attr', 'aria-expanded', 'false');
355
+ },
356
+
357
+ /**
358
+ * Verifies the customization options tiles and their selected state.
359
+ * @param {string[]} customizeOptions - An array of customization options to be verified.
360
+ * @param {string[]} stateOfFormattingOption - An array representing the expected state ('true' or 'false') for each customization option.
361
+ */
362
+ verifyCustomizeFormattingOptionsAndSelectedState: (customizeOptions, stateOfFormattingOption) => {
363
+ essayResponseCommonComponents.customizeFormattingOptionsTiles()
364
+ .each(($button, count) => {
365
+ cy.wrap($button)
366
+ .should('have.attr', 'title', customizeOptions[count])
367
+ .and('have.attr', 'data-aria-pressed', stateOfFormattingOption[count])
368
+ });
369
+ },
370
+
371
+ /**
372
+ * Verifies the visibility of preview tab toolbar options.
373
+ * @param {string[]} customizeOptions - An array of option names to be verified for visibility.
374
+ * @returns {void}
375
+ */
376
+ verifyPreviewTabToolbarOptions: (customizeOptions) => {
377
+ customizeOptions.forEach((optionName) => {
378
+ essayResponseCommonComponents.previewTabToolbarOption(optionName)
379
+ .and('be.visible');
380
+ });
381
+ },
382
+
383
+ /**
384
+ * Deselects a preview tab toolbar option and verifies its state.
385
+ * @param {string} toolbarOption - The name of the toolbar option to be deselected.
386
+ * @returns {void}
387
+ */
388
+ deselectPreviewTabToolbarOption: (toolbarOption) => {
389
+ essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
390
+ .click()
391
+ .should('have.attr', 'aria-pressed', 'false');
392
+ },
393
+
394
+ /**
395
+ * This function verifies the formatting option is in selected state
396
+ * @param {string} formattingOption name of the formatting option
397
+ */
398
+ verifyPreviewTabToolbarOptionDisabled: (formattingOption) => {
399
+ essayResponseCommonComponents.previewTabToolbarOption(formattingOption)
400
+ .should('have.attr', 'aria-disabled', 'true');
401
+ },
402
+
403
+ /**
404
+ * This function verifies the formatting option is in selected state
405
+ * @param {string} formattingOption name of the formatting option
406
+ */
407
+ verifyPreviewTabToolbarOptionNotDisabled: (formattingOption) => {
408
+ essayResponseCommonComponents.previewTabToolbarOption(formattingOption)
409
+ .should('have.attr', 'aria-disabled', 'false');
410
+ },
411
+
412
+ /**
413
+ * This function verifies the formatting option is in selected state
414
+ * @param {string} formattingOption name of the formatting option
415
+ */
416
+ verifyPreviewTabToolbarOptionNotSelected: (formattingOption) => {
417
+ essayResponseCommonComponents.previewTabToolbarOption(formattingOption)
418
+ .should('have.attr', 'aria-pressed', 'false');
419
+ },
420
+
421
+ /**
422
+ * This function verifies the formatting option is in selected state
423
+ * @param {string} formattingOption name of the formatting option
424
+ */
425
+ verifyPreviewTabToolbarOptionSelected: (formattingOption) => {
426
+ essayResponseCommonComponents.previewTabToolbarOption(formattingOption)
427
+ .should('have.attr', 'aria-pressed', 'true');
428
+ },
429
+
430
+ /**
431
+ * This function verifies the formatting option is in selected state
432
+ * @param {string} formattingOption name of the formatting option
433
+ */
434
+ verifyCustomizeFormattingOptionIsSelected: (formattingOption) => {
435
+ essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
436
+ .should('have.attr', 'data-aria-pressed', 'true');
437
+ },
438
+
439
+ /**
440
+ * This function verifies the formatting option is not selected
441
+ * @param {string} formattingOption name of the formatting option
442
+ */
443
+ verifyCustomizeFormattingOptionNotSelected: (formattingOption) => {
444
+ essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
445
+ .should('have.attr', 'data-aria-pressed', 'false');
446
+ },
447
+
448
+ /**
449
+ * Selects customized formatting options and verifies their selected state.
450
+ * @param {string[]} formattingOptionArray - An array of formatting options to be selected.
451
+ * @returns {void}
452
+ */
453
+ selectCustomizedFormattingOption: (formattingOptionArray) => {
454
+ formattingOptionArray.forEach((formattingOption) => {
455
+ essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
456
+ .click();
457
+ essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
458
+ .should('have.attr', 'data-aria-pressed', 'true');
459
+ });
460
+ },
461
+
462
+ /**
463
+ * Deselects customized formatting options and verifies their deselected state.
464
+ * @param {string[]} formattingOptionArray - An array of formatting options to be deselected.
465
+ * @returns {void}
466
+ */
467
+ deselectCustomizedFormattingOption: (formattingOptionArray) => {
468
+ formattingOptionArray.forEach((formattingOption) => {
469
+ essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
470
+ .click();
471
+ essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
472
+ .should('have.attr', 'data-aria-pressed', 'false');
473
+ });
474
+ },
475
+
476
+ checkDisplayWordCountCheckbox: () => {
477
+ essayResponseCommonComponents.displayWordCountCheckbox()
478
+ .click()
479
+ .should('be.checked');
480
+ },
481
+
482
+ /**
483
+ * verify word count in preview tab
484
+ * @param {number} wordCount
485
+ */
486
+ verifyWordCount: (wordCount) => {
487
+ utilities.verifyInnerText(essayResponseCommonComponents.wordCountWrapper(), `Words: ${wordCount}`)
488
+ },
489
+
490
+ verifyCustomizeToolbarOptions: (customizeFormattingOptions) => {
491
+ customizeFormattingOptions.forEach((optionName) => {
492
+ utilities.verifyElementVisibilityState(essayResponseCommonComponents.customizeFormattingOptionsTiles(optionName), 'visible');
493
+ });
494
+ },
495
+
496
+ /**
497
+ * Verifies the HTML content of the essay response field.
498
+ * @param {string} HTMLText - The expected HTML content to be verified.
499
+ */
500
+ verifyResponseFieldHTML: (HTMLText) => {
501
+ essayResponseCommonComponents.responseField()
502
+ .verifyInnerHTML(HTMLText);
503
+ },
504
+
505
+ /**
506
+ * Verifies the HTML content of code blocks within the essay response field.
507
+ * @param {string} HTMLText - The expected HTML content of code blocks to be verified.
508
+ */
509
+ verifyResponseFieldCodeblockHTML: (HTMLText) => {
510
+ essayResponseCommonComponents.responseField()
511
+ .find('.codeblock')
512
+ .verifyInnerHTML(HTMLText);
513
+ },
514
+
515
+ /**
516
+ * Verifies the number of code blocks in the essay response field.
517
+ * @param {number} length - The expected number of code blocks.
518
+ */
519
+ verifyCodeLength: (length) => {
520
+ essayResponseCommonComponents.responseField()
521
+ .find('pre')
522
+ .should('have.length', length);
523
+ },
524
+
525
+ /**
526
+ * Verifies the Undo and Redo functionality in the essay response field.
527
+ * @param {string} toolbarOption - The toolbar option that was manipulated.
528
+ * @param {string} originalText - The original HTML content before the manipulation.
529
+ * @param {string} formattedText - The expected HTML content after Undo and Redo operations.
530
+ */
531
+ verifyUndoAndRedoFunctionality: (toolbarOption, originalText, formattedText) => {
532
+ essayResponseCommonComponents.previewTabToolbarOption('Undo (Ctrl+Z)')
533
+ .click();
534
+ if (toolbarOption == 'Background Color' || toolbarOption == 'Text Color') {
535
+ essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
536
+ .should('have.attr', 'aria-expanded', 'false');
537
+ } else {
538
+ essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
539
+ .should('have.attr', 'aria-pressed', 'false');
540
+ };
541
+ essayResponseCommonComponents.responseField()
542
+ .verifyInnerHTML(originalText);
543
+ essayResponseCommonComponents.previewTabToolbarOption('Redo (Ctrl+Y)')
544
+ .click();
545
+ if (toolbarOption == 'Background Color' || toolbarOption == 'Text Color') {
546
+ essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
547
+ .should('have.attr', 'aria-expanded', 'true');
548
+ } else if (toolbarOption == 'Insert Horizontal Line' || toolbarOption == 'Code Editor' || toolbarOption == 'Increase Indent' || toolbarOption == 'Decrease Indent' || toolbarOption == 'Remove Format') {
549
+ essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
550
+ .should('have.attr', 'aria-pressed', 'false');
551
+ } else {
552
+ essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
553
+ .should('have.attr', 'aria-pressed', 'true');
554
+ };
555
+ essayResponseCommonComponents.responseField()
556
+ .verifyInnerHTML(formattedText);
318
557
  }
319
558
  }
320
559
 
560
+ const tests = {
561
+ /**
562
+ * This function verifies undo and redo functionality
563
+ * @param {string} toolbarOption toolbar option
564
+ */
565
+ verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption: (toolbarOption) => {
566
+ it(`When the user enters text in the response field, selects the text and selects the ${toolbarOption} toolbar option and clicks on the \'Undo\' toolbar option, then it should undo the latest action and when the user clicks on the \'Redo\' toolbar option, then it should redo the latest action`, () => {
567
+ essayResponseCommonComponents.steps.resetPreviewTabResponseField();
568
+ essayResponseCommonComponents.steps.enterInputInResponseField('Lorem Ipsum');
569
+ if (toolbarOption == 'Decrease Indent') {
570
+ essayResponseCommonComponents.previewTabToolbarOption('Increase Indent')
571
+ .click();
572
+ } else if (toolbarOption == 'Remove Format') {
573
+ essayResponseCommonComponents.steps.enterInputInResponseField('{selectAll}');
574
+ essayResponseCommonComponents.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
575
+ };
576
+ essayResponseCommonComponents.responseField()
577
+ .then(($originalText) => {
578
+ originalText = $originalText[0].innerHTML
579
+ essayResponseCommonComponents.steps.enterInputInResponseField('{selectAll}');
580
+ essayResponseCommonComponents.steps.selectPreviewTabToolbarOption(toolbarOption);
581
+ essayResponseCommonComponents.responseField()
582
+ .then(($formattedText) => {
583
+ formattedText = $formattedText[0].innerHTML
584
+ essayResponseCommonComponents.steps.verifyUndoAndRedoFunctionality(toolbarOption, originalText, formattedText);
585
+ });
586
+ });
587
+ });
588
+ },
589
+ }
590
+
321
591
  export const essayResponseCommonComponents = {
322
592
  ...selectors,
323
- steps
593
+ steps,
594
+ tests
324
595
  }
@@ -37,7 +37,7 @@ const selectors = {
37
37
  }
38
38
  },
39
39
  textResponse: () => cy.get('[class*="Canvasstyle__TextBoxContainer"] textarea'),
40
- canvasImage: () => cy.get('.canvas-image'),
40
+ canvasImage: () => cy.get('.canvas-image').eq(0),
41
41
  canvasImageInPreviewTab: () => cy.get('[class*="PreviewTabstyles"] [class*="ImageWrapper"] img'),
42
42
  imagePropertiesLabel: () => cy.get('[class*="ImagePropertiesstyles__SectionLabel"]'),
43
43
  fillImageToCanvasLabel: () => cy.get('[data-ngie-testid="fill-image-to-canvas-checkbox"] .MuiFormControlLabel-label'),
@@ -4,8 +4,10 @@ const css = Cypress.env('css');
4
4
 
5
5
  const selectors = {
6
6
  maximumRecorderLengthInputField: () => cy.get('input[aria-label="Maximum recorder length"]'),
7
- maximumRecorderLengthLabel: () => cy.get('.max-recording-length-input-label'),
7
+ maximumRecorderLengthLabel: () => cy.get('.max-record-length-label'),
8
8
  maximumRecorderLengthInputFieldSecsSuffix: () => cy.get('[class*="max-recording"][class*="suffix"]'),
9
+ maximumRecorderLengthSecsToggleButton: () => cy.get('.max-recording-length-input [data-ngie-testid="secs-toggle-button"]'),
10
+ maximumRecorderLengthMinsToggleButton: () => cy.get('.max-recording-length-input [data-ngie-testid="mins-toggle-button"]'),
9
11
  }
10
12
 
11
13
  const steps = {
@@ -38,35 +40,50 @@ const steps = {
38
40
  }
39
41
 
40
42
  const tests = {
41
- verifyMaximumRecorderLengthSectionCSS: () => {
43
+ verifyMaximumRecorderLengthLabelAndInputField: () => {
44
+ it('\'Maximum recorder length\' label, input field, "Secs" and "Mins" toggle buttons should be displayed. By default "Secs" toggle button should be in selected state. "900" should be displayed in \'Maximum recorder length\' field', () => {
45
+ utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), 'Maximum recorder length');
46
+ utilities.verifyElementVisibilityState(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), 'visible');
47
+ utilities.verifyElementVisibilityState(maximumRecorderLengthComponent.maximumRecorderLengthInputField(), 'visible');
48
+ maximumRecorderLengthComponent.maximumRecorderLengthSecsToggleButton()
49
+ .should('have.class', 'ngie-toggle-button-selected');
50
+ maximumRecorderLengthComponent.steps.verifyMaximumRecorderLength(900);
51
+ utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthSecsToggleButton(), 'Secs');
52
+ utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthMinsToggleButton(), 'Mins');
53
+ });
54
+
42
55
  it('CSS of \'Maximum recorder length\' section', { tags: 'css' }, () => {
43
56
  utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), {
44
57
  'color': css.color.labels,
45
58
  'font-size': css.fontSize.normal,
46
59
  'font-weight': css.fontWeight.semibold
47
60
  });
48
- utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthInputField(), {
49
- 'color': css.color.text,
61
+ utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthSecsToggleButton(), {
62
+ 'color': css.color.defaultBackground,
63
+ 'background-color': css.color.activeButtons,
64
+ 'font-size': css.fontSize.default,
65
+ 'font-weight': css.fontWeight.regular
66
+ });
67
+ utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthMinsToggleButton(), {
68
+ 'color': css.color.secondaryBtn,
69
+ 'background-color': css.color.secondaryBtnBg,
50
70
  'font-size': css.fontSize.default,
51
71
  'font-weight': css.fontWeight.regular
52
72
  });
53
- utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthInputFieldSecsSuffix(), {
73
+ utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthInputField(), {
54
74
  'color': css.color.text,
55
75
  'font-size': css.fontSize.default,
56
76
  'font-weight': css.fontWeight.regular
57
77
  });
58
78
  });
59
- },
60
79
 
61
- verifyMaximumRecorderLengthLabelAndInputField: () => {
62
- it('\'Maximum recorder length\' label, input field and \'Secs\' text should be displayed. By default 900 seconds(15 minutes) should be displayed in \'Maximum recorder length\' field', () => {
63
- utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), 'Maximum recorder length');
64
- utilities.verifyElementVisibilityState(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), 'visible');
65
- utilities.verifyElementVisibilityState(maximumRecorderLengthComponent.maximumRecorderLengthInputField(), 'visible');
66
- maximumRecorderLengthComponent.steps.verifyMaximumRecorderLength(900);
67
- utilities.verifyElementVisibilityState(maximumRecorderLengthComponent.maximumRecorderLengthInputFieldSecsSuffix(), 'visible');
68
- //https://redmine.zeuslearning.com/issues/540899
69
- utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthInputFieldSecsSuffix(), 'Secs');
80
+ //Note: a11y is covered for Maximum recorder length section in HeaderSection file using verifyCreateItemWrapperContentsA11y
81
+
82
+ it('When the user toggles to "Mins", "15" should be displayed in \'Maximum recorder length\' field', () => {
83
+ maximumRecorderLengthComponent.maximumRecorderLengthMinsToggleButton()
84
+ .click()
85
+ .should('have.class', 'ngie-toggle-button-selected');
86
+ maximumRecorderLengthComponent.steps.verifyMaximumRecorderLength(15);
70
87
  });
71
88
  },
72
89
 
@@ -7,7 +7,7 @@ const selectors = {
7
7
  volumeControlSlider: () => cy.get('.audio-volume-control-slider'),
8
8
  muteVolumeIcon: () => cy.get('.audio-mute-icon-wr'),
9
9
  unmutedVolumeIcon: () => cy.get('.audio-volume-icon-wr'),
10
- progressBar: () => cy.get('[class*="progress-bar-wrapper"]'),
10
+ progressBar: () => cy.get('[class*="ProgressBarstyle__SliderWrapper"]'),
11
11
  progressBarSlider: () => cy.get('input[aria-label="Slider bar"]'),
12
12
  playbackPlayButton: () => cy.get('button[aria-label="Play"]'),
13
13
  playbackPauseButton: () => cy.get('button[aria-label="Pause"]'),
@@ -195,6 +195,14 @@ const steps = {
195
195
  playbackControlsBaseComponent.playbackSpeedOption(playbackSpeed)
196
196
  .click();
197
197
  },
198
+
199
+ verifyVolumeButtonEnabledState: () => {
200
+ utilities.verifyElementNotDisabled(playbackControlsBaseComponent.volumeControlButton());
201
+ },
202
+
203
+ verifyPlaybackSpeedButtonEnabledState: () => {
204
+ utilities.verifyElementNotDisabled(playbackControlsBaseComponent.playbackSpeedButton());
205
+ }
198
206
  }
199
207
 
200
208
  const tests = {
@@ -12,13 +12,6 @@ const selectors = {
12
12
  }
13
13
 
14
14
  const steps = {
15
- addResponseTokenInQuestionField: () => {
16
- questionInputFieldComponent.questionInputField()
17
- .click();
18
- questionInputFieldComponent.ckEditorAddResponseButton()
19
- .click();
20
- },
21
-
22
15
  /**
23
16
  * @description Delete a response token by clicking on its close button
24
17
  * @param {number} responseTokenIndex response token index
@@ -22,9 +22,9 @@ const selectors = {
22
22
  editCellPropertyButton: () => cy.get('button[aria-label="More Action"]'),
23
23
  editCellPropertyList: () => cy.get('.ngie-action-cell-container [role="menu"]'),
24
24
  editCellPropertyListOption: () => cy.get('[class*="MuiMenuItem"][role="menuitem"]'),
25
- cellHeadingTextArea: () => cy.get('textarea[aria-label="enter heading"]'),
26
- cellSubheadingTextArea: () => cy.get('textarea[aria-label="enter subheading"]'),
27
- cellTextTextArea: () => cy.get('textarea[aria-label="Enter text here..."]'),
25
+ cellHeadingTextArea: () => cy.get('.heading-field-wrapper [role="textbox"]'),
26
+ cellSubheadingTextArea: () => cy.get('.heading-field-wrapper [role="textbox"]'),
27
+ cellTextTextArea: () => cy.get('.matrix-text-field [role="textbox"]'),
28
28
  tableCellContainer: () => cy.get('[class*="DragAndDropTablestyles__CellContainer"]'),
29
29
  //Note: remove :visible after https://redmine.zeuslearning.com/issues/556304 gets fixed
30
30
  dropzoneCellSpecifyCorrectAnswerSection: () => cy.get('[class*="DragAndDropMatrixstyles__CellContainer"][class*="dropzone-cell"]:visible'),
@@ -7,15 +7,6 @@ const selectors = {
7
7
  ...additionalSettingsPanel,
8
8
  ...scoringSectionBase,
9
9
  ...essayResponseCommonComponents,
10
- //Customize Formatting options section
11
- customizeFormattingOptionsSectionLabel: () => cy.get('.customize-essay-formatting-options .ngie-toggle-button-title'),
12
- cutCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="cut-toggle-button"]`),
13
- copyCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="copy-toggle-button"]`),
14
- pasteCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="paste-toggle-button"]`),
15
- specialCharacterCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="special-characters-toggle-button"]`),
16
- customizeFormattingOptionsLabel: () => cy.get('.ngie-toggle-button-label'),
17
- customizeFormattingOptionsIcon: () => cy.get('.ngie-toggle-button-icon svg'),
18
- customizeFormattingOptionsWrapper: () => cy.get('.customize-essay-formatting-options'),
19
10
  };
20
11
 
21
12
  const steps = {
@@ -23,23 +14,7 @@ const steps = {
23
14
  ...questionInstructionsComponent.steps,
24
15
  ...additionalSettingsPanel.steps,
25
16
  ...scoringSectionBase.steps,
26
- ...essayResponseCommonComponents.steps,
27
-
28
- cutTextFromResponseField: () => {
29
- essayResponseBasicPage.responseField()
30
- .type('{selectAll}');
31
- essayResponseBasicPage.previewTabToolbarOption('Cut')
32
- .click();
33
- },
34
-
35
- copyTextFromResponseField: () => {
36
- essayResponseBasicPage.responseField()
37
- .type('{selectAll}');
38
- essayResponseBasicPage.previewTabToolbarOption('Copy')
39
- .click();
40
- essayResponseBasicPage.responseField()
41
- .click();
42
- },
17
+ ...essayResponseCommonComponents.steps
43
18
  };
44
19
 
45
20
  const tests = {