itemengine-cypress-automation 1.0.90 → 1.0.92

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 (31) hide show
  1. package/cypress/e2e/ILC/Desmos/desmosGeometryToolPreviewContents.smoke.js +1 -1
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +3 -3
  3. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +418 -0
  4. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +1 -1
  5. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  6. package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +1 -1
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +0 -1
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +79 -0
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/conditionalCheckboxScoring.js +335 -0
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +64 -1
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +334 -0
  12. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +180 -0
  13. package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +55 -0
  14. package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +257 -0
  15. package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +68 -0
  16. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +773 -0
  17. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +1 -1
  18. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +50 -50
  19. package/cypress/fixtures/theme/ilc.json +1 -1
  20. package/cypress/pages/components/commonComponents.js +1 -1
  21. package/cypress/pages/components/desmosToolComponent.js +1 -1
  22. package/cypress/pages/components/equationEditorFlyout.js +118 -7
  23. package/cypress/pages/components/essayResponseCommonComponents.js +26 -1
  24. package/cypress/pages/components/figOverImageCanvasComponent.js +1 -1
  25. package/cypress/pages/drawingResponsePage.js +1 -1
  26. package/cypress/pages/essayResponsePage.js +106 -1
  27. package/cypress/pages/fillInTheGapsOverImageTextPage.js +270 -8
  28. package/cypress/pages/readingRulerPage.js +64 -5
  29. package/cypress/pages/textEntryMathPage.js +112 -8
  30. package/package.json +1 -1
  31. package/scripts/sorry-cypress.mjs +1 -1
@@ -6,6 +6,7 @@ import { specialOrMathCharacters } from "../fixtures/specialAndMathCharacters";
6
6
  import utilities from "../support/helpers/utilities";
7
7
  const css = Cypress.env('css');
8
8
 
9
+ const allCategories = Object.values(equationEditorCategoriesAndSymbols);
9
10
  let originalText;
10
11
  let formattedText;
11
12
 
