itemengine-cypress-automation 1.0.128 → 1.0.131-updateILCrepo6March-02c78d1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +210 -0
- package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +91 -0
- package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +392 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +2 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -1
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +152 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +196 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +195 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +288 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/manuallyAndNonScored.js +141 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +245 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +413 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +218 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +245 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +163 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +196 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +83 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +653 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +180 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabScoringSection.js +229 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +90 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/switchingCasesBetweenOptionsLayout.js +50 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +204 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +204 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +298 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingPenaltyScoring.js +63 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +111 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +231 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsBasic.js +90 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +232 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +231 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsBasic.js +138 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +213 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +186 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +161 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +328 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +144 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabScoringSection.js +250 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +75 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +74 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +188 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +8 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +4 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +1 -52
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +3 -211
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +39 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -50
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +325 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +1 -146
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +78 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +265 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +75 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/responseAnswersAndAcceptedStudentInput.js +56 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +40 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +249 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +64 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +128 -0
- package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +889 -0
- package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +168 -0
- package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +203 -0
- package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +222 -0
- package/cypress/e2e/ILC/SimpleCalculator/calculatorFunctionality.js +349 -0
- package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +132 -0
- package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +35 -7
- package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +213 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +41 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +377 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +161 -0
- package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +250 -0
- package/cypress/e2e/migration/migration.js +4 -41
- package/cypress/e2e/migration/migration10.js +6 -43
- package/cypress/e2e/migration/migration2.js +6 -43
- package/cypress/e2e/migration/migration3.js +6 -43
- package/cypress/e2e/migration/migration4.js +6 -43
- package/cypress/e2e/migration/migration5.js +6 -43
- package/cypress/e2e/migration/migration6.js +6 -43
- package/cypress/e2e/migration/migration7.js +6 -43
- package/cypress/e2e/migration/migration8.js +6 -43
- package/cypress/e2e/migration/migration9.js +6 -43
- package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
- package/cypress/fixtures/theme/ilc.json +6 -1
- package/cypress/fixtures/uploadResponseFileType.js +5 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +13 -13
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +24 -6
- package/cypress/pages/components/draggableOptionContainer.js +1 -0
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +42 -4
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +149 -5
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +954 -77
- package/cypress/pages/components/questionInputFieldComponent.js +1 -1
- package/cypress/pages/components/questionInstructionsComponent.js +2 -1
- package/cypress/pages/contentBlocksPage.js +515 -0
- package/cypress/pages/drawingResponsePage.js +2 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +359 -3
- package/cypress/pages/fillInTheGapsDropdownPage.js +21 -1
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +5 -57
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -24
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -435
- package/cypress/pages/fillInTheGapsTextPage.js +9 -2
- package/cypress/pages/graphingPage.js +484 -0
- package/cypress/pages/index.js +4 -1
- package/cypress/pages/simpleCalculatorPage.js +310 -0
- package/cypress/pages/uploadResponsePage.js +260 -92
- package/cypress/support/commands.js +33 -1
- package/package.json +2 -2
- package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +0 -242
- package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +0 -99
- package/cypress/e2e/ILC/Passage/passageEditTab.js +0 -241
- package/cypress/e2e/ILC/Passage/passageHeaderSection.js +0 -73
- package/cypress/e2e/ILC/Passage/passagePreviewTab.js +0 -246
@@ -1,31 +1,54 @@
|
|
1
|
-
import { commonComponents, questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, additionalSettingsPanel, autoScoredScoringPreviewTab } from "./components";
|
1
|
+
import { commonComponents, questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, additionalSettingsPanel, autoScoredScoringPreviewTab, studentViewSettingsLabelComponent } from "./components";
|
2
2
|
import { dialogBoxBase } from ".";
|
3
3
|
import utilities from "../support/helpers/utilities";
|
4
|
+
import { supportedFileType } from "../fixtures/uploadResponseFileType";
|
4
5
|
const css = Cypress.env('css');
|
5
6
|
|
6
|
-
|
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'];
|
7
|
+
const indexOfDefaultSelectedFileTypes = [0, 1, 2, 3, 4, 5, 6, 7, 20, 21, 22, 28, 29, 30];
|
8
8
|
|
9
9
|
const selectors = {
|
10
|
-
...dialogBoxBase,
|
11
10
|
...scoringSectionBaseEditTab,
|
12
11
|
...createQuestionBasePage,
|
13
12
|
...additionalSettingsPanel,
|
14
13
|
...commonComponents,
|
15
14
|
...questionInstructionsComponent,
|
16
15
|
...commonComponents,
|
17
|
-
|
16
|
+
...dialogBoxBase,
|
17
|
+
|
18
|
+
maximumNumberOfFilesInputField: () => cy.get('.input-stepper-textfield'),
|
19
|
+
maximumNumberOfFilesLabel: () => cy.get('.input-stepper-label'),
|
20
|
+
maximumNumberOfFilesIncreaseButton: () => cy.get('[aria-label="Increase count"]'),
|
21
|
+
maximumNumberOfFilesDecreaseButton: () => cy.get('[aria-label="Decrease count"]'),
|
18
22
|
//Supported file accordion
|
19
23
|
supportedFileTypesAccordion: () => cy.get('.freeresponse-accordian-label'),
|
20
24
|
selectedFileTypeCount: () => cy.get('.supported-file-types-count'),
|
21
|
-
|
25
|
+
supportedFileTypeCategoryLabel: (fileTypeNumber) => cy.get('[class*="SupportedFileAccessstyles__LabelWrapper"]').eq(fileTypeNumber),
|
26
|
+
supportedFileTypeButton: (fileTypeNumber) => cy.get('[class*="ToggleButtonLabelWrapper"] button').eq(fileTypeNumber),
|
22
27
|
supportedFileTypesAccordionWrapper: () => cy.get('.edit-question-edit-tab-wrapper .ngie-accordion-summary'),
|
23
|
-
|
24
|
-
|
25
|
-
//
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
supportedFileTypeOptionWrapper: (fileTypeNumber) => cy.get('[class*="ToggleButtonLabelWrapper"]').eq(fileTypeNumber),
|
29
|
+
supportedFileTypeOptionLabel: (fileTypeNumber) => cy.get('[id*="panel-content"] [class*="ToggleButtonLabelWrapper"] [class*="LabelWrapper"]').eq(fileTypeNumber),
|
30
|
+
//file size limit dropdown
|
31
|
+
fileSizeLimitLabel: () => cy.get('#File-size-limit-MB--dropdown-label'),
|
32
|
+
fileSizeLimitDropdown: () => cy.get('#File-size-limit-MB--select'),
|
33
|
+
fileSizeLimitDropdownListOptions: (ariaLabel = null) => {
|
34
|
+
if (ariaLabel) {
|
35
|
+
return cy.get(`[aria-labelledby*="File-size-limit-MB--dropdown-label"] [role="option"][aria-label="${ariaLabel}"]`)
|
36
|
+
} else {
|
37
|
+
return cy.get('[aria-labelledby*="File-size-limit-MB--dropdown-label"] [role="option"]')
|
38
|
+
}
|
39
|
+
},
|
40
|
+
//student view settings
|
41
|
+
uploadControlsLabel: () => cy.get('[class*="UploadResponseSettingsstyles__ControlLabel"]'),
|
42
|
+
uploadControlsOptionWrapper: () => cy.get('.upload-control-option'),
|
43
|
+
uploadControlsOptionButton: () => cy.get('.upload-control-option button'),
|
44
|
+
uploadControlsOptionLabel: () => cy.get('.ngie-toggle-button-label'),
|
45
|
+
uploadControlsOptionIcon: () => cy.get('.ngie-toggle-button-icon'),
|
46
|
+
displayPerFileSizeLimitToStudentCheckbox: () => cy.get('[data-ngie-testid="display-per-file-size-limit-to-student-checkbox"] input'),
|
47
|
+
displayPerFileSizeLimitToStudentLabel: () => cy.get('[data-ngie-testid="display-per-file-size-limit-to-student-checkbox"] .MuiFormControlLabel-label'),
|
48
|
+
allowStudentToEditFileNameCheckbox: () => cy.get('[data-ngie-testid="allow-student-to-edit-file-name-checkbox"] input'),
|
49
|
+
allowStudentToEditFileNameLabel: () => cy.get('[data-ngie-testid="allow-student-to-edit-file-name-checkbox"] .MuiFormControlLabel-label'),
|
50
|
+
allowStudentToAddFileDescriptionCheckbox: () => cy.get('[data-ngie-testid="allow-student-to-add-file-description-checkbox"] input'),
|
51
|
+
allowStudentToAddFileDescriptionLabel: () => cy.get('[data-ngie-testid="allow-student-to-add-file-description-checkbox"] .MuiFormControlLabel-label'),
|
29
52
|
//Additional settings accordian
|
30
53
|
fileSettingsAndLayoutLabel: () => cy.get('[class*="AdditionalOptionstyles__ScoringLabel"]'),//TODO: need to change post issue for unique class name
|
31
54
|
allowStudentsToCapturePhotosLabel: () => cy.get('[data-ngie-testid="allow-students-to-capture-photos-checkbox"] .MuiFormControlLabel-label'),
|
@@ -52,7 +75,7 @@ const selectors = {
|
|
52
75
|
fileName: () => cy.get('.studentResponse'),
|
53
76
|
addFileDescriptionInput: () => cy.get('[placeholder="Add file description"]'),
|
54
77
|
addFileDescriptionIcon: () => cy.get('.icon-File-description'),
|
55
|
-
scanningForVirusPreLoader: () => cy.get('
|
78
|
+
scanningForVirusPreLoader: () => cy.get('.error-message-text-cls[role="alert"]'),
|
56
79
|
virusErrorMessageWrapper: () => cy.get('.FileUploadStatementLarge'),
|
57
80
|
uploadedFileLink: () => cy.get('a[href*="/files/document?key=freeResponse/"]'),
|
58
81
|
editDisplayTextPopupInputField: () => cy.get('.inline-text-question-prefix-wrapper .update-display-text-input'),
|
@@ -60,9 +83,10 @@ const selectors = {
|
|
60
83
|
deletePopupContent: () => cy.get('.delete-document-popup-message-wrapper'),
|
61
84
|
warningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
|
62
85
|
warningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
|
63
|
-
|
86
|
+
acceptButton: () => cy.get('.popup-button-wrapper button').eq(1),
|
64
87
|
cancelButton: () => cy.get('.popup-button-wrapper button').eq(0),
|
65
|
-
questionWrapperPreviewTab: () => cy.get('[class*="UploadQuestionPreviewstyle__UploadQuestionPreviewWrapper"]')
|
88
|
+
questionWrapperPreviewTab: () => cy.get('[class*="UploadQuestionPreviewstyle__UploadQuestionPreviewWrapper"]'),
|
89
|
+
maximumFileSize: () => cy.get('[class*="UploadQuestionPreviewstyle__MaxFileLimitDesc"]')
|
66
90
|
}
|
67
91
|
|
68
92
|
const steps = {
|
@@ -71,55 +95,97 @@ const steps = {
|
|
71
95
|
...scoringSectionBaseEditTab.steps,
|
72
96
|
...additionalSettingsPanel.steps,
|
73
97
|
...commonComponents.steps,
|
74
|
-
...dialogBoxBase.steps,
|
75
98
|
...autoScoredScoringPreviewTab.steps,
|
76
99
|
|
77
100
|
/**
|
78
101
|
* @param {number} maxValue value of maximum number of files
|
102
|
+
* @description function enters value in maximum number of files input field
|
79
103
|
*/
|
80
|
-
setMaximumNumberOfFiles: (
|
104
|
+
setMaximumNumberOfFiles: (value) => {
|
81
105
|
uploadResponsePage.maximumNumberOfFilesInputField()
|
82
106
|
.clear()
|
83
107
|
.type('{selectall}')
|
84
|
-
.type(
|
108
|
+
.type(value)
|
85
109
|
.blur();
|
86
110
|
uploadResponsePage.maximumNumberOfFilesInputField()
|
87
|
-
.should('have.value',
|
111
|
+
.should('have.value', value);
|
88
112
|
},
|
89
113
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
114
|
+
/**
|
115
|
+
* @param {number} value value of maximum number of files
|
116
|
+
*/
|
117
|
+
verifyMaximumNumberOfFilesInputField: (value) => {
|
118
|
+
uploadResponsePage.maximumNumberOfFilesInputField()
|
119
|
+
.should('have.value', value);
|
120
|
+
},
|
121
|
+
|
122
|
+
decreaseMaximumNumberOfFilesCount: () => {
|
123
|
+
uploadResponsePage.maximumNumberOfFilesDecreaseButton()
|
124
|
+
.click();
|
94
125
|
},
|
95
126
|
|
127
|
+
increaseMaximumNumberOfFilesCount: () => {
|
128
|
+
uploadResponsePage.maximumNumberOfFilesIncreaseButton()
|
129
|
+
.click();
|
130
|
+
},
|
131
|
+
|
132
|
+
/**
|
133
|
+
* @description Function uploads files
|
134
|
+
* @param {string[]} filesToUploadArray An array containing the file names to be uploaded.
|
135
|
+
* @param {drag and drop} parameter Additional options for uploading files.
|
136
|
+
*/
|
96
137
|
fileUploadAndVerify: (filesToUploadArray, parameter = null) => {
|
97
|
-
|
98
|
-
|
99
|
-
.
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
138
|
+
const uploadSequentially = (files, index = 0) => {
|
139
|
+
if (index < files.length) {
|
140
|
+
return uploadResponsePage.inputTypeFile()
|
141
|
+
.attachFile(`uploads/${files[index]}`, parameter)
|
142
|
+
.then(() => {
|
143
|
+
uploadResponsePage.uploadingProgressBar()
|
144
|
+
.should('not.exist', { timeout: 10000 });
|
145
|
+
uploadResponsePage.scanningForVirusPreLoader()
|
146
|
+
.should('not.be.visible', { timeout: 10000 });
|
147
|
+
uploadResponsePage.uploadedFileLink()
|
148
|
+
.last()
|
149
|
+
.should('have.text', files[index]);
|
150
|
+
return uploadSequentially(files, index + 1);
|
151
|
+
});
|
152
|
+
}
|
153
|
+
};
|
154
|
+
return uploadSequentially(filesToUploadArray);
|
106
155
|
},
|
107
156
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
157
|
+
/**
|
158
|
+
* @description Verifies the upload response area have particular option
|
159
|
+
* @param {"Capture photo"|"Google Drive"} option - uploading options in preview tab.
|
160
|
+
*/
|
161
|
+
verifyUploadOptionVisibleInUploadResponseArea: (option) => {
|
162
|
+
switch (option) {
|
163
|
+
case 'Capture photo': uploadResponsePage.fileUploadOptionsLabel()
|
164
|
+
.should('have.descendants', '.icon-Capture-an-image');
|
165
|
+
break;
|
166
|
+
case 'Google Drive': uploadResponsePage.fileUploadOptionsLabel()
|
167
|
+
.should('have.descendants', '.icon-Google-Drive');
|
168
|
+
break;
|
169
|
+
default:
|
170
|
+
throw new Error('Invalid upload option');
|
171
|
+
}
|
113
172
|
},
|
114
173
|
|
115
174
|
/**
|
116
|
-
* @description Verifies the
|
117
|
-
* @param {
|
118
|
-
* @returns {void}
|
175
|
+
* @description Verifies the upload response area doesnot have particular option
|
176
|
+
* @param {"Capture photo"|"Google Drive"} option - uploading options in preview tab.
|
119
177
|
*/
|
120
|
-
|
121
|
-
|
122
|
-
|
178
|
+
verifyUploadOptionNotVisibleInUploadResponseArea: (option) => {
|
179
|
+
switch (option) {
|
180
|
+
case 'Capture photo': uploadResponsePage.fileUploadOptionsLabel()
|
181
|
+
.should('not.have.descendants', '.icon-Capture-an-image');
|
182
|
+
break;
|
183
|
+
case 'Google Drive': uploadResponsePage.fileUploadOptionsLabel()
|
184
|
+
.should('not.have.descendants', '.icon-Google-Drive');
|
185
|
+
break;
|
186
|
+
default:
|
187
|
+
throw new Error('Invalid upload option');
|
188
|
+
}
|
123
189
|
},
|
124
190
|
|
125
191
|
/**
|
@@ -160,10 +226,10 @@ const steps = {
|
|
160
226
|
utilities.verifyInnerText(utilities.getNthElement(uploadResponsePage.fileName(), fileIndex), fileName);
|
161
227
|
},
|
162
228
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
229
|
+
/**
|
230
|
+
* @param {string} fileName - The expected name of the uploaded file.
|
231
|
+
* Verifies the displayed name of an uploaded file
|
232
|
+
*/
|
167
233
|
verifyUploadedFileNameVisible: (fileName) => {
|
168
234
|
uploadResponsePage.uploadedFilesSectionWrapper()
|
169
235
|
.contains(fileName);
|
@@ -217,6 +283,10 @@ const steps = {
|
|
217
283
|
});
|
218
284
|
},
|
219
285
|
|
286
|
+
/**
|
287
|
+
* Clicks on the edit display text icon for a specific file at the given index.
|
288
|
+
* @param {number} index - The index of the file in the uploaded file wrapper.
|
289
|
+
*/
|
220
290
|
clickOnEditDisplayTextIcon: (index) => {
|
221
291
|
uploadResponsePage.uploadedFileWrapper()
|
222
292
|
.eq(index)
|
@@ -297,10 +367,37 @@ const steps = {
|
|
297
367
|
.click();
|
298
368
|
},
|
299
369
|
|
300
|
-
|
301
|
-
|
370
|
+
verifyUploadControlsButton: () => {
|
371
|
+
uploadControlsOption.forEach((label, index) => {
|
372
|
+
utilities.getNthElement(uploadResponsePage.uploadControlsOptionWrapper(), index)
|
373
|
+
.within(() => {
|
374
|
+
utilities.verifyInnerText(uploadResponsePage.uploadControlsOptionLabel(), label);
|
375
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadControlsOptionLabel(), 'visible');
|
376
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadControlsOptionIcon(), 'visible');
|
377
|
+
});
|
378
|
+
utilities.getNthElement(uploadResponsePage.uploadControlsOptionButton(), index)
|
379
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
380
|
+
});
|
381
|
+
},
|
382
|
+
|
383
|
+
/**
|
384
|
+
* @description Unselects the upload controls option at the specified index.
|
385
|
+
* @param {number} index - The index of the upload controls option to unselect.
|
386
|
+
*/
|
387
|
+
unselectUploadControlsOption: (index) => {
|
388
|
+
utilities.getNthElement(uploadResponsePage.uploadControlsOptionButton(), index)
|
302
389
|
.click()
|
303
|
-
.should('not.
|
390
|
+
.should('not.have.class', 'ngie-toggle-button-selected');
|
391
|
+
},
|
392
|
+
|
393
|
+
/**
|
394
|
+
* @description selects the upload controls option at the specified index.
|
395
|
+
* @param {number} index - The index of the upload controls option to select.
|
396
|
+
*/
|
397
|
+
selectUploadControlsOption: (index) => {
|
398
|
+
utilities.getNthElement(uploadResponsePage.uploadControlsOptionButton(), index)
|
399
|
+
.click()
|
400
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
304
401
|
},
|
305
402
|
|
306
403
|
verifySupportedFilesTypesAccordionCollapsedState: () => {
|
@@ -319,46 +416,52 @@ const steps = {
|
|
319
416
|
},
|
320
417
|
|
321
418
|
/**
|
322
|
-
* @description this function
|
323
|
-
* @param {number} index of the
|
419
|
+
* @description this function selects the supported file type of the given index number.
|
420
|
+
* @param {number} index of the file type option to be selected
|
324
421
|
*/
|
325
|
-
|
326
|
-
uploadResponsePage.
|
327
|
-
.
|
328
|
-
|
329
|
-
.click()
|
330
|
-
.should('be.checked');
|
331
|
-
});
|
422
|
+
selectSupportedFileTypeOption: (index) => {
|
423
|
+
uploadResponsePage.supportedFileTypeButton(index)
|
424
|
+
.click({ force: true })
|
425
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
332
426
|
},
|
333
427
|
|
334
|
-
|
335
|
-
uploadResponsePage.
|
336
|
-
.should('
|
428
|
+
verifySupportedFileTypeOptionIsSelected: () => {
|
429
|
+
uploadResponsePage.supportedFileTypeButton()
|
430
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
337
431
|
},
|
338
432
|
|
339
433
|
/**
|
340
|
-
* @description this function
|
341
|
-
* @param {number} index of the
|
434
|
+
* @description this function unselects the supported file type option of the given index number.
|
435
|
+
* @param {number} index of the file type option to be unselected
|
342
436
|
*/
|
343
|
-
|
344
|
-
uploadResponsePage.
|
345
|
-
.
|
346
|
-
|
347
|
-
.click()
|
348
|
-
.should('not.be.checked');
|
349
|
-
});
|
437
|
+
unselectSupportedFileTypeOption: (index) => {
|
438
|
+
uploadResponsePage.supportedFileTypeButton(index)
|
439
|
+
.click({ force: true })
|
440
|
+
.should('not.have.class', 'ngie-toggle-button-selected');
|
350
441
|
},
|
351
442
|
|
352
|
-
|
353
|
-
uploadResponsePage.
|
443
|
+
expandFileSizeLimitDropdown: () => {
|
444
|
+
uploadResponsePage.fileSizeLimitDropdown()
|
354
445
|
.click();
|
355
446
|
},
|
356
447
|
|
448
|
+
/**
|
449
|
+
* @param {string[]} dropdownOptionsArray array containing options of dropdown list
|
450
|
+
* @description this function is used to verify inner text of expanded dropdown list options
|
451
|
+
*/
|
452
|
+
verifyFileSizeLimitDropdownOptions: (dropdownOptionsArray) => {
|
453
|
+
dropdownOptionsArray.forEach((option, count) => {
|
454
|
+
uploadResponsePage.fileSizeLimitDropdownListOptions()
|
455
|
+
.eq(count)
|
456
|
+
.should('have.text', option);
|
457
|
+
});
|
458
|
+
},
|
459
|
+
|
357
460
|
/**
|
358
461
|
* @param {number} dropdownOption number of the dropdown option to be selected
|
359
462
|
*/
|
360
|
-
|
361
|
-
uploadResponsePage.
|
463
|
+
selectFileSizeLimit: (dropdownOption) => {
|
464
|
+
uploadResponsePage.fileSizeLimitDropdownListOptions(dropdownOption)
|
362
465
|
.click();
|
363
466
|
},
|
364
467
|
|
@@ -374,23 +477,25 @@ const steps = {
|
|
374
477
|
|
375
478
|
verifyDefaultSelectedFileTypes: () => {
|
376
479
|
indexOfDefaultSelectedFileTypes.forEach((selectedFileTypeIndex) => {
|
377
|
-
uploadResponsePage.
|
480
|
+
uploadResponsePage.supportedFileTypeOptionWrapper(selectedFileTypeIndex)
|
378
481
|
.within(($element) => {
|
379
|
-
uploadResponsePage.steps.verifySupportedFileTypeCheckboxIsChecked();
|
380
482
|
cy.wrap($element)
|
381
|
-
.find('
|
382
|
-
.
|
483
|
+
.find('button')
|
484
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
485
|
+
.find('[class*="LabelWrapper"]')
|
486
|
+
.verifyInnerText(supportedFileType.fileTypeList[selectedFileTypeIndex]);
|
383
487
|
});
|
384
488
|
});
|
385
489
|
},
|
386
490
|
|
387
491
|
uncheckDefaultSelectedFileTypes: () => {
|
388
492
|
indexOfDefaultSelectedFileTypes.forEach((selectedFileTypeIndex) => {
|
389
|
-
uploadResponsePage.
|
390
|
-
.within(() => {
|
391
|
-
|
493
|
+
uploadResponsePage.supportedFileTypeOptionWrapper(selectedFileTypeIndex)
|
494
|
+
.within(($element) => {
|
495
|
+
cy.wrap($element)
|
392
496
|
.click()
|
393
|
-
.
|
497
|
+
.find('button')
|
498
|
+
.should('not.have.class', 'ngie-toggle-button-selected');
|
394
499
|
});
|
395
500
|
});
|
396
501
|
},
|
@@ -399,12 +504,18 @@ const steps = {
|
|
399
504
|
uploadResponsePage.inputTypeFile()
|
400
505
|
.attachFile('uploads/20mbFile.png')
|
401
506
|
.then(() => {
|
402
|
-
uploadResponsePage.
|
403
|
-
|
404
|
-
|
405
|
-
|
507
|
+
utilities.verifyCSS(uploadResponsePage.uploadingFileSize(), {
|
508
|
+
'color': 'rgba(51, 51, 51, 0.7)',
|
509
|
+
'font-size': css.fontSize.small,
|
510
|
+
'font-weight': css.fontWeight.regular
|
511
|
+
});
|
406
512
|
uploadResponsePage.stopUploadingButton().find('svg')
|
407
|
-
.should('have.css', 'color',
|
513
|
+
.should('have.css', 'color', 'rgb(30, 30, 36)');
|
514
|
+
utilities.verifyCSS(uploadResponsePage.uploadingFileName(), {
|
515
|
+
'color': 'rgba(51, 51, 51, 0.7)',
|
516
|
+
'font-size': css.fontSize.small,
|
517
|
+
'font-weight': css.fontWeight.regular
|
518
|
+
});
|
408
519
|
});
|
409
520
|
},
|
410
521
|
|
@@ -422,9 +533,66 @@ const steps = {
|
|
422
533
|
.click();
|
423
534
|
},
|
424
535
|
|
425
|
-
|
426
|
-
uploadResponsePage.
|
536
|
+
clickAcceptButtonInPopup: () => {
|
537
|
+
uploadResponsePage.acceptButton()
|
538
|
+
.click();
|
539
|
+
},
|
540
|
+
|
541
|
+
clickCancelButtonInPopup: () => {
|
542
|
+
uploadResponsePage.cancelButton()
|
427
543
|
.click();
|
544
|
+
},
|
545
|
+
|
546
|
+
verifyMaximumFileSizePreviewTab: (size) => {
|
547
|
+
utilities.verifyInnerText(uploadResponsePage.maximumFileSize(), `Maximum file size: ${size}`);
|
548
|
+
},
|
549
|
+
|
550
|
+
uncheckDisplayPerFileSizeLimitToStudentCheckbox: () => {
|
551
|
+
uploadResponsePage.displayPerFileSizeLimitToStudentCheckbox()
|
552
|
+
.click()
|
553
|
+
.should('not.be.checked');
|
554
|
+
},
|
555
|
+
|
556
|
+
verifyDisplayPerFileSizeLimitToStudentCheckboxChecked: () => {
|
557
|
+
uploadResponsePage.displayPerFileSizeLimitToStudentCheckbox()
|
558
|
+
.should('be.checked');
|
559
|
+
},
|
560
|
+
|
561
|
+
verifyDisplayPerFileSizeLimitToStudentCheckboxUnchecked: () => {
|
562
|
+
uploadResponsePage.displayPerFileSizeLimitToStudentCheckbox()
|
563
|
+
.should('not.be.checked');
|
564
|
+
},
|
565
|
+
|
566
|
+
uncheckAllowStudentToEditFileNameCheckbox: () => {
|
567
|
+
uploadResponsePage.allowStudentToEditFileNameCheckbox()
|
568
|
+
.click()
|
569
|
+
.should('not.be.checked');
|
570
|
+
},
|
571
|
+
|
572
|
+
verifyAllowStudentToEditFileNameCheckboxChecked: () => {
|
573
|
+
uploadResponsePage.allowStudentToEditFileNameCheckbox()
|
574
|
+
.should('be.checked');
|
575
|
+
},
|
576
|
+
|
577
|
+
verifyAllowStudentToEditFileNameCheckboxUnchecked: () => {
|
578
|
+
uploadResponsePage.allowStudentToEditFileNameCheckbox()
|
579
|
+
.should('not.be.checked');
|
580
|
+
},
|
581
|
+
|
582
|
+
uncheckAllowStudentToAddFileDescriptionCheckbox: () => {
|
583
|
+
uploadResponsePage.allowStudentToAddFileDescriptionCheckbox()
|
584
|
+
.click()
|
585
|
+
.should('not.be.checked');
|
586
|
+
},
|
587
|
+
|
588
|
+
verifyAllowStudentToAddFileDescriptionCheckboxChecked: () => {
|
589
|
+
uploadResponsePage.allowStudentToAddFileDescriptionCheckbox()
|
590
|
+
.should('be.checked');
|
591
|
+
},
|
592
|
+
|
593
|
+
verifyAllowStudentToAddFileDescriptionCheckboxUnchecked: () => {
|
594
|
+
uploadResponsePage.allowStudentToAddFileDescriptionCheckbox()
|
595
|
+
.should('not.be.checked');
|
428
596
|
}
|
429
597
|
}
|
430
598
|
|
@@ -435,12 +603,12 @@ const tests = {
|
|
435
603
|
...scoringSectionBaseEditTab.tests,
|
436
604
|
...autoScoredScoringPreviewTab.tests,
|
437
605
|
...commonComponents.tests,
|
438
|
-
|
606
|
+
verifyWarningMessageDisappear: () => {
|
439
607
|
it('The error message should disappear if the user clicks anywhere in the upload file content wrapper', () => {
|
440
608
|
uploadResponsePage.inputTypeFile()
|
441
609
|
.parent()
|
442
610
|
.click();
|
443
|
-
|
611
|
+
uploadResponsePage.warningMessage()
|
444
612
|
.should('not.exist');
|
445
613
|
});
|
446
614
|
}
|
@@ -2,6 +2,8 @@ import crypto from 'crypto';
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
3
3
|
import "cypress-real-events/support";
|
4
4
|
import 'cypress-file-upload';
|
5
|
+
import { iePage } from './migrationHelpers/verifyIeQuestionData';
|
6
|
+
import { lrnPage } from './migrationHelpers/extractLrnQuestionData';
|
5
7
|
require('cy-verify-downloads').addCustomCommand();
|
6
8
|
//import addContext from "mochawesome/addContext";
|
7
9
|
|
@@ -140,4 +142,34 @@ Cypress.Commands.add('barsPreLoaderWait', () => {
|
|
140
142
|
cy.get('[id="question-item-instruction-loader"]')
|
141
143
|
.find('img')
|
142
144
|
.should('not.be.visible');
|
143
|
-
});
|
145
|
+
});
|
146
|
+
|
147
|
+
Cypress.Commands.add('learnosityLoaderWait', () => {
|
148
|
+
// cy.get('.lrn-spinner')
|
149
|
+
// .should('be.visible');
|
150
|
+
lrnPage.questionsLoader()
|
151
|
+
.should('not.be.visible');
|
152
|
+
lrnPage.questionWrapper()
|
153
|
+
.eq(0)
|
154
|
+
.should('be.visible');
|
155
|
+
});
|
156
|
+
|
157
|
+
Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
|
158
|
+
iePage.questionWrapper()
|
159
|
+
.then((elements) => {
|
160
|
+
if (retries <= 0) {
|
161
|
+
throw new Error('Itemengine questions did not lazy load in time');
|
162
|
+
};
|
163
|
+
if (elements.length < count) {
|
164
|
+
iePage.questionWrapper()
|
165
|
+
.last()
|
166
|
+
.scrollIntoView()
|
167
|
+
.wait(1000);
|
168
|
+
cy.lazyLoadPreviewQuestions(count, retries - 1)
|
169
|
+
};
|
170
|
+
cy.log('All question parts loaded');
|
171
|
+
});
|
172
|
+
iePage.barsPreloader()
|
173
|
+
.should('not.exist');
|
174
|
+
cy.learnosityLoaderWait();
|
175
|
+
})
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "itemengine-cypress-automation",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.131-updateILCrepo6March-02c78d1.0",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -35,4 +35,4 @@
|
|
35
35
|
"node-fetch": "^3.3.2",
|
36
36
|
"react-uuid": "^2.0.0"
|
37
37
|
}
|
38
|
-
}
|
38
|
+
}
|