itemengine-cypress-automation 1.0.585-IEI-7055-cypress-9249eaa.0 → 1.0.586-IEI-7161-main-9f0d20f.0

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.
@@ -1,4 +1,4 @@
1
- import { commonComponents, questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, additionalSettingsPanel, autoScoredScoringPreviewTab, studentViewSettingsLabelComponent, additionalSettingsAccessibilitySectionComponent, autoScoredStudentViewSettings } from "./components";
1
+ import { commonComponents, questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, additionalSettingsPanel, autoScoredScoringPreviewTab, studentViewSettingsLabelComponent, additionalSettingsAccessibilitySectionComponent, autoScoredStudentViewSettings, printPreviewComponent } from "./components";
2
2
  import { createItemPage, dialogBoxBase } from ".";
3
3
  import utilities from "../support/helpers/utilities";
4
4
  import { supportedFileType } from "../fixtures/uploadResponseFileType";
@@ -15,6 +15,7 @@ const selectors = {
15
15
  ...questionInstructionsComponent,
16
16
  ...commonComponents,
17
17
  ...dialogBoxBase,
18
+ ...printPreviewComponent,
18
19
 
19
20
  maximumNumberOfFilesInputField: () => cy.get('.input-stepper-textfield'),
20
21
  maximumNumberOfFilesLabel: () => cy.get('.input-stepper-label'),
@@ -73,10 +74,11 @@ const selectors = {
73
74
  inputTypeFile: () => cy.get('input[type="file"]'),
74
75
  uploadedFilesSectionWrapper: () => cy.get('.uploaded-document-wrapper'),
75
76
  uploadedFileWrapper: () => cy.get('.uploaded-document'),
76
- editDisplayTextIcon: () => cy.get('.icon-pencil'),
77
+ editDisplayTextIcon: () => cy.get('[class*="UploadedDocumentsstyle__DocumentEditIconWrapper"]'),
77
78
  fileName: () => cy.get('.studentResponse'),
78
- addFileDescriptionInput: () => cy.get('[placeholder="Add file description"]'),
79
+ addFileDescriptionInput: () => cy.get('.uploaded-documents-file-description-input input'),
79
80
  addFileDescriptionIcon: () => cy.get('.icon-File-description'),
81
+ addFileDescriptionLabel: () => cy.get('[class*="UploadedDocumentsstyle__FileDescriptionLabel"]'),
80
82
  scanningForVirusPreLoader: () => cy.get('[alt="loader"]'),
81
83
  virusErrorMessageWrapper: () => cy.get('.FileUploadStatementLarge'),
82
84
  uploadedFileLink: () => cy.get('img[src*="/files/document?key=freeResponse/"]'),
@@ -99,6 +101,25 @@ const selectors = {
99
101
  downloadIconOfPopUp: () => cy.get('.download-icon'),
100
102
  downloadTextOfPopUp: () => cy.get('[class*="UploadedDocumentsstyle__DownloadTextWrapper"]'),
101
103
  closePopUpButton: () => cy.get('.close-popup-btn'),
104
+
105
+ //Print layout settings additional content selectors
106
+ displayLinesForTheResponseLabel: () => cy.get('label[aria-label*="Display lines for the response"]'),
107
+ displayLinesForTheResponseCheckbox: () => cy.get('input[aria-label*="Display lines for the response"]'),
108
+ numberOfLinesInputField: () => cy.get('[aria-labelledby*="number-of-lines"]'),
109
+ numberOfLinesLabel: () => cy.get('.number-of-lines-label'),
110
+ lineSpacingLabel: () => cy.get('[id="Line-Spacing-dropdown-label"]'),
111
+ lineSpacingDropdown: () => cy.get('.print-layout-settings-detail-wrapper [aria-label*="Line Spacing"]'),
112
+ lineSpacingDropdownListOptions: (ariaLabel = null) => {
113
+ if (ariaLabel) {
114
+ return cy.get(`[aria-labelledby*="Line-Spacing-dropdown-label Line-Spacing-placeholder"] [role="option"][aria-label*="${ariaLabel}"]`)
115
+ } else {
116
+ return cy.get('[aria-labelledby*="Line-Spacing-dropdown-label Line-Spacing-placeholder"] [role="option"]')
117
+ }
118
+ },
119
+ numberOfLinesInPrintView: () => cy.get('[class*="UploadResponsePrintPreviewstyles__Line"]'),
120
+ uploadedFileButton: () => cy.get('[class*="UploadedDocumentsstyle__UploadedDocumentNameContainer"] button'),
121
+ uploadedFileDownloadButton: () => cy.get('[class*="UploadedDocumentsstyle__DownloadTextWrapper"]'),
122
+ uploadedFileDownloadLinkText: () => cy.get('[class*="DocumentNameWrapper studentResponse"]'),
102
123
  }
103
124
 
104
125
  const steps = {
@@ -109,7 +130,7 @@ const steps = {
109
130
  ...commonComponents.steps,
110
131
  ...autoScoredScoringPreviewTab.steps,
111
132
  ...createItemPage.steps,
112
-
133
+ ...printPreviewComponent.steps,
113
134
  /**
114
135
  * @param {number} maxValue value of maximum number of files
115
136
  * @description function enters value in maximum number of files input field
@@ -655,7 +676,82 @@ const steps = {
655
676
  utilities.verifyElementVisibilityState(uploadResponsePage.cancelButton(), 'visible');
656
677
  utilities.verifyInnerText(uploadResponsePage.acceptButton(), 'Capture');
657
678
  utilities.verifyElementVisibilityState(uploadResponsePage.acceptButton(), 'visible');
658
- }
679
+ },
680
+
681
+ verifyDisplayLinesForTheResponseCheckboxUnchecked: () => {
682
+ uploadResponsePage.displayLinesForTheResponseCheckbox()
683
+ .should('not.be.checked');
684
+ },
685
+
686
+ verifyDisplayLinesForTheResponseCheckboxChecked: () => {
687
+ uploadResponsePage.displayLinesForTheResponseCheckbox()
688
+ .should('be.checked');
689
+ },
690
+
691
+ checkDisplayLinesForTheResponseCheckbox: () => {
692
+ uploadResponsePage.displayLinesForTheResponseCheckbox()
693
+ .click()
694
+ steps.verifyDisplayLinesForTheResponseCheckboxChecked();
695
+ },
696
+
697
+ uncheckDisplayLinesForTheResponseCheckbox: () => {
698
+ uploadResponsePage.displayLinesForTheResponseCheckbox()
699
+ .click();
700
+ steps.verifyDisplayLinesForTheResponseCheckboxUnchecked();
701
+ },
702
+
703
+ expandLineSpacingDropdown: () => {
704
+ uploadResponsePage.lineSpacingDropdown()
705
+ .click();
706
+ },
707
+
708
+ /**
709
+ * @description this function is select option from line spacing dropdown
710
+ * @param {number} option is to be selected from the dropdown
711
+ */
712
+ selectLineSpacingDropdownOption: (option) => {
713
+ uploadResponsePage.lineSpacingDropdownListOptions(option)
714
+ .click();
715
+ utilities.verifyInnerText(uploadResponsePage.lineSpacingDropdown(), option);
716
+ },
717
+
718
+ /**
719
+ * @description this function is to add value in number of lines input field
720
+ * @param {number} value need to add in the input field
721
+ */
722
+ addValueInNumberOfLinesInputField: (value) => {
723
+ uploadResponsePage.numberOfLinesInputField()
724
+ .clear()
725
+ .type(value)
726
+ .should('have.value', value);
727
+ },
728
+
729
+ /**
730
+ * @description this function verifies the number of lines and their height in the print view
731
+ * @param {number} expectedLines number of lines in the print view
732
+ * @param {number} expectedLineHeight height of each line in the print view
733
+ */
734
+ verifyNumberOfLinesInPrintView: (expectedLines, expectedLineHeight) => {
735
+ uploadResponsePage.numberOfLinesInPrintView()
736
+ .should('have.length', expectedLines)
737
+ .each(($line) => {
738
+ cy.wrap($line).should('have.css', 'height', expectedLineHeight);
739
+ });
740
+ },
741
+
742
+ /**
743
+ * @description this function verifies the downloaded filename
744
+ * @param {string} fileName for the uploaded file
745
+ * @param {number} index of the file type option to be click
746
+ */
747
+ verifyDownloadedFilename: (fileName, index) => {
748
+ uploadResponsePage.uploadedFileButton()
749
+ .eq(index)
750
+ .click();
751
+ uploadResponsePage.uploadedFileDownloadButton()
752
+ .click();
753
+ cy.verifyDownload(fileName);
754
+ },
659
755
  }
660
756
 
661
757
  const tests = {
@@ -668,6 +764,7 @@ const tests = {
668
764
  ...additionalSettingsAccessibilitySectionComponent.tests,
669
765
  ...studentViewSettingsLabelComponent.tests,
670
766
  ...autoScoredStudentViewSettings.tests,
767
+ ...printPreviewComponent.tests,
671
768
  verifyWarningMessageDisappear: () => {
672
769
  it('The error message should disappear if the user clicks anywhere in the upload file content wrapper', () => {
673
770
  uploadResponsePage.inputTypeFile()
@@ -676,7 +773,69 @@ const tests = {
676
773
  uploadResponsePage.warningMessage()
677
774
  .should('not.exist');
678
775
  });
679
- }
776
+ },
777
+
778
+ verifyPrintLayoutSettingsAccordionAdditionalContent: () => {
779
+ const lineSpacingDropdownOptions = ['Single', 'Double'];
780
+ it('\'Display lines for the response\' label should be displayed', () => {
781
+ utilities.verifyInnerText(uploadResponsePage.displayLinesForTheResponseLabel(), 'Display lines for the response');
782
+ utilities.verifyElementVisibilityState(uploadResponsePage.displayLinesForTheResponseLabel(), 'visible');
783
+ });
784
+
785
+ it('Display lines for the response checkbox should be displayed and by default unchecked', () => {
786
+ utilities.verifyElementVisibilityState(uploadResponsePage.displayLinesForTheResponseCheckbox(), 'exist');
787
+ steps.verifyDisplayLinesForTheResponseCheckboxUnchecked();
788
+ });
789
+
790
+ it('CSS of \'Display lines for the response\' section', { tags: 'css' }, () => {
791
+ utilities.verifyCSS(uploadResponsePage.displayLinesForTheResponseLabel(), {
792
+ 'color': css.color.labelText,
793
+ 'font-size': css.fontSize.normal,
794
+ 'font-weight': css.fontWeight.regular
795
+ });
796
+ });
797
+
798
+ it('Accessibility of \'Display lines for the response\' section', { tags: 'a11y' }, () => {
799
+ cy.checkAccessibility(uploadResponsePage.displayLinesForTheResponseLabel().parents('.print-layout-settings-container'));
800
+ });
801
+
802
+ it('User should be able to check and uncheck the \'Display lines for the response\' checkbox', () => {
803
+ steps.checkDisplayLinesForTheResponseCheckbox();
804
+ steps.uncheckDisplayLinesForTheResponseCheckbox();
805
+ });
806
+
807
+ it('Number of lines label and input field should be displayed when \'Display lines for the response\' checkbox is checked', () => {
808
+ steps.checkDisplayLinesForTheResponseCheckbox();
809
+ utilities.verifyInnerText(uploadResponsePage.numberOfLinesLabel(), 'Number of lines');
810
+ utilities.verifyElementVisibilityState(uploadResponsePage.numberOfLinesLabel(), 'visible');
811
+ utilities.verifyElementVisibilityState(uploadResponsePage.numberOfLinesInputField(), 'exist');
812
+ });
813
+
814
+ it('User should be able to enter value in Number of lines input field', () => {
815
+ uploadResponsePage.steps.addValueInNumberOfLinesInputField('5');
816
+ });
817
+
818
+ it(`\'Line Spacing\' label should be displayed and \'Line Spacing\' dropdown should be displayed and in \'Line Spacing\' dropdown \'${lineSpacingDropdownOptions[0]}\' option should be selected by default`, () => {
819
+ utilities.verifyInnerText(uploadResponsePage.lineSpacingLabel(), 'Line spacing');
820
+ utilities.verifyElementVisibilityState(uploadResponsePage.lineSpacingDropdown(), 'visible');
821
+ utilities.verifyInnerText(uploadResponsePage.lineSpacingDropdown(), lineSpacingDropdownOptions[0]);
822
+ });
823
+
824
+ it(`\'Line Spacing\' dropdown should have the following options: ${lineSpacingDropdownOptions.join(', ')}`, () => {
825
+ steps.expandLineSpacingDropdown()
826
+ lineSpacingDropdownOptions.forEach((option, count) => {
827
+ utilities.verifyInnerText(uploadResponsePage.lineSpacingDropdownListOptions().eq(count), option)
828
+ });
829
+ uploadResponsePage.steps.selectLineSpacingDropdownOption('Double')
830
+ });
831
+
832
+ it('User should be able to select options from Line Spacing dropdown', () => {
833
+ lineSpacingDropdownOptions.forEach((option) => {
834
+ uploadResponsePage.steps.expandLineSpacingDropdown();
835
+ uploadResponsePage.steps.selectLineSpacingDropdownOption(option)
836
+ });
837
+ });
838
+ },
680
839
  }
681
840
 
682
841
  export const uploadResponsePage = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.585-IEI-7055-cypress-9249eaa.0",
3
+ "version": "1.0.586-IEI-7161-main-9f0d20f.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {