itemengine-cypress-automation 1.0.68 → 1.0.69

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/cypress/fixtures/theme/ilc.json +2 -1
  2. package/cypress/pages/audioPlayerPage.js +2 -2
  3. package/cypress/pages/components/additionalSettingsPanel.js +46 -14
  4. package/cypress/pages/components/autoScoredAdditionalSettings.js +6 -6
  5. package/cypress/pages/components/autoScoredPreviewBase.js +6 -8
  6. package/cypress/pages/components/autoScoredScoringSection.js +22 -18
  7. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +60 -9
  8. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +7 -7
  9. package/cypress/pages/components/createQuestionBasePage.js +8 -2
  10. package/cypress/pages/components/draggableOptionsContainer.js +2 -1
  11. package/cypress/pages/components/equationEditorFlyout.js +2 -1
  12. package/cypress/pages/components/essayResponseCommonComponents.js +10 -4
  13. package/cypress/pages/components/figOverImageCommonComponent.js +2 -1
  14. package/cypress/pages/components/fillInTheGapsCommonComponents.js +34 -14
  15. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -1
  16. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +7 -7
  17. package/cypress/pages/components/listSortingAndOrderingBase.js +1 -1
  18. package/cypress/pages/components/mcqAdditionalSettingsBase.js +10 -0
  19. package/cypress/pages/components/mcqQuestionCommonComponents.js +1 -1
  20. package/cypress/pages/components/mcqScoringComponent.js +1 -1
  21. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +20 -18
  22. package/cypress/pages/components/questionInstructionsComponent.js +1 -1
  23. package/cypress/pages/components/scoringSectionBase.js +30 -1
  24. package/cypress/pages/components/setPointsPopupBase.js +2 -1
  25. package/cypress/pages/components/uploadImageSectionComponent.js +8 -8
  26. package/cypress/pages/createItemPage.js +83 -1
  27. package/cypress/pages/dialogBoxBase.js +3 -7
  28. package/cypress/pages/dragAndDropIntoCategoriesPage.js +5 -4
  29. package/cypress/pages/essayResponsePage.js +1 -0
  30. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -0
  31. package/cypress/pages/fillInTheGapsScoring.js +215 -317
  32. package/cypress/pages/highlightImagePage.js +6 -4
  33. package/cypress/pages/highlightPage.js +1 -2
  34. package/cypress/pages/index.js +4 -0
  35. package/cypress/pages/listMatchingPage.js +5 -4
  36. package/cypress/pages/listMatchingScoring.js +274 -272
  37. package/cypress/pages/listOrderingPage.js +23 -14
  38. package/cypress/pages/listSortingPage.js +7 -9
  39. package/cypress/pages/multipleSelectionPage.js +2 -1
  40. package/cypress/pages/shortTextResponsePage.js +9 -0
  41. package/cypress/pages/singleSelectionPage.js +1 -0
  42. package/cypress/pages/uploadResponsePage.js +296 -15
  43. package/cypress/pages/videoResponsePage.js +5 -6
  44. package/package.json +1 -1
@@ -388,14 +388,12 @@ const steps = {
388
388
 
389
389
  verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked: () => {
390
390
  cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state');
391
- previewScoringAndShowCorrectAnswerComponent.showCorrectAnswerCheckbox()
392
- .click()
393
- .should('not.be.checked');
391
+ previewScoringAndShowCorrectAnswerComponent.steps.uncheckShowCorrectAnswerCheckbox();
394
392
  autoScoredPreviewBase.correctIcon()
395
393
  .should('not.exist');
396
394
  autoScoredPreviewBase.incorrectIcon()
397
395
  .should('not.exist');
398
- autoScoredPreviewBase.correctIncorectAnswerLabel()
396
+ autoScoredPreviewBase.correctIncorrectAnswerLabel()
399
397
  .should('not.exist');
400
398
  autoScoredPreviewBase.steps.verifyCorrectIncorrectBorderNotVisible()
401
399
  },
@@ -557,7 +555,7 @@ const steps = {
557
555
  },
558
556
 
559
557
  verifyCorrectIncorrectAnswerLabel: (labelText) => {
560
- autoScoredPreviewBase.correctIncorectAnswerLabel()
558
+ autoScoredPreviewBase.correctIncorrectAnswerLabel()
561
559
  .should('be.visible')
562
560
  .verifyInnerText(`${labelText} answer`)
563
561
  .parents('[class*="__AnswerStatusWrapper"]')
@@ -597,10 +595,14 @@ const tests = {
597
595
  it('When user has provided minimum score awarded (if attempted) points, then in Preview tab on entering incorrect answer, minimum score should be provided for the question', () => {
598
596
  cy.log('Switch to edit tab and set minimum score if attempted points')
599
597
  createQuestionBasePage.steps.switchToEditTab();
598
+ scoringSectionBase.steps.expandMinimumScoringDropdown();
599
+ scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
600
600
  scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted('1')
601
601
  createQuestionBasePage.steps.switchToPreviewTab()
602
- listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 1);
603
- listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['sprout', 'plant', 'flower', 'seed']);
602
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 0);
603
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 1);
604
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 2);
605
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['plant', 'seed', 'flower', 'sprout']);
604
606
  listOrderingPage.previewScoreText()