@@ -32,6 +33,10 @@ const selectors = {
32
33
  tableHeaderRow: () => cy.get('thead'),
33
34
  tableHeaderCell: () => cy.get('th'),
34
35
 
36
+ //wordCount
37
+ displayWordCountCheckbox: () => cy.get('[data-ngie-testid="display-word-count-checkbox"] input'),
38
+ wordCountWrapper: () => cy.get('[class*="indexstyle__WordCharCountWrapper"]'),
39
+
35
40
  ///Old
36
41
  //Customize Formatting Options
37
42
  customizeFormattingOptionsAccordion: () => cy.get('.customize-formatting-option-wrapper .ngie-accordion-summary'),
@@ -52,7 +57,7 @@ const selectors = {
52
57
  equationEditorSectionCategories: () => cy.get('[class*="DraggableItemsGrid"] .icon-button-custom-format'),
53
58
  equationEditorSectionCategoryLabel: () => cy.get('.equation-editor-label-wrapper'),
54
59
  equationEditorSection: () => cy.get('[class*="EquationEditorOptionsWrapper"]'),
55
- equationEditorSectionTitle: () => cy.get('.equation-editor-text-title'),
60
+ equationEditorSectionTitle: () => cy.get('[class*="EssayResponseComponentstyles__SectionTitle"]'),
56
61
  equationEditorSectionHelperText: () => cy.get('.equation-editor-description-text'),
57
62
  equationEditorSectionCategoriesDragIcon: () => cy.get('.drag-icon-equation-editor-button'),
58
63
  equationEditorSectionCategoriesEditIcon: () => cy.get('.edit-icon-button button'),
@@ -129,6 +134,20 @@ const steps = {
129
134
  ...additionalSettingsPanel.steps,
130
135
  ...essayResponseCommonComponents.steps,
131
136
 
137
+ checkDisplayWordCountCheckbox: () => {
138
+ essayResponsePage.displayWordCountCheckbox()
139
+ .click()
140
+ .should('be.checked');
141
+ },
142
+
143
+ /**
144
+ * verify word count in preview tab
145
+ * @param {number} wordCount
146
+ */
147
+ verifyWordCount: (wordCount) => {
148
+ utilities.verifyInnerText(essayResponsePage.wordCountWrapper(), `Words: ${wordCount}`)
149
+ },
150
+
132
151
  /**
133
152
  * Verify newly added custom category container is displayed
134
153
  * @param {string} customCategoryName Custom category name
@@ -696,6 +715,83 @@ const steps = {
696
715
  });
697
716
  },
698
717
 
718
+ verifyDefaultCategoriesDisplayedInEquationEditorSectionEditTab: () => {
719
+ essayResponsePage.equationEditorSectionCategories()
720
+ .each(($el, index) => {
721
+ cy.wrap($el)
722
+ .invoke('text')
723
+ .then((textContent) => {
724
+ const expectedValue = allCategories[index].displayName;
725
+ expect(textContent.toLowerCase()).to.equal(expectedValue.toLowerCase())
726
+ });
727
+ cy.wrap($el)
728
+ .parents('[id*="DraggableItem"]')
729
+ .within(() => {
730
+ utilities.verifyElementVisibilityState(essayResponsePage.equationEditorSectionCategoriesDragIcon(), 'visible');
731
+ utilities.verifyElementVisibilityState(essayResponsePage.equationEditorSectionCategoriesEditIcon(), 'visible');
732
+ });
733
+ });
734
+ },
735
+
736
+ /**
737
+ * @description Verify tooltips of categories in equation editor section edit tab
738
+ * @param {string[]} categoryNamesArray Array of names of categories
739
+ */
740
+ verifyTooltipsOfCategoryTilesInEquationEditorSectionEditTab: (categoryNamesArray) => {
741
+ categoryNamesArray.forEach((categoryTooltipName) => {
742
+ essayResponsePage.equationEditorSectionCategories()
743
+ .contains(categoryTooltipName, { matchCase: false })
744
+ .verifyTooltip(categoryTooltipName);
745
+ });
746
+ },
747
+
748
+ /**
749
+ * @description Verify selected category in equation editor section edit tab
750
+ * @param {string[]} categoryName Name of categories
751
+ */
752
+ verifySelectedCategoryInEquationEditorSectionEditTab: (categoryName) => {
753
+ essayResponsePage.equationEditorSectionCategories()
754
+ .contains(categoryName, { matchCase: false })
755
+ .parents('.icon-button-custom-format')
756
+ .should('have.class', 'Mui-selected')
757
+ .within(() => {
758
+ utilities.verifyElementVisibilityState(essayResponsePage.equationEditorSectionTickIcon(), 'visible');
759
+ });
760
+ },
761
+
762
+ /**
763
+ * @description Verify deselected category in equation editor section edit tab
764
+ * @param {string[]} categoryName Name of category
765
+ */
766
+ verifyDeselectedCategoryInEquationEditorSectionEditTab: (categoryName) => {
767
+ essayResponsePage.equationEditorSectionCategories()
768
+ .contains(categoryName, { matchCase: false })
769
+ .parents('.icon-button-custom-format')
770
+ .should('not.have.class', 'Mui-selected')
771
+ .within(() => {
772
+ utilities.verifyElementVisibilityState(essayResponsePage.equationEditorSectionTickIcon(), 'hidden');
773
+ });
774
+ },
775
+
776
+ deselectACategoryInEquationEditorSectionEditTab: (categoryName) => {
777
+ essayResponsePage.equationEditorSectionCategories()
778
+ .contains(categoryName, { matchCase: false })
779
+ .click();
780
+ essayResponsePage.equationEditorSectionCategories()
781
+ .contains(categoryName, { matchCase: false })
782
+ .parents('.icon-button-custom-format')
783
+ .should('not.have.class', 'Mui-selected');
784
+ },
785
+
786
+ selectACategoryInEquationEditorSectionEditTab: (categoryName) => {
787
+ essayResponsePage.equationEditorSectionCategories()
788
+ .contains(categoryName, { matchCase: false })
789
+ .click();
790
+ essayResponsePage.equationEditorSectionCategories()
791
+ .contains(categoryName, { matchCase: false })
792
+ .parents('.icon-button-custom-format')
793
+ .should('have.class', 'Mui-selected');
794
+ },
699
795
  ///Old
700
796
  expandCustomizeFormattingOptionsAccordion: () => {
701
797
  essayResponsePage.customizeFormattingOptionsAccordion()
@@ -720,6 +816,15 @@ const steps = {
720
816
  });
721
817
  },
722
818
 
819
+ deselectCustomizedFormattingOption: (formattingOptionArray) => {
820
+ formattingOptionArray.forEach((formattingOption) => {
821
+ essayResponsePage.customizeFormattingOptionsTiles(formattingOption)
822
+ .click();
823
+ essayResponsePage.customizeFormattingOptionsTiles(formattingOption)
824
+ .should('have.attr', 'data-aria-pressed', 'false');
825
+ });
826
+ },
827
+
723
828
  deselectPreviewTabToolbarOption: (toolbarOption) => {
724
829
  essayResponsePage.previewTabToolbarOption(toolbarOption)
725
830
  .click()
@@ -29,16 +29,32 @@ const selectors = {
29
29
  responseAccordionAddAlternateButton: () => cy.get('.add-alternate-btn'),
30
30
  responseAccordionAddAlternateButtonLabel: () => cy.get('.add-alternate-btn p'),
31
31
  responseAreaNumeration: () => cy.get('.response-input-adornment'),
32
-
32
+
33
33
  answerInputFieldSpecifyCorrectAnswerSection: () => cy.get('.label-image-text-inline-text-field input'),
34
34
  answerInputFieldPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-input-field input'),
35
35
  correctAnswerSectionWrapper: () => cy.get('.cloze-with-text-correct-answer-wrapper'),
36
36
  correctAnswersLabel: () => cy.get('.correct-answers-label'),
37
37
  responseStatusWrapper: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper:visible'),
38
38
  tickIconWrapper: () => cy.get('.tick-icon-wrapper [data-name*="Rectangle"]'),
39
+ responseAreaNumeration: () => cy.get('.response-input-adornment'),
39
40
  correctAnswerResponseNumeration: () => cy.get('.answer-numeration-number-box'),
40
41
  correctAnswerResponseWrapper: () => cy.get('[class*="ClozeWithTextResponsestyles__AnswerCell"]'),
41
42
  correctAnswerResponse: () => cy.get('[class*="AnswerWrapperForLabel"]'),
43
+
44
+ setLimitLabel: () => cy.get('[class*="SetLimitWrapper"] .text-label'),
45
+ minimumCharacterLimitLabel: () => cy.get('.label-image-min-max-container .additional-settings-label').eq(0),
46
+ maximumCharacterLimitLabel: () => cy.get('.label-image-min-max-container .additional-settings-label').eq(1),
47
+ minMaxLabelAndInputFieldWrapper: () => cy.get('.label-image-min-max-container'),
48
+ minimumCharacterLimitInputField: () => cy.get('.label-image-min-max-container input').eq(0),
49
+ maximumCharacterLimitInputField: () => cy.get('.label-image-min-max-container input').eq(1),
50
+ characterRadioButton: () => cy.get('input[aria-label="Character"]'),
51
+ characterLabel: () => cy.get('[aria-label="Character"].ngie-radio-label'),
52
+ noneRadioButton: () => cy.get('input[aria-label="None"]'),
53
+ noneLabel: () => cy.get('[aria-label="None"].ngie-radio-label'),
54
+ limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
55
+ limitReachedWarningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
56
+ correctAnswerResponseWrapper: () => cy.get('.cloze-with-text-correct-response-wrapper .cloze-with-text-answer-status-response-preview-wrapper'),
57
+ correctAnswerResponse: () => cy.get('[class*="ResponseInputComponentstyles__ResponseInputWrapper"] input'),
42
58
  specialCharactersButtonPreviewTab: () => cy.get('.cloze-with-text-special-character-button'),
43
59
 
44
60
  //Special characters section
@@ -58,8 +74,19 @@ const selectors = {
58
74
 
59
75
  spellCheckLabel: () => cy.get('[data-ngie-testid="spell-check-checkbox"] .MuiFormControlLabel-label'),
60
76
  spellCheckCheckbox: () => cy.get('[data-ngie-testid="spell-check-checkbox"] input[type="checkbox"]'),
77
+
61
78
  //TODO: Need to remove it from here when https://redmine.zeuslearning.com/issues/558979 is resolved
62
79
  checkAnswerButton: () => cy.get('.check-answer-and-status-wrapper button').last(),
80
+
81
+ //Conditional checkboxes
82
+ caseSensitiveCheckboxLabel: () => cy.get('[data-ngie-testid="case-sensitive-checkbox"] [class*="label"]'),
83
+ caseSensitiveCheckbox: () => cy.get('[data-ngie-testid="case-sensitive-checkbox"] input'),
84
+ validateIfAnswerIsIncludedCheckboxLabel: () => cy.get('[data-ngie-testid="validate-if-answer-is-included-in-the-response-checkbox"] [class*="label"]'),
85
+ validateIfAnswerIsIncludedCheckbox: () => cy.get('[data-ngie-testid="validate-if-answer-is-included-in-the-response-checkbox"] input'),
86
+ ignoreExtraSpacesCheckboxLabel: () => cy.get('[data-ngie-testid="ignore-extra-spaces-checkbox"] [class*="label"]'),
87
+ ignoreExtraSpacesCheckbox: () => cy.get('[data-ngie-testid="ignore-extra-spaces-checkbox"] input'),
88
+ ignoreSingleLetterMistakeCheckboxLabel: () => cy.get('[data-ngie-testid="ignore-single-letter-mistake-checkbox"] [class*="label"]'),
89
+ ignoreSingleLetterMistakeCheckbox: () => cy.get('[data-ngie-testid="ignore-single-letter-mistake-checkbox"] input'),
63
90
  }
64
91
 
65
92
  const steps = {
@@ -78,7 +105,7 @@ const steps = {
78
105
  ...acceptedStudentInputComponent.steps,
79
106
  ...customizeSpecialCharacterComponent.steps,
80
107
  ...autoScoredStudentViewSettings.steps,
81
-
108
+
82
109
  /**
83
110
  * Enter text in the answer input fields of the specify correct answer section.
84
111
  * @param {Object[]} responses - An array of objects containing the responseIndex and responseText.
@@ -113,6 +140,17 @@ const steps = {
113
140
  });
114
141
  },
115
142
 
143
+ //Used in setLimitSection.js only.
144
+ /**
145
+ * @param {number} responseIndex index number of text container
146
+ * @param {string} responseText text to be added in text container
147
+ * @description function enters text in the answer input fields of the preview tab
148
+ */
149
+ addTextInAnswerInputFieldsPreviewTab: (responseIndex, responseText) => {
150
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab(), responseIndex)
151
+ .type(responseText);
152
+ },
153
+
116
154
  /**
117
155
  * Verify text in the answer input fields of the preview tab.
118
156
  * @param {Object[]} responses - An array of objects containing the responseIndex and responseText.
@@ -385,6 +423,27 @@ const steps = {
385
423
  });
386
424
  },
387
425
 
426
+ verifyCharacterRadioButtonSelected: () => {
427
+ fillInTheGapsOverImageTextPage.characterRadioButton()
428
+ .should('be.checked');
429
+ },
430
+
431
+ verifyNoneRadioButtonNotSelected: () => {
432
+ fillInTheGapsOverImageTextPage.noneRadioButton()
433
+ .should('not.be.checked');
434
+ },
435
+
436
+ selectCharacterRadioButton: () => {
437
+ fillInTheGapsOverImageTextPage.characterRadioButton()
438
+ .click()
439
+ .should('be.checked');
440
+ },
441
+
442
+ selectNoneRadioButton: () => {
443
+ fillInTheGapsOverImageTextPage.noneRadioButton()
444
+ .click()
445
+ },
446
+
388
447
  /**
389
448
  *@description Verify text in the answer input fields of the specify correct answer section.
390
449
  * @param {Object[]} responses - An array of objects containing the responseIndex and responseText.
@@ -448,7 +507,7 @@ const steps = {
448
507
  });
449
508
  });
450
509
  },
451
-
510
+
452
511
  verifySpellCheckCheckboxUnchecked: () => {
453
512
  fillInTheGapsOverImageTextPage.spellCheckCheckbox()
454
513
  .should('not.be.checked');
@@ -459,6 +518,134 @@ const steps = {
459
518
  .should('be.checked');
460
519
  },
461
520
 
521
+ /**
522
+ * @param {number} minLimit value of minimum input field
523
+ * @description this function verifies the value in minimum limit input field
524
+ */
525
+ verifyMinimumCharacterLimitInputField: (minLimit) => {
526
+ fillInTheGapsOverImageTextPage.minimumCharacterLimitInputField()
527
+ .should('have.value', minLimit);
528
+ },
529
+
530
+ /**
531
+ * @param {number} maxLimit value of maximum input field
532
+ * @description this function verifies the value in maximum limit input field
533
+ */
534
+ verifyMaximumCharacterLimitInputField: (maxLimit) => {
535
+ fillInTheGapsOverImageTextPage.maximumCharacterLimitInputField()
536
+ .should('have.value', maxLimit);
537
+ },
538
+
539
+ /**
540
+ * @param {number} maxLimit value to be entered in maximum limit input field
541
+ * @description this function enters the value in maximum limit input field
542
+ */
543
+ setMaximumLimit: (maxLimit) => {
544
+ fillInTheGapsOverImageTextPage.maximumCharacterLimitInputField()
545
+ .clear()
546
+ .type(maxLimit)
547
+ .blur();
548
+ },
549
+
550
+ /**
551
+ * @param {number} maxLimit value to be entered in maximum limit input field
552
+ * @description this function verifies the value in maximum limit input field
553
+ */
554
+ verifyMaximumLimit: (maxLimit) => {
555
+ fillInTheGapsOverImageTextPage.maximumCharacterLimitInputField()
556
+ .should('have.value', maxLimit);
557
+
558
+ },
559
+
560
+ /**
561
+ * @param {number} minLimit value to be entered in minimum limit input field
562
+ * @description this function enters and verifies the value in minimum limit input field
563
+ */
564
+ setMinimumLimit: (minLimit) => {
565
+ fillInTheGapsOverImageTextPage.minimumCharacterLimitInputField()
566
+ .clear()
567
+ .type(minLimit)
568
+ .blur();
569
+ },
570
+
571
+ /**
572
+ * @param {number} minLimit value to be entered in minimum limit input field
573
+ * @description this function verifies the value in minimum limit input field
574
+ */
575
+ verifyMinimumLimit: (minLimit) => {
576
+ fillInTheGapsOverImageTextPage.minimumCharacterLimitInputField()
577
+ .should('have.value', minLimit)
578
+ },
579
+
580
+ clearAndFocusOutOfMaximumCharacterLimitInputField: () => {
581
+ fillInTheGapsOverImageTextPage.maximumCharacterLimitInputField()
582
+ .clear()
583
+ .blur();
584
+ },
585
+
586
+ clearAndFocusOutOfMinimumCharacterLimitInputField: () => {
587
+ fillInTheGapsOverImageTextPage.minimumCharacterLimitInputField()
588
+ .clear()
589
+ .blur();
590
+ },
591
+
592
+ verifyMaximumLimitErrorMessage: () => {
593
+ utilities.verifyInnerText(utilities.getNthElement(commonComponents.errorMessage(), 1), 'Error: Maximum limit must be greater than or equal to Minimum limit.');
594
+ utilities.verifyElementVisibilityState(utilities.getNthElement(commonComponents.errorMessage(), 1), 'visible');
595
+ },
596
+
597
+ verifyMinimumLimitErrorMessage: () => {
598
+ utilities.verifyInnerText(utilities.getNthElement(commonComponents.errorMessage(), 0), 'Error: Minimum limit must be less than or equal to Maximum limit.');
599
+ utilities.verifyElementVisibilityState(utilities.getNthElement(commonComponents.errorMessage(), 0), 'visible');
600
+ },
601
+
602
+ /**
603
+ * @param {number} responseIndex index of response container
604
+ * @param {number} maxlen value of maxlength attribute
605
+ * @description function verifies maxlength attribute of response container in preview tab
606
+ */
607
+ verifyMaximumCharacterLimitInPreviewTab: (responseIndex, maxlen) => {
608
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab(), responseIndex)
609
+ .should('have.attr', 'maxlength', maxlen);
610
+ },
611
+
612
+ /**
613
+ * @param {number} responseIndex index of input field in specify correct answer
614
+ * @param {number} maxlen value of maxlength attribute
615
+ * @description function verifies maxlength attribute of input field in specify correct answer
616
+ */
617
+ verifyMaximumCharacterLimit: (responseIndex, maxlen) => {
618
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.answerInputFieldSpecifyCorrectAnswerSection(), responseIndex)
619
+ .should('have.attr', 'maxlength', maxlen);
620
+ },
621
+
622
+ /**
623
+ * @param {number} responseIndex index of response container in preview tab
624
+ * @description function verifies maxlength attribute of input field in preview tab
625
+ */
626
+ verifyMaximumCharacterLimitNotExistInPreviewTab: (responseIndex) => {
627
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab(), responseIndex)
628
+ .should('not.have.attr', 'maxlength');
629
+ },
630
+
631
+ verifyLimitReachedWarningMessageNotExist: () => {
632
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.limitReachedWarningMessage(), 'notExist');
633
+ },
634
+
635
+ /**
636
+ * @description this function verifies warning text for limit reached
637
+ * @param {string} warningText warning message displayed
638
+ */
639
+ verifyLimitReachedWarningMessageExist: (warningText) => {
640
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.limitReachedWarningMessage(), 'visible');
641
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.limitReachedWarningMessage(), warningText);
642
+ },
643
+
644
+ clearResponseField: (responseIndex) => {
645
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab(), responseIndex)
646
+ .clear();
647
+ },
648
+
462
649
  /**
463
650
  * Verify that the spell check for a response field in the Preview Tab is disabled.
464
651
  * @param {number} responseFieldIndex - The index of the response field to verify.
@@ -497,6 +684,79 @@ const steps = {
497
684
  .click();
498
685
  },
499
686
 
687
+ verifyDefaultUncheckedStateOfConditionalCheckboxes: () => {
688
+ fillInTheGapsOverImageTextPage.caseSensitiveCheckbox()
689
+ .should('not.be.checked');
690
+ fillInTheGapsOverImageTextPage.validateIfAnswerIsIncludedCheckbox()
691
+ .should('not.be.checked');
692
+ fillInTheGapsOverImageTextPage.ignoreExtraSpacesCheckbox()
693
+ .should('not.be.checked');
694
+ fillInTheGapsOverImageTextPage.ignoreSingleLetterMistakeCheckbox()
695
+ .should('not.be.checked');
696
+ },
697
+
698
+ /**
699
+ * Check the conditional checkbox in edit tab
700
+ * @param {string} conditionalCheckboxName Name of the conditional checkbox to be checked
701
+ */
702
+ checkConditionalCheckbox: (conditionalCheckboxName) => {
703
+ switch (conditionalCheckboxName) {
704
+ case 'Case sensitive':
705
+ fillInTheGapsOverImageTextPage.caseSensitiveCheckbox()
706
+ .click()
707
+ .should('be.checked');
708
+ break;
709
+ case 'Validate if answer is included in the response':
710
+ fillInTheGapsOverImageTextPage.validateIfAnswerIsIncludedCheckbox()
711
+ .click()
712
+ .should('be.checked');
713
+ break;
714
+ case 'Ignore extra spaces':
715
+ fillInTheGapsOverImageTextPage.ignoreExtraSpacesCheckbox()
716
+ .click()
717
+ .should('be.checked');
718
+ break;
719
+ case 'Ignore single letter mistake':
720
+ fillInTheGapsOverImageTextPage.ignoreSingleLetterMistakeCheckbox()
721
+ .click()
722
+ .should('be.checked');
723
+ break;
724
+ default:
725
+ throw new Error('invalid state string');
726
+ }
727
+ },
728
+
729
+ /**
730
+ * Uncheck the conditional checkbox in edit tab
731
+ * @param {string} conditionalCheckboxName Name of the conditional checkbox to be unchecked
732
+ */
733
+ uncheckConditionalCheckbox: (conditionalCheckboxName) => {
734
+ switch (conditionalCheckboxName) {
735
+ case 'Case sensitive':
736
+ fillInTheGapsOverImageTextPage.caseSensitiveCheckbox()
737
+ .click()
738
+ .should('not.be.checked');
739
+ break;
740
+ case 'Validate if answer is included in the response':
741
+ fillInTheGapsOverImageTextPage.validateIfAnswerIsIncludedCheckbox()
742
+ .click()
743
+ .should('not.be.checked');
744
+ break;
745
+ case 'Ignore extra spaces':
746
+ fillInTheGapsOverImageTextPage.ignoreExtraSpacesCheckbox()
747
+ .click()
748
+ .should('not.be.checked');
749
+ break;
750
+ case 'Ignore single letter mistake':
751
+ fillInTheGapsOverImageTextPage.ignoreSingleLetterMistakeCheckbox()
752
+ .click()
753
+ .should('not.be.checked');
754
+ break;
755
+ default:
756
+ throw new Error('invalid state string');
757
+ }
758
+ },
759
+
500
760
  /**
501
761
  * Verify answer input field placeholder text
502
762
  * @param {number} answerFieldIndex index of answer input field
@@ -509,11 +769,11 @@ const steps = {
509
769
  });
510
770
  },
511
771
 
512
- /**
513
- * Clear answer input field
514
- * @param {number} answerFieldIndex index of answer input field
515
- */
516
- clearAnswerInputField: (answerFieldIndex) => {
772
+ /**
773
+ * Clear answer input field
774
+ * @param {number} answerFieldIndex index of answer input field
775
+ */
776
+ clearAnswerInputField: (answerFieldIndex) => {
517
777
  utilities.getNthElement(fillInTheGapsOverImageTextPage.responseAccordionAnswerInputFieldWrapper(), answerFieldIndex)
518
778
  .within(() => {
519
779
  fillInTheGapsOverImageTextPage.answerInputFieldSpecifyCorrectAnswerSection()
@@ -528,6 +788,8 @@ const tests = {
528
788
  ...autoScoredSpecifyCorrectAnswerSection.tests,
529
789
  ...scoringSectionBaseEditTab.tests,
530
790
  ...autoScoredScoringSectionMultiResponseType.tests,
791
+ ...createQuestionBasePage.tests,
792
+ ...commonComponents.tests,
531
793
  ...autoScoredStudentViewSettings.tests,
532
794
 
533
795
  /**
@@ -17,11 +17,13 @@ const selectors = {
17
17
  opacityLabel: () => cy.get('#input-slider'),
18
18
  opacityInputField: () => cy.get('.line-reader-opacity input'),
19
19
  opacitySlider: () => cy.get('.MuiSlider-root'),
20
- colorLabel: () => cy.get('[class*="LineReaderstyles__PropertyLabel"]').eq(1),
21
- colorBlock: () => cy.get('.MuiFormGroup-root .MuiRadio-root'),
22
- colorBlockLabel: () => cy.get('.MuiFormControl-root .MuiFormControlLabel-root .MuiTypography-root'),
23
- defaultNumberOfLinesLabel: () => cy.get('[class*="LineReaderstyles__PropertyLabel"]').eq(2),
20
+ colorLabel: () => cy.get('[class*="LineReaderstyles__PropertyLabel"]').eq(2),
21
+ colorBlock: () => cy.get('.MuiFormControlLabel-labelPlacementBottom .MuiRadio-root'),
22
+ colorBlockLabel: () => cy.get('[aria-label="color"] .MuiFormControlLabel-label'),
23
+ defaultNumberOfLinesLabel: () => cy.get('[class*="LineReaderstyles__PropertyLabel"]').eq(3),
24
24
  defaultNumberOfLinesInputField: () => cy.get('input[aria-label="Default number of lines"]'),
25
+ rulerStyleButton: () => cy.get('[class*="LineReaderstyles__RulerStyleButton"]'),
26
+ rulerStyleButtonLabel: () => cy.get('[class*="LineReaderstyles__ButtonLabel"]'),
25
27
  //Preview Tab
26
28
  readingRulerButton: () => cy.get('.LineReaderButton'),
27
29
  readingRuler: () => cy.get('.resizable'),
@@ -49,6 +51,42 @@ const steps = {
49
51
  .should('be.checked');
50
52
  },
51
53
 
54
+ /**
55
+ * @param {("Line focus"|"Overlay mask"|"Drag handle")} styleName name of ruler style
56
+ * @description function selects ruler style
57
+ */
58
+ selectRulerStyle: (styleName) => {
59
+ let style;
60
+ switch (styleName) {
61
+ case 'Line focus':
62
+ style = '.line-focus';
63
+ break;
64
+ case 'Overlay mask':
65
+ style = '.overlay-mask';
66
+ break;
67
+ case 'Darg handle':
68
+ style = '.drag-handle';
69
+ break;
70
+ default:
71
+ throw new Error(`Unknown ruler style: ${styleName}`);
72
+ }
73
+
74
+ readingRulerPage.rulerStyleButton()
75
+ .find(style)
76
+ .click()
77
+ .find('.MuiIconButton-label svg')
78
+ .should('exist');
79
+ },
80
+
81
+ /**
82
+ * @param {number} index index of ruler style
83
+ * @param {("Line focus"|"Overlay mask"|"Drag handle")} styleName name of ruler style
84
+ * @description function verifies ruler style button label
85
+ */
86
+ verifyRulerStyleButtonLabel: (index, styleName) => {
87
+ utilities.verifyInnerText(utilities.getNthElement(readingRulerPage.rulerStyleButtonLabel(), index), styleName);
88
+ },
89
+
52
90
  verifyVisibleOnLandingCheckboxIsUnchecked: () => {
53
91
  readingRulerPage.visibleOnLandingCheckbox()
54
92
  .should('not.be.checked');
@@ -230,8 +268,24 @@ const steps = {
230
268
  * @description this function verifies color of the ruler displayed in the preview tab
231
269
  */
232
270
  verifyReadingRulerColorInPreviewTab: (colorValue) => {
271
+ const fillColor = () => {
272
+ switch (colorValue) {
273
+ case 0:
274
+ return '#707070';
275
+ case 1:
276
+ return '#1A1A1A';
277
+ case 2:
278
+ return '#008699';
279
+ case 3:
280
+ return '#009f6A';
281
+ case 4:
282
+ return '#991D00';
283
+ default:
284
+ return 'incorrect colorIndex';
285
+ }
286
+ };
233
287
  readingRulerPage.rulerColor()
234
- .should('have.attr', 'color', colorValue)
288
+ .should('have.attr', 'color', fillColor());
235
289
  },
236
290
 
237
291
  /**
@@ -245,6 +299,11 @@ const steps = {
245
299
  .should('have.attr', 'size', sizeValue)
246
300
  },
247
301
 
302
+ verifyReadingRulerExistInPreviewTab: () => {
303
+ readingRulerPage.readingRuler()
304
+ .should('be.visible');
305
+ },
306
+
248
307
  //additional settings
249
308
  addTextToTeacherGuidelinesInputField: () => {
250
309
  readingRulerPage.additionalSettingsTeacherGuidelinesInputField()