605
607
  .verifyInnerText(`1/${totalPoints}`);
606
608
  });
@@ -610,8 +612,10 @@ const tests = {
610
612
  createQuestionBasePage.steps.switchToEditTab();
611
613
  scoringSectionBase.steps.clearMinimumScoreIfAttemptedPointsField();
612
614
  createQuestionBasePage.steps.switchToPreviewTab()
613
- listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 1);
614
- listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['sprout', 'plant', 'flower', 'seed']);
615
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 0);
616
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 1);
617
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 2);
618
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['plant', 'seed', 'flower', 'sprout']);
615
619
  listOrderingPage.previewScoreText()
616
620
  .verifyInnerText(`0/${totalPoints}`);
617
621
  });
@@ -637,8 +641,9 @@ const tests = {
637
641
  .verifyInnerText(`0/${totalPoints}`);
638
642
 
639
643
  cy.log('When user adds a partially correct answer input, the points should be updated accordingly with deducted penalty points');
640
- listOrderingPage.steps.resetQuestionPreview(['plant', 'sprout', 'flower', 'seed'])
644
+ listOrderingPage.steps.resetQuestionPreview(['sprout', 'plant', 'flower', 'seed'])
641
645
  listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
646
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 1);
642
647
  listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'plant', 'sprout', 'flower']);
643
648
  listOrderingPage.previewScoreText()
644
649
  .verifyInnerText(`${scoredPoints}/${totalPoints}`);
@@ -692,14 +697,16 @@ const tests = {
692
697
 
693
698
  cy.log('Switch to preview tab and give incorrect answer input to check that minimum points are displayed');
694
699
  createQuestionBasePage.steps.switchToPreviewTab();
695
- listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 1);
696
- listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['sprout', 'plant', 'flower', 'seed']);
700
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 0);
701
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 3);
702
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['flower', 'plant', 'seed', 'sprout']);
697
703
  listOrderingPage.previewScoreText()
698
704
  .verifyInnerText(`${scoredPointsArray[0]}/${totalPoints}`);
699
705
 
700
706
  cy.log('When user adds a partially correct answer such that the points of the attempt(with penalty points deducted) is more than the minimum score awarded(if attempted) points');
701
- listOrderingPage.steps.resetQuestionPreview(['plant', 'sprout', 'flower', 'seed']);
707
+ listOrderingPage.steps.resetQuestionPreview(['sprout', 'plant', 'flower', 'seed']);
702
708
  listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
709
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 1);
703
710
  listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'plant', 'sprout', 'flower']);
704
711
  listOrderingPage.previewScoreText()
705
712
  .verifyInnerText(`${scoredPointsArray[1]}/${totalPoints}`);
@@ -711,7 +718,9 @@ const tests = {
711
718
  cy.log('Switching to preview tab');
712
719
  createQuestionBasePage.steps.switchToPreviewTab();
713
720
  listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
714
- listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'plant', 'sprout', 'flower']);
721
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 1);
722
+ listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 2);
723
+ listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'plant', 'flower', 'sprout']);
715
724
  listOrderingPage.previewScoreText()
716
725
  .verifyInnerText(`${scoredPointsArray[2]}/${totalPoints}`);
717
726
  });
@@ -913,7 +913,7 @@ const steps = {
913
913
  * @description this function verifies the border label and icon
914
914
  */
915
915
  verifyCorrectIncorrectAnswerLabel: (labelText) => {
916
- autoScoredPreviewBase.correctIncorectAnswerLabel()
916
+ autoScoredPreviewBase.correctIncorrectAnswerLabel()
917
917
  .should('be.visible')
918
918
  .verifyInnerText(`${labelText} answer`)
919
919
  .parents('[class*="__AnswerStatusWrapper"]')
@@ -1002,6 +1002,8 @@ const tests = {
1002
1002
  it('When user has provided minimum score awarded (if attempted) points, then in Preview tab on entering incorrect answer, minimum score should be provided for the question', () => {
1003
1003
  cy.log('Switch to edit tab and set minimum score if attempted points')
1004
1004
  createQuestionBasePage.steps.switchToEditTab();
1005
+ scoringSectionBase.steps.expandMinimumScoringDropdown();
1006
+ scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted')
1005
1007
  scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted('1')
1006
1008
  createQuestionBasePage.steps.switchToPreviewTab()
1007
1009
  listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 0);
@@ -1157,14 +1159,12 @@ const tests = {
1157
1159
  it('CSS of incorrect answer state', { tags: 'css' }, () => {
1158
1160
  cy.log('Pre requisite: The user has attempted the question incorrectly')
1159
1161
  cy.log('Pre step: Select show answer checkbox')
1160
- previewScoringAndShowCorrectAnswerComponent.showCorrectAnswerCheckbox()
1161
- .click()
1162
- .should('be.checked');
1162
+ previewScoringAndShowCorrectAnswerComponent.steps.checkShowCorrectAnswerCheckbox();
1163
1163
  cy.log('Verifying CSS of incorrect crossmark icon')
1164
1164
  autoScoredPreviewBase.incorrectIcon()
1165
1165
  .eq(0)
1166
1166
  .verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
1167
- autoScoredPreviewBase.correctIncorectAnswerLabel()
1167
+ autoScoredPreviewBase.correctIncorrectAnswerLabel()
1168
1168
  .verifyCSS(css.color.incorrectAnswer, css.fontSize.normal, css.fontWeight.bold)
1169
1169
  autoScoredPreviewBase.steps.verifyIncorrectAttemptBorder();
1170
1170
  });
@@ -1172,9 +1172,7 @@ const tests = {
1172
1172
  it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
1173
1173
  cy.checkAccessibility(commonComponents.previewTabQuestionWrapper());
1174
1174
  cy.log('Post step: Deselect show answer checkbox')
1175
- previewScoringAndShowCorrectAnswerComponent.showCorrectAnswerCheckbox()
1176
- .click()
1177
- .should('not.be.checked');
1175
+ previewScoringAndShowCorrectAnswerComponent.steps.uncheckShowCorrectAnswerCheckbox();
1178
1176
  });
1179
1177
  },
1180
1178
 
@@ -1183,7 +1181,7 @@ const tests = {
1183
1181
  previewScoringAndShowCorrectAnswerComponent.previewScoreText()
1184
1182
  .should('have.css', 'color', css.color.primaryBtn)
1185
1183
  .and('have.css', 'background-color', css.color.correctAnswer)
1186
- autoScoredPreviewBase.correctIncorectAnswerLabel()
1184
+ autoScoredPreviewBase.correctIncorrectAnswerLabel()
1187
1185
  .verifyCSS(css.color.correctAnswer, css.fontSize.normal, css.fontWeight.bold);
1188
1186
  autoScoredPreviewBase.steps.verifyCorrectAttemptBorder();
1189
1187
  });
@@ -38,6 +38,7 @@ const steps = {
38
38
  ...autoScoredSetCorrectAnswerSection.steps,
39
39
  ...autoScoredScoringSection.steps,
40
40
  ...autoScoredScoringSectionMultipleResponsesType.steps,
41
+ ...mcqAdditionalSettingsBase.steps,
41
42
  addPartialDifferentWeightsPoints: (optionIndex, points) => {
42
43
  mcqSetCorrectAnswerSection.correctAnswerOptionsWrapper(optionIndex)
43
44
  .within(() => {
@@ -59,7 +60,7 @@ const steps = {
59
60
  .should('not.exist');
60
61
  autoScoredPreviewBase.incorrectIcon()
61
62
  .should('not.exist');
62
- autoScoredPreviewBase.correctIncorectAnswerLabel()
63
+ autoScoredPreviewBase.correctIncorrectAnswerLabel()
63
64
  .should('not.exist');
64
65
  autoScoredPreviewBase.steps.verifyCorrectIncorrectBorderNotExists();
65
66
  },
@@ -54,6 +54,7 @@ const steps = {
54
54
  ...autoScoredAdditionalSettings.steps,
55
55
  ...autoScoredPreviewBase.steps,
56
56
  ...specialCharactersFlyoutComponent.steps,
57
+ ...previewScoringAndShowCorrectAnswerComponent.steps,
57
58
  verifyCorrectOptionCheckmarkIcon: () => {
58
59
  autoScoredPreviewBase.correctIcon()
59
60
  .should('be.visible');
@@ -71,6 +72,12 @@ const steps = {
71
72
  .verifyInnerText(correctAnswer)
72
73
  shortTextResponsePage.previewTabCorrectAnswerResponse()
73
74
  .should('have.length', 1);
75
+ },
76
+
77
+ enterTextInShortTextResponseInputField: (correctAnswer) => {
78
+ shortTextResponsePage.setCorrectAnswerResponseField()
79
+ .type(correctAnswer)
80
+ .should('have.value', correctAnswer);
74
81
  }
75
82
  }
76
83
 
@@ -175,6 +182,8 @@ const tests = {
175
182
  it('When user has provided minimum score awarded (if attempted) points, then in Preview tab on entering incorrect answer, minimum score should be provided for the question', () => {
176
183
  cy.log('Switch to edit tab and set minimum score if attempted points')
177
184
  createQuestionBasePage.steps.switchToEditTab();
185
+ scoringSectionBase.steps.expandMinimumScoringDropdown();
186
+ scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
178
187
  scoringSectionBase.minimumScoreIfAttemptedInputField()
179
188
  .type('1')
180
189
  .should('have.value', '1');
@@ -32,6 +32,7 @@ const steps = {
32
32
  ...mcqPreviewComponents.steps,
33
33
  ...autoScoredSetCorrectAnswerSection.steps,
34
34
  ...autoScoredScoringSection.steps,
35
+ ...mcqAdditionalSettingsBase.steps,
35
36
  checkCorrectAnswerRadioButton: (option) => {
36
37
  mcqSetCorrectAnswerSection.correctAnswerOptionsWrapper(option)
37
38
  .click()
@@ -1,18 +1,26 @@
1
1
  import { commonComponents, questionInstructionsComponent, scoringSectionBase, createQuestionBasePage, additionalSettingsPanel, previewScoringAndShowCorrectAnswerComponent } from "./components";
2
2
  import { dialogBoxBase } from ".";
3
+ import utilities from "../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ let indexOfDefaultSelectedFileTypes = [4, 5, 6, 11, 17, 18, 19, 20, 22, 24, 27, 28, 29];
7
+ let fileTypeList = ['Access', 'Assembly', 'C', 'C++', 'CSV', 'Excel', 'GIF', 'H', 'HEIC', 'HEIF', 'HEVC', 'JPG', 'LabVIEW', 'MATLAB', 'MP3', 'MP4', 'Open Office', 'PDF', 'PNG', 'Powerpoint', 'Publisher', 'Quartus', 'RTF', 'S', 'TXT', 'V', 'Verilog', 'Word', 'XPS', 'ZIP'];
3
8
 
4
9
  const selectors = {
5
10
  ...dialogBoxBase,
6
11
  ...scoringSectionBase,
7
12
  ...createQuestionBasePage,
8
13
  ...additionalSettingsPanel,
14
+ ...commonComponents.steps,
9
15
  ...questionInstructionsComponent,
16
+ ...commonComponents,
10
17
  //Supported file accordion
11
18
  supportedFileTypesAccordion: () => cy.get('.freeresponse-accordian-label'),
12
19
  selectedFileTypeCount: () => cy.get('.supported-file-types-count'),
13
20
  supportedFileTypeCheckbox: () => cy.get('.ngie-checkbox input'),
14
21
  supportedFileTypesAccordionWrapper: () => cy.get('.edit-question-edit-tab-wrapper .ngie-accordion-summary'),
15
22
  supportedFileTypesCheckboxWrapper: (fileTypeNumber) => cy.get('.edit-question-supported-files-wrapper .ngie-checkbox-control-label').eq(fileTypeNumber),
23
+ supportedFileTypesCheckboxLabel: (fileTypeNumber) => cy.get('.edit-question-supported-files-wrapper .ngie-checkbox-control-label .MuiFormControlLabel-label').eq(fileTypeNumber),
16
24
  //Max files dropdown
17
25
  maxFilesLabel: () => cy.get('#Maximum-number-of-files-dropdown-label'),
18
26
  maxFilesDropdown: () => cy.get('#Maximum-number-of-files-select'),
@@ -47,9 +55,8 @@ const selectors = {
47
55
  virusErrorMessageWrapper: () => cy.get('.FileUploadStatementLarge'),
48
56
  uploadedFileLink: () => cy.get('a[href*="/files/document?key=freeResponse/"]'),
49
57
  editDisplayTextPopupInputField: () => cy.get('.inline-text-question-prefix-wrapper .update-display-text-input'),
50
- rejectButton: () => cy.get('.popup-button-wrapper button').eq(0),//TODO: need to use selector from common components, once common class is implemented
51
- acceptButton: () => cy.get('.popup-button-wrapper button').eq(1),//TODO: need to use selector from common components, once common class is implemented
52
- deleteButton: () => cy.get('.icon-Delete.upload-response-state')
58
+ deleteButton: () => cy.get('.icon-Delete.upload-response-state'),
59
+ deletePopupContent: () => cy.get('.delete-document-popup-message-wrapper')
53
60
  }
54
61
 
55
62
  const steps = {
@@ -57,26 +64,17 @@ const steps = {
57
64
  ...questionInstructionsComponent.steps,
58
65
  ...scoringSectionBase.steps,
59
66
  ...additionalSettingsPanel.steps,
67
+ ...commonComponents.steps,
60
68
  checkCapturePhotosCheckbox: () => {
61
69
  uploadResponsePage.allowStudentsToCapturePhotosCheckbox()
62
70
  .click()
63
71
  .should('be.checked');
64
72
  },
65
73
 
66
- checkUncheckSupportedFileType: (fileTypeIndex, fileType, checkedUnchecked) => {
67
- uploadResponsePage.supportedFileTypesCheckboxWrapper(fileTypeIndex)
68
- .verifyInnerText(fileType)
69
- .within(() => {
70
- uploadResponsePage.supportedFileTypeCheckbox()
71
- .click()
72
- .should(checkedUnchecked);
73
- });
74
- },
75
-
76
- fileUploadAndVerify: (filesToUploadArray) => {
74
+ fileUploadAndVerify: (filesToUploadArray, parameter = null) => {
77
75
  filesToUploadArray.forEach((file) => {
78
76
  uploadResponsePage.inputTypeFile()
79
- .attachFile(`uploads/${file}`);
77
+ .attachFile(`uploads/${file}`, parameter);
80
78
  uploadResponsePage.uploadedFileLink()
81
79
  .last()
82
80
  .should('have.text', file);
@@ -84,6 +82,288 @@ const steps = {
84
82
  .should('not.be.visible');
85
83
  });
86
84
  },
85
+
86
+ verifyCapturePhotosCheckboxIsCheckedAndVisible: () => {
87
+ uploadResponsePage.allowStudentsToCapturePhotosCheckbox()
88
+ .should('be.checked')
89
+ .parent()
90
+ .should('be.visible');
91
+ },
92
+
93
+ /**
94
+ * @description Verifies the text in upload response area
95
+ * @param {string} value - The expected text value to be verified.
96
+ * @returns {void}
97
+ */
98
+ verifyTextInUploadResponseArea: (value) => {
99
+ uploadResponsePage.fileUploadOptionsLabel()
100
+ .should('have.text', value);
101
+ },
102
+
103
+ /**
104
+ * @param {number} uploadedFileCount - The actual number of uploaded files.
105
+ * @param {number} fileLimit - The maximum allowed number of files.
106
+ * Verifies the displayed uploaded file count against a specified limit.
107
+ */
108
+ verifyUploadedFileLimitCount: (uploadedFileCount, fileLimit) => {
109
+ utilities.verifyInnerText(uploadResponsePage.uploadedFileCount(), `${uploadedFileCount}/${fileLimit} File Limit`)
110
+ },
111
+
112
+ /**
113
+ * Verifies the visibility state of elements for the preview tab of a specific uploaded file.
114
+ * @param {number} uploadedFileIndex - The index of the uploaded file to check within the list.
115
+ */
116
+ uploadedFileContentsPreviewTab: (uploadedFileIndex) => {
117
+ uploadResponsePage.uploadedFileWrapper()
118
+ .eq(uploadedFileIndex)
119
+ .within(() => {
120
+ utilities.verifyElementVisibilityState(uploadResponsePage.editDisplayTextIcon(), 'visible');
121
+ utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionIcon(), 'visible');
122
+ utilities.verifyElementVisibilityState(uploadResponsePage.deleteButton(), 'visible');
123
+ });
124
+ },
125
+
126
+ /**
127
+ * @param {string} fileName - The expected name of the uploaded file.
128
+ * @param {number} fileIndex - The index of the uploaded file within the list.
129
+ * Verifies the displayed name of an uploaded file at a specific index within the list.
130
+ */
131
+ verifyUploadedFileName: (fileName, fileIndex) => {
132
+ utilities.verifyInnerText(uploadResponsePage.uploadedFileWrapper().eq(fileIndex), fileName);
133
+ },
134
+
135
+ stopUploadingFile: () => {
136
+ uploadResponsePage.stopUploadingButton()
137
+ .click();
138
+ },
139
+
140
+ /**
141
+ * Verifies that a file with the specified name does not exist in the uploaded files section.
142
+ * @param {string} fileName - The name of the file to check for non-existence.
143
+ * @throws {Error} Throws an error if the file with the specified name is found in the uploaded files section.
144
+ * Verifies that a file with the specified name does not exist in the uploaded files section.
145
+ */
146
+ verifyFileNotExistsInUploadedFileSection: (fileName) => {
147
+ uploadResponsePage.uploadedFilesSectionWrapper()
148
+ .should('not.have.text', fileName)
149
+ },
150
+
151
+ expandSupportedFileTypesAccordion: () => {
152
+ uploadResponsePage.supportedFileTypesAccordionWrapper()
153
+ .click();
154
+ },
155
+
156
+ verifyScanningForVirusMessageAndPreLoader: () => {
157
+ uploadResponsePage.uploadedFileWrapper()
158
+ .eq(0)
159
+ .within(() => {
160
+ uploadResponsePage.virusErrorMessageWrapper()
161
+ .verifyInnerText('Scanning for viruses...')
162
+ uploadResponsePage.scanningForVirusPreLoader()
163
+ .should('be.visible');
164
+ });
165
+ },
166
+
167
+ verifyInabilityOfFileDownloadWhenVirusScanningIsInProgress: () => {
168
+ uploadResponsePage.uploadedFileWrapper()
169
+ .eq(0)
170
+ .parents('.uploaded-document-wrapper')
171
+ .should('not.have.attr', 'href');
172
+ },
173
+
174
+ verifyVirusScanningErrorMessage: () => {
175
+ uploadResponsePage.uploadedFileWrapper()
176
+ .eq(1)
177
+ .within(() => {
178
+ utilities.verifyInnerText(uploadResponsePage.virusErrorMessageWrapper(), 'Error: A virus was detected, please upload another file.')
179
+ utilities.verifyElementVisibilityState(uploadResponsePage.virusErrorMessageWrapper(), 'visible');
180
+ });
181
+ },
182
+
183
+ clickOnEditDisplayTextIcon: () => {
184
+ uploadResponsePage.editDisplayTextIcon()
185
+ .click();
186
+ },
187
+
188
+ verifyEditDisplayTextPopupInputFieldAndSelectedText: () => {
189
+ uploadResponsePage.editDisplayTextPopupInputField()
190
+ .should('have.value', 'image.png')
191
+ .parent()
192
+ .and('have.class', 'Mui-focused');
193
+ },
194
+
195
+ clearEditDisplayTextPopupInputField: () => {
196
+ uploadResponsePage.editDisplayTextPopupInputField()
197
+ .clear();
198
+ },
199
+
200
+ verifyEditDisplayTextPopupInputFieldPlaceholderText: () => {
201
+ uploadResponsePage.editDisplayTextPopupInputField()
202
+ .should('have.attr', 'placeholder', 'Enter display text')
203
+ .and('be.visible');
204
+ },
205
+
206
+ /**
207
+ * @param {string} text - The text to be entered into the input field.
208
+ * Enters text into the input field of the "Edit Display Text" popup.
209
+ */
210
+ enterTextInEditDisplayTextPopupInputField: (text) => {
211
+ uploadResponsePage.editDisplayTextPopupInputField()
212
+ .type(text);
213
+ },
214
+
215
+ /**
216
+ * @param {string} text - The expected text to be present in the input field.
217
+ * Verifies that the input field of the "Edit Display Text" popup contains the expected text.
218
+ */
219
+ verifyTextInEditDisplayTextPopupInputField: (text) => {
220
+ uploadResponsePage.editDisplayTextPopupInputField()
221
+ .should('have.value', text);
222
+ },
223
+
224
+ clickOnAddFileDescriptionIcon: () => {
225
+ uploadResponsePage.addFileDescriptionIcon()
226
+ .click();
227
+ },
228
+
229
+ verifyAddFileDescriptionInputFieldPlaceholderText: () => {
230
+ uploadResponsePage.addFileDescriptionInput()
231
+ .should('have.attr', 'placeholder', 'Add file description')
232
+ .and('be.visible');
233
+ },
234
+
235
+ /**
236
+ * Enters text into the input field for adding a file description.
237
+ * @param {string} text - The text to be entered into the input field.
238
+ */
239
+ enterTextInAddFileDescriptionInputField: (text) => {
240
+ uploadResponsePage.addFileDescriptionInput()
241
+ .type(text)
242
+ },
243
+
244
+ /**
245
+ * Verifies that the input field for adding a file description contains the expected text.
246
+ * @param {string} text - The expected text to be present in the input field.
247
+ */
248
+ verifyTextInAddFileDescriptionInputField: (text) => {
249
+ uploadResponsePage.addFileDescriptionInput()
250
+ .should('have.value', text)
251
+ },
252
+
253
+ deleteFile: () => {
254
+ uploadResponsePage.deleteButton()
255
+ .click();
256
+ },
257
+
258
+ uncheckCapturePhotosCheckbox: () => {
259
+ uploadResponsePage.allowStudentsToCapturePhotosCheckbox()
260
+ .click()
261
+ .should('not.be.checked');
262
+ },
263
+
264
+ verifySupportedFilesTypesAccordionCollapsedState: () => {
265
+ uploadResponsePage.supportedFileTypesAccordionWrapper()
266
+ .should('have.attr', 'aria-expanded', 'false');
267
+ },
268
+
269
+ verifySupportedFilesTypesAccordionExpandedState: () => {
270
+ uploadResponsePage.supportedFileTypesAccordionWrapper()
271
+ .should('have.attr', 'aria-expanded', 'true');
272
+ },
273
+
274
+ clickOnSupportedFilesTypesAccordion: () => {
275
+ uploadResponsePage.supportedFileTypesAccordionWrapper()
276
+ .click()
277
+ },
278
+
279
+ /**
280
+ * @description this function checks the supported file type checkbox of the given index number.
281
+ * @param {number} index of the checkbox to be checked
282
+ */
283
+ checkSupportedFileTypeCheckbox: (index) => {
284
+ uploadResponsePage.supportedFileTypesCheckboxWrapper(index)
285
+ .within(() => {
286
+ uploadResponsePage.supportedFileTypeCheckbox()
287
+ .click()
288
+ .should('be.checked');
289
+ });
290
+ },
291
+
292
+ verifySupportedFileTypeCheckboxIsChecked: () => {
293
+ uploadResponsePage.supportedFileTypeCheckbox()
294
+ .should('be.checked');
295
+ },
296
+
297
+ /**
298
+ * @description this function unchecks the supported file type checkbox of the given index number.
299
+ * @param {number} index of the checkbox to be checked
300
+ */
301
+ uncheckSupportedFileTypeCheckbox: (index) => {
302
+ uploadResponsePage.supportedFileTypesCheckboxWrapper(index)
303
+ .within(() => {
304
+ uploadResponsePage.supportedFileTypeCheckbox()
305
+ .click()
306
+ .should('not.be.checked');
307
+ });
308
+ },
309
+
310
+ expandMaxFilesDropdown: () => {
311
+ uploadResponsePage.maxFilesDropdown()
312
+ .click();
313
+ },
314
+
315
+ /**
316
+ * @param {number} dropdownOption number of the dropdown option to be selected
317
+ */
318
+ selectOptionFromMaxFilesDropdown: (dropdownOption) => {
319
+ uploadResponsePage.maxFilesDropdownListOptions(dropdownOption)
320
+ .click();
321
+ },
322
+
323
+ /**
324
+ * @param {string} file name of the file in fixtures/upload folder
325
+ * @description this function uploads a file
326
+ */
327
+ uploadFile: (file) => {
328
+ uploadResponsePage.inputTypeFile()
329
+ .attachFile(file);
330
+ },
331
+
332
+ verifyDefaultSelectedFileTypes: () => {
333
+ indexOfDefaultSelectedFileTypes.forEach((selectedFileTypeIndex) => {
334
+ uploadResponsePage.supportedFileTypesCheckboxWrapper(selectedFileTypeIndex)
335
+ .within(($element) => {
336
+ uploadResponsePage.steps.verifySupportedFileTypeCheckboxIsChecked();
337
+ cy.wrap($element)
338
+ .find('.MuiFormControlLabel-label')
339
+ .verifyInnerText(fileTypeList[selectedFileTypeIndex])
340
+ });
341
+ });
342
+ },
343
+
344
+ uncheckDefaultSelectedFileTypes: () => {
345
+ indexOfDefaultSelectedFileTypes.forEach((selectedFileTypeIndex) => {
346
+ uploadResponsePage.supportedFileTypesCheckboxWrapper(selectedFileTypeIndex)
347
+ .within(() => {
348
+ uploadResponsePage.supportedFileTypeCheckbox()
349
+ .click()
350
+ .should('not.be.checked');
351
+ });
352
+ });
353
+ },
354
+
355
+ verifyInprogressUploadFileCSS: () => {
356
+ uploadResponsePage.inputTypeFile()
357
+ .attachFile('uploads/20mbFile.png')
358
+ .then(() => {
359
+ uploadResponsePage.uploadingFileName()
360
+ .verifyCSS(css.color.text, css.fontSize.normal, css.fontWeight.regular);
361
+ uploadResponsePage.uploadingFileSize()
362
+ .verifyCSS(css.color.text, css.fontSize.small, css.fontWeight.regular);
363
+ uploadResponsePage.stopUploadingButton().find('svg')
364
+ .should('have.css', 'color', css.color.successBtn);
365
+ });
366
+ }
87
367
  }
88
368
 
89
369
  const tests = {
@@ -92,6 +372,7 @@ const tests = {
92
372
  ...additionalSettingsPanel.tests,
93
373
  ...scoringSectionBase.tests,
94
374
  ...previewScoringAndShowCorrectAnswerComponent.tests,
375
+ ...commonComponents.tests,
95
376
  verifyErrorMessageDisappear: () => {
96
377
  it('The error message should disappear if the user clicks anywhere in the upload file content wrapper', () => {
97
378
  uploadResponsePage.inputTypeFile()
@@ -202,13 +202,12 @@ const steps = {
202
202
  videoResponsePage.recordingTimer()
203
203
  .invoke('text')
204
204
  .then(text => {
205
- const recordedTime = text.split('/')[0]
205
+ const recordedTime = text.split('/')[0].trim()
206
206
  videoResponsePage.steps.stopRecording();
207
- videoResponsePage.steps.verifyRecordingStatus('Saving');
208
207
  videoResponsePage.playerTimer()
209
208
  .invoke('text')
210
209
  .then(text => {
211
- const playbackTime = text.split('/')[1]
210
+ const playbackTime = text.split('/')[1].trim()
212
211
  expect(playbackTime).to.be.eq(recordedTime)
213
212
  });
214
213
  });
@@ -305,7 +304,7 @@ const steps = {
305
304
  videoResponsePage.playbackSpeedAdvancedPlaybackOptionButton()
306
305
  .should('not.have.class', 'ngie-toggle-button-selected')
307
306
  .within(() => {
308
- utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'notExist');
307
+ utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'hidden');
309
308
  });
310
309
  },
311
310
 
@@ -321,7 +320,7 @@ const steps = {
321
320
  videoResponsePage.fullScreenAdvancedPlaybackOptionButton()
322
321
  .should('not.have.class', 'ngie-toggle-button-selected')
323
322
  .within(() => {
324
- utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'notExist');
323
+ utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'hidden');
325
324
  });
326
325
  },
327
326
 
@@ -337,7 +336,7 @@ const steps = {
337
336
  videoResponsePage.recordAgainAdvancedPlaybackOptionButton()
338
337
  .should('not.have.class', 'ngie-toggle-button-selected')
339
338
  .within(() => {
340
- utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'notExist');
339
+ utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'hidden');
341
340
  });
342
341
  },
343
342
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {