itemengine-cypress-automation 1.0.128 → 1.0.130
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 +1 -1
- 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
@@ -0,0 +1,161 @@
|
|
1
|
+
import { uploadResponsePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Create question page - Upload Response: Preview', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Uploading file', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
17
|
+
});
|
18
|
+
|
19
|
+
it('User should be able to upload supported files in the upload section using link text \'device\' or the icon besides it and the file uploaded by the student should be listed below the upload area with the name of the file. Also, the uploaded file count should get updated in the file limit section', () => {
|
20
|
+
uploadResponsePage.steps.fileUploadAndVerify(['image.png']);
|
21
|
+
uploadResponsePage.steps.verifyUploadedFileLimitCount(1, 15);
|
22
|
+
});
|
23
|
+
|
24
|
+
it('CSS of uploaded file wrapper contents', { tags: 'css' }, () => {
|
25
|
+
utilities.verifyCSS(uploadResponsePage.uploadedFileLink().children(), {
|
26
|
+
'color': css.color.linkText,
|
27
|
+
'font-size': css.fontSize.default,
|
28
|
+
'font-weight': css.fontWeight.regular
|
29
|
+
});
|
30
|
+
uploadResponsePage.editDisplayTextIcon()
|
31
|
+
.verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
|
32
|
+
uploadResponsePage.addFileDescriptionIcon()
|
33
|
+
.verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
|
34
|
+
uploadResponsePage.deleteButton()
|
35
|
+
.verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
|
36
|
+
});
|
37
|
+
|
38
|
+
it('Accessibility of uploaded file wrapper contents', { tags: 'a11y' }, () => {
|
39
|
+
cy.checkAccessibility(uploadResponsePage.uploadedFilesSectionWrapper());
|
40
|
+
});
|
41
|
+
|
42
|
+
it('\'Edit display text\', \'Add file description\', \'Delete\' icon buttons should be displayed next to the file name of the uploaded file', () => {
|
43
|
+
uploadResponsePage.steps.uploadedFileContentsPreviewTab(0, 'image.png');
|
44
|
+
});
|
45
|
+
|
46
|
+
it('User should also be able to upload supported files in the upload section using drag and drop feature', () => {
|
47
|
+
uploadResponsePage.steps.fileUploadAndVerify(['sample.jpg'], { subjectType: 'drag-n-drop' });
|
48
|
+
});
|
49
|
+
|
50
|
+
it('User should be able to upload multiple files at once and the uploaded file count should get updated in the file limit section', () => {
|
51
|
+
uploadResponsePage.steps.uploadFile(['uploads/sample.csv', 'uploads/sample.gif']);
|
52
|
+
uploadResponsePage.steps.verifyUploadedFileLimitCount(4, 15);
|
53
|
+
});
|
54
|
+
|
55
|
+
it('When the user uploads a file that has already been added, then file upload error message \'*File_name* has already been selected.\' should be displayed above the uploaded files', () => {
|
56
|
+
uploadResponsePage.steps.uploadFile('uploads/image.png');
|
57
|
+
utilities.verifyInnerText(uploadResponsePage.warningMessage(), 'image.png has already been selected.');
|
58
|
+
});
|
59
|
+
|
60
|
+
it('CSS of file upload warning message', { tags: 'css' }, () => {
|
61
|
+
utilities.verifyCSS(uploadResponsePage.warningMessage(), {
|
62
|
+
'color': css.color.warningMessage,
|
63
|
+
'font-size': css.fontSize.default,
|
64
|
+
'font-weight': css.fontWeight.regular
|
65
|
+
});
|
66
|
+
});
|
67
|
+
|
68
|
+
it('Accessibility of file upload warning message', { tags: 'a11y' }, () => {
|
69
|
+
cy.checkAccessibility(uploadResponsePage.warningMessage());
|
70
|
+
});
|
71
|
+
|
72
|
+
uploadResponsePage.tests.verifyWarningMessageDisappear();
|
73
|
+
|
74
|
+
it('During file upload process, a progress bar, file name, file size, a cross icon to stop upload should be present, the file count should not change while the file is being uploaded, on clicking on the \'cross icon to stop upload\' button, the file should not get uploaded', () => {
|
75
|
+
uploadResponsePage.steps.uploadFile('uploads/sample1.zip');
|
76
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadingProgressBar(), 'visible');
|
77
|
+
utilities.verifyInnerText(uploadResponsePage.uploadingFileName(), 'sample1.zip');
|
78
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadingFileName(), 'visible');
|
79
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.stopUploadingButton(), 'visible');
|
80
|
+
uploadResponsePage.steps.verifyUploadedFileLimitCount(4, 15);
|
81
|
+
uploadResponsePage.steps.stopUploadingFile();
|
82
|
+
uploadResponsePage.steps.verifyUploadedFileName(0, 'image.png');
|
83
|
+
uploadResponsePage.steps.verifyFileNotExistsInUploadedFileSection('sample1.zip');
|
84
|
+
uploadResponsePage.steps.verifyUploadedFileLimitCount(4, 15);
|
85
|
+
utilities.verifyElementCount(uploadResponsePage.uploadedFileWrapper(), 4);
|
86
|
+
});
|
87
|
+
|
88
|
+
it('CSS of File upload - In progress state', { tags: 'css' }, () => {
|
89
|
+
uploadResponsePage.steps.switchToEditTab();
|
90
|
+
uploadResponsePage.steps.expandFileSizeLimitDropdown();
|
91
|
+
uploadResponsePage.steps.selectFileSizeLimit('100');
|
92
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
93
|
+
cy.log('uploading a file to verify in progress CSS')
|
94
|
+
uploadResponsePage.steps.verifyInprogressUploadFileCSS();
|
95
|
+
});
|
96
|
+
|
97
|
+
it('Accessibility of File upload - In progress state', { tags: 'a11y' }, () => {
|
98
|
+
cy.log('Switching to edit tab and again to preview tab')
|
99
|
+
uploadResponsePage.steps.resetQuestionPreview();
|
100
|
+
cy.log('uploading a file to verify in progress CSS')
|
101
|
+
uploadResponsePage.steps.uploadFile('uploads/20mbFile.png')
|
102
|
+
cy.checkAccessibility(uploadResponsePage.uploadingFileName().parents('.uploading-documents'));
|
103
|
+
cy.log('Re-switching to edit tab and again to preview tab')
|
104
|
+
uploadResponsePage.steps.resetQuestionPreview();
|
105
|
+
});
|
106
|
+
|
107
|
+
it('On clicking on the file name, user should be able to download the file', () => {
|
108
|
+
uploadResponsePage.steps.uploadFile('uploads/image.png');
|
109
|
+
cy.verifyUploadFilePreviewDownload('image.png');
|
110
|
+
cy.wait(5000);
|
111
|
+
});
|
112
|
+
});
|
113
|
+
|
114
|
+
//Added to manual testing list
|
115
|
+
describe.skip('Allow students to capture photos preview', () => {
|
116
|
+
abortEarlySetup();
|
117
|
+
before(() => {
|
118
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
119
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
120
|
+
});
|
121
|
+
|
122
|
+
it('Camera icon should be displayed before link text \'capture an image\'', () => {
|
123
|
+
});
|
124
|
+
|
125
|
+
it('When the user clicks on the link text \'capture an image\' a \'Capture image\' popup should open', () => {
|
126
|
+
|
127
|
+
});
|
128
|
+
|
129
|
+
it('CSS of \'Capture image\' popup', () => {
|
130
|
+
|
131
|
+
});
|
132
|
+
|
133
|
+
it('On \'Capture image\' popup following should be displayed - \'Capture image\' title text, Camera preview, Capture and Cancel buttons', () => {
|
134
|
+
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When the user clicks on \'Cancel\' button the \'Capture image\' popup should close', () => {
|
138
|
+
|
139
|
+
});
|
140
|
+
|
141
|
+
it('When the user clicks on \'Capture\' button, then an image should get captured and a preview of the captured image should be displayed in place of the camera preview and also two buttons \'Retake\' and \'Save\' should be displayed in the popup and \'Cancel\' and \'Capture\' buttons should not be displayed in the popup', () => {
|
142
|
+
|
143
|
+
});
|
144
|
+
|
145
|
+
it('When the user clicks on \'Save\' button, it should upload the captured image in the response', () => {
|
146
|
+
|
147
|
+
});
|
148
|
+
|
149
|
+
it('The captured image should be saved in .jpeg format and the 1st image should be saved with the name \'Photo.jpeg\'', () => {
|
150
|
+
|
151
|
+
});
|
152
|
+
|
153
|
+
it('If the user uploads another image the name should be \'Photo-1.jpeg\' and so on', () => {
|
154
|
+
//check till Photo-2.jpeg
|
155
|
+
|
156
|
+
});
|
157
|
+
|
158
|
+
it('When the user clicks on \'Retake\' button, it should take the user back to the capture an image flow where the user should be able to capture another image', () => {
|
159
|
+
});
|
160
|
+
});
|
161
|
+
});
|
@@ -0,0 +1,250 @@
|
|
1
|
+
import { uploadResponsePage } from "../../../pages";
|
2
|
+
import { commonComponents } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
describe('Create question page - Upload Response: Preview', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Virus Scanning', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
16
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
17
|
+
});
|
18
|
+
|
19
|
+
it('When user uploads any file without any virus, the system should scan the file for viruses and \'Scanning for viruses…\' message should be displayed along with a pre-loader', () => {
|
20
|
+
uploadResponsePage.steps.uploadFile('uploads/sample.jpg');
|
21
|
+
uploadResponsePage.steps.verifyScanningForVirusMessageAndPreLoader();
|
22
|
+
});
|
23
|
+
|
24
|
+
it('As long as the file is scanning for viruses, the users should not be able to download the file', () => {
|
25
|
+
uploadResponsePage.steps.verifyInabilityOfFileDownloadWhenVirusScanningIsInProgress();
|
26
|
+
});
|
27
|
+
|
28
|
+
it('As soon as the scanning for viruses is complete, the preloader should disappear', () => {
|
29
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.scanningForVirusPreLoader(), 'hidden');
|
30
|
+
});
|
31
|
+
|
32
|
+
it('When the user uploads a file containing virus \'Error: A virus was detected, please upload another file\' error message should be displayed inline with file name, the uploaded file count should increase after a virus file gets uploaded', () => {
|
33
|
+
uploadResponsePage.steps.fileUploadAndVerify(['sampleVirus.zip']);
|
34
|
+
uploadResponsePage.steps.verifyVirusScanningErrorMessage();
|
35
|
+
cy.log('checking if uploaded file count increases after a virus file gets uploaded')
|
36
|
+
uploadResponsePage.steps.verifyUploadedFileLimitCount(2, 15);
|
37
|
+
});
|
38
|
+
|
39
|
+
it('CSS of virus error message', { tags: 'css' }, () => {
|
40
|
+
uploadResponsePage.uploadedFileWrapper()
|
41
|
+
.eq(1)
|
42
|
+
.within(() => {
|
43
|
+
utilities.verifyCSS(uploadResponsePage.virusErrorMessageWrapper(), {
|
44
|
+
'color': css.color.errorText,
|
45
|
+
'font-size': css.fontSize.small,
|
46
|
+
'font-weight': css.fontWeight.regular
|
47
|
+
});
|
48
|
+
});
|
49
|
+
});
|
50
|
+
|
51
|
+
it('User should not be able to download the file containing virus and the file name should be in disabled state', () => {
|
52
|
+
uploadResponsePage.steps.verifyInabilityOfFileDownloadWhenVirusScanningIsInProgress();
|
53
|
+
});
|
54
|
+
});
|
55
|
+
|
56
|
+
describe('Renaming an uploaded file', () => {
|
57
|
+
abortEarlySetup();
|
58
|
+
before(() => {
|
59
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
60
|
+
cy.log('Uploading a file in preview tab');
|
61
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
62
|
+
uploadResponsePage.steps.fileUploadAndVerify(['image.png']);
|
63
|
+
});
|
64
|
+
|
65
|
+
it('On hovering over the \'Edit display text\' icon button, tooltip \'Edit display text\' should be displayed', () => {
|
66
|
+
utilities.hoverOverElement(uploadResponsePage.editDisplayTextIcon());
|
67
|
+
utilities.verifyInnerText(commonComponents.tooltipText(), 'Edit display text');
|
68
|
+
});
|
69
|
+
|
70
|
+
it('Clicking on the \'Edit display text\' icon button should open the \'Display Text\' popup with label \'Display Text\' and the input field in the popup should be prefilled with the name of the file and the name text should be selected by default and \'Save\' and \'Cancel\' buttons should be displayed', () => {
|
71
|
+
uploadResponsePage.steps.clickOnEditDisplayTextIcon(0);
|
72
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.dialogBox(), 'visible');
|
73
|
+
utilities.verifyInnerText(uploadResponsePage.dialogBoxTitle(), 'Display text');
|
74
|
+
uploadResponsePage.steps.verifyEditDisplayTextPopupInputFieldAndSelectedText();
|
75
|
+
utilities.verifyInnerText(uploadResponsePage.acceptButton(), 'Save');
|
76
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.acceptButton(), 'visible');
|
77
|
+
utilities.verifyInnerText(uploadResponsePage.cancelButton(), 'Cancel');
|
78
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.cancelButton(), 'visible');
|
79
|
+
});
|
80
|
+
|
81
|
+
it('CSS of the \'Display Text\' popup', { tags: 'css' }, () => {
|
82
|
+
utilities.verifyCSS(uploadResponsePage.dialogBoxTitle(), {
|
83
|
+
'color': css.color.questionHeading,
|
84
|
+
'font-size': css.fontSize.heading,
|
85
|
+
'font-weight': css.fontWeight.semibold
|
86
|
+
});
|
87
|
+
utilities.verifyCSS(uploadResponsePage.editDisplayTextPopupInputField(), {
|
88
|
+
'color': css.color.text,
|
89
|
+
'font-size': css.fontSize.heading,
|
90
|
+
'font-weight': css.fontWeight.regular,
|
91
|
+
'background-color': css.color.defaultBackground
|
92
|
+
});
|
93
|
+
utilities.verifyCSS(uploadResponsePage.acceptButton(), {
|
94
|
+
'color': css.color.primaryBtn,
|
95
|
+
'font-size': css.fontSize.default,
|
96
|
+
'font-weight': css.fontWeight.semibold,
|
97
|
+
'background-color': css.color.primaryBtnBg
|
98
|
+
});
|
99
|
+
utilities.verifyCSS(uploadResponsePage.cancelButton(), {
|
100
|
+
'color': css.color.secondaryBtn,
|
101
|
+
'font-size': css.fontSize.default,
|
102
|
+
'font-weight': css.fontWeight.semibold,
|
103
|
+
'background-color': css.color.transparent
|
104
|
+
});
|
105
|
+
});
|
106
|
+
|
107
|
+
it('Accessibility of the \'Display Text\' popup', { tags: 'a11y' }, () => {
|
108
|
+
cy.checkAccessibility(uploadResponsePage.dialogBox());
|
109
|
+
});
|
110
|
+
|
111
|
+
it('When the user removes the name of the file from the input field in the \'Display Text\' popup, then placeholder text \'Enter Display Text\' should be displayed', () => {
|
112
|
+
uploadResponsePage.steps.clearEditDisplayTextPopupInputField();
|
113
|
+
uploadResponsePage.steps.verifyEditDisplayTextPopupInputFieldPlaceholderText();
|
114
|
+
});
|
115
|
+
|
116
|
+
it('When the user clicks on \'Save\' button, a validation error text \'Display text is required.\' should be displayed below the input field', () => {
|
117
|
+
uploadResponsePage.steps.clickAcceptButtonInPopup();
|
118
|
+
utilities.verifyInnerText(uploadResponsePage.errorMessage(), 'Error: Display text is required.');
|
119
|
+
});
|
120
|
+
|
121
|
+
it('When the user enters text in Display Text input field i.e. updates the file name, then the validation text should disappear and when user clicks on \'Save\' button, the name of the file should get updated', () => {
|
122
|
+
uploadResponsePage.steps.enterTextInEditDisplayTextPopupInputField('imageEdited.png');
|
123
|
+
uploadResponsePage.steps.verifyTextInEditDisplayTextPopupInputField('imageEdited.png');
|
124
|
+
uploadResponsePage.steps.verifyErrorMessageIsNotDisplayed();
|
125
|
+
uploadResponsePage.steps.clickAcceptButtonInPopup();
|
126
|
+
uploadResponsePage.steps.verifyUploadedFileName(0, 'imageEdited.png');
|
127
|
+
});
|
128
|
+
|
129
|
+
it('When the user updates the file name and clicks on the \'Cancel\' button, the latest changes should be reverted and the \'Display Text\' popup should close', () => {
|
130
|
+
cy.log('clicking on edit display text button')
|
131
|
+
uploadResponsePage.steps.clickOnEditDisplayTextIcon(0);
|
132
|
+
uploadResponsePage.steps.clearEditDisplayTextPopupInputField();
|
133
|
+
uploadResponsePage.steps.enterTextInEditDisplayTextPopupInputField('imageEdited2.png');
|
134
|
+
uploadResponsePage.steps.clickCancelButtonInPopup();
|
135
|
+
uploadResponsePage.steps.verifyUploadedFileName(0, 'imageEdited.png');
|
136
|
+
});
|
137
|
+
|
138
|
+
it('If the user tries to download file after renaming, the file should get downloaded with the original name', () => {
|
139
|
+
cy.verifyUploadFilePreviewDownload('image.png');
|
140
|
+
});
|
141
|
+
});
|
142
|
+
|
143
|
+
describe('Add a description for a file', () => {
|
144
|
+
abortEarlySetup();
|
145
|
+
before(() => {
|
146
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
147
|
+
cy.log('Uploading a file in preview tab');
|
148
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
149
|
+
uploadResponsePage.steps.fileUploadAndVerify(['image.png']);
|
150
|
+
});
|
151
|
+
|
152
|
+
it('On hovering over the \'Add file description\' icon button, tooltip \'Add file description\' should be displayed', () => {
|
153
|
+
utilities.hoverOverElement(uploadResponsePage.addFileDescriptionIcon());
|
154
|
+
utilities.verifyInnerText(commonComponents.tooltipText(), 'Add file description');
|
155
|
+
});
|
156
|
+
|
157
|
+
it('When the user clicks on the \'Add file description\' icon button, an input area should be displayed along with a placeholder text: \'Add file description\'', () => {
|
158
|
+
uploadResponsePage.steps.clickOnAddFileDescriptionIcon();
|
159
|
+
uploadResponsePage.steps.verifyAddFileDescriptionInputFieldPlaceholderText();
|
160
|
+
});
|
161
|
+
|
162
|
+
it('CSS of \'Add file description\' input field', { tags: 'css' }, () => {
|
163
|
+
utilities.verifyCSS(uploadResponsePage.addFileDescriptionInput(), {
|
164
|
+
'color': css.color.optionsText,
|
165
|
+
'font-size': css.fontSize.default,
|
166
|
+
'font-weight': css.fontWeight.regular
|
167
|
+
});
|
168
|
+
});
|
169
|
+
|
170
|
+
it('Accessibility of \'Add file description\' input field', { tags: 'a11y' }, () => {
|
171
|
+
cy.checkAccessibility(uploadResponsePage.addFileDescriptionInput().parents('.placeholder'));
|
172
|
+
});
|
173
|
+
|
174
|
+
it('User should be able to add description text for uploaded file', () => {
|
175
|
+
uploadResponsePage.steps.enterTextInAddFileDescriptionInputField('This is an image');
|
176
|
+
uploadResponsePage.steps.verifyTextInAddFileDescriptionInputField('This is an image');
|
177
|
+
});
|
178
|
+
|
179
|
+
it('When user again clicks on the \'Add file description\' icon button, the \'Add file description\' input field section should get hidden', () => {
|
180
|
+
uploadResponsePage.steps.clickOnAddFileDescriptionIcon();
|
181
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionInput(), 'notExist');
|
182
|
+
});
|
183
|
+
});
|
184
|
+
|
185
|
+
describe('Delete the uploaded file', () => {
|
186
|
+
abortEarlySetup();
|
187
|
+
before(() => {
|
188
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
189
|
+
cy.log('Uploading a file in preview tab');
|
190
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
191
|
+
uploadResponsePage.steps.fileUploadAndVerify(['image.png']);
|
192
|
+
});
|
193
|
+
|
194
|
+
it('On hovering over the \'Delete\' icon button, tooltip \'Delete\' should be displayed and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
|
195
|
+
utilities.hoverOverElement(uploadResponsePage.deleteButton())
|
196
|
+
utilities.verifyInnerText(commonComponents.tooltipText(), 'Delete');
|
197
|
+
utilities.hoverAwayFromElement();
|
198
|
+
utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'notExist');
|
199
|
+
});
|
200
|
+
|
201
|
+
it('When the user clicks on the \'Delete\' icon button, then \'Delete file\' popup with label \'Delete file\' and message \'Are you sure you want to delete this file?\' should be displayed and \'Delete File\' and \'Cancel\' buttons should be displayed', () => {
|
202
|
+
uploadResponsePage.steps.deleteFile();
|
203
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.dialogBox(), 'visible');
|
204
|
+
utilities.verifyInnerText(uploadResponsePage.dialogBoxTitle(), 'Delete file');
|
205
|
+
utilities.verifyInnerText(uploadResponsePage.deletePopupContent(), 'Are you sure you want to delete this file?');
|
206
|
+
utilities.verifyInnerText(uploadResponsePage.cancelButton(), 'Cancel');
|
207
|
+
utilities.verifyInnerText(uploadResponsePage.acceptButton(), 'Delete file');
|
208
|
+
});
|
209
|
+
|
210
|
+
it('CSS of the \'Delete file\' popup', { tags: 'css' }, () => {
|
211
|
+
utilities.verifyCSS(uploadResponsePage.dialogBoxTitle().find('span'), {
|
212
|
+
'color': css.color.questionHeading,
|
213
|
+
'font-size': css.fontSize.heading,
|
214
|
+
'font-weight': css.fontWeight.bold
|
215
|
+
});
|
216
|
+
utilities.verifyCSS(uploadResponsePage.cancelButton(), {
|
217
|
+
'color': css.color.secondaryBtn,
|
218
|
+
'font-size': css.fontSize.default,
|
219
|
+
'font-weight': css.fontWeight.semibold,
|
220
|
+
'background-color': css.color.transparent
|
221
|
+
});
|
222
|
+
utilities.verifyCSS(uploadResponsePage.acceptButton(), {
|
223
|
+
'color': css.color.primaryBtn,
|
224
|
+
'font-size': css.fontSize.default,
|
225
|
+
'font-weight': css.fontWeight.semibold,
|
226
|
+
'background-color': css.color.deleteBtn
|
227
|
+
});
|
228
|
+
});
|
229
|
+
|
230
|
+
it('Accessibility of the \'Delete file\' popup', { tags: 'a11y' }, () => {
|
231
|
+
cy.checkAccessibility(uploadResponsePage.dialogBox());
|
232
|
+
});
|
233
|
+
|
234
|
+
it('When the user clicks on the \'Cancel\' button, then \'Delete File\' popup should close and file should not get deleted', () => {
|
235
|
+
cy.log('Clicking on Delete icon for popup to appear')
|
236
|
+
uploadResponsePage.steps.deleteFile();
|
237
|
+
cy.log('Clicking on \'Cancel\' button')
|
238
|
+
uploadResponsePage.steps.clickCancelButtonInPopup();
|
239
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadedFileWrapper(), 'exist');
|
240
|
+
});
|
241
|
+
|
242
|
+
it('When the user clicks on the \'Delete File\' button, the delete confirmation dialog box should disappear and the uploaded file should get deleted', () => {
|
243
|
+
uploadResponsePage.steps.deleteFile();
|
244
|
+
uploadResponsePage.steps.clickAcceptButtonInPopup();
|
245
|
+
uploadResponsePage.steps.verifyUploadedFileLimitCount(0, 15);
|
246
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadedFileWrapper(), 'notExist');
|
247
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.fileName(), 'notExist');
|
248
|
+
});
|
249
|
+
});
|
250
|
+
});
|
@@ -2,37 +2,7 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
|
|
2
2
|
import utilities from "../../support/helpers/utilities";
|
3
3
|
import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
|
4
4
|
import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
|
5
|
-
import {
|
6
|
-
|
7
|
-
Cypress.Commands.add('learnosityLoaderWait', () => {
|
8
|
-
// cy.get('.lrn-spinner')
|
9
|
-
// .should('be.visible');
|
10
|
-
lrnPage.questionsLoader()
|
11
|
-
.should('not.be.visible');
|
12
|
-
lrnPage.questionWrapper()
|
13
|
-
.eq(0)
|
14
|
-
.should('be.visible');
|
15
|
-
});
|
16
|
-
|
17
|
-
Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
|
18
|
-
iePage.questionWrapper()
|
19
|
-
.then((elements) => {
|
20
|
-
if (retries <= 0) {
|
21
|
-
throw new Error('Itemengine questions did not lazy load in time');
|
22
|
-
};
|
23
|
-
if (elements.length < count) {
|
24
|
-
iePage.questionWrapper()
|
25
|
-
.last()
|
26
|
-
.scrollIntoView()
|
27
|
-
.wait(1000);
|
28
|
-
cy.lazyLoadPreviewQuestions(count, retries - 1)
|
29
|
-
};
|
30
|
-
cy.log('All question parts loaded');
|
31
|
-
});
|
32
|
-
iePage.barsPreloader()
|
33
|
-
.should('not.exist');
|
34
|
-
cy.learnosityLoaderWait();
|
35
|
-
})
|
5
|
+
import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
|
36
6
|
|
37
7
|
const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
|
38
8
|
const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
|
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
|
|
127
97
|
currQuestionType = lrnQuestionTypesENUM.mcq
|
128
98
|
}
|
129
99
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
134
|
-
case lrnQuestionTypesENUM.essayResponse:
|
135
|
-
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
-
case lrnQuestionTypesENUM.drawingResponse:
|
137
|
-
return;
|
138
|
-
default: throw new Error('Invalid lrn question type');
|
139
|
-
}
|
100
|
+
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
101
|
+
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
102
|
+
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
140
103
|
}
|
141
104
|
});
|
142
105
|
}
|
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
|
|
2
2
|
import utilities from "../../support/helpers/utilities";
|
3
3
|
import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
|
4
4
|
import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
|
5
|
-
import {
|
5
|
+
import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
|
6
6
|
|
7
|
-
Cypress.
|
8
|
-
// cy.get('.lrn-spinner')
|
9
|
-
// .should('be.visible');
|
10
|
-
lrnPage.questionsLoader()
|
11
|
-
.should('not.be.visible');
|
12
|
-
lrnPage.questionWrapper()
|
13
|
-
.eq(0)
|
14
|
-
.should('be.visible');
|
15
|
-
});
|
16
|
-
|
17
|
-
Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
|
18
|
-
iePage.questionWrapper()
|
19
|
-
.then((elements) => {
|
20
|
-
if (retries <= 0) {
|
21
|
-
throw new Error('Itemengine questions did not lazy load in time');
|
22
|
-
};
|
23
|
-
if (elements.length < count) {
|
24
|
-
iePage.questionWrapper()
|
25
|
-
.last()
|
26
|
-
.scrollIntoView()
|
27
|
-
.wait(1000);
|
28
|
-
cy.lazyLoadPreviewQuestions(count, retries - 1)
|
29
|
-
};
|
30
|
-
cy.log('All question parts loaded');
|
31
|
-
});
|
32
|
-
iePage.barsPreloader()
|
33
|
-
.should('not.exist');
|
34
|
-
cy.learnosityLoaderWait();
|
35
|
-
})
|
36
|
-
|
37
|
-
const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
|
7
|
+
const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
|
38
8
|
const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
|
39
9
|
let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
|
40
10
|
let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
|
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
|
|
43
13
|
let lrnQuestionDataArr = [];
|
44
14
|
let lrnGradingDataArr = [];
|
45
15
|
|
46
|
-
let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(900, 1000);//["
|
16
|
+
let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(900, 1000);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
|
47
17
|
|
48
18
|
if (referenceIds.length > 0) {
|
49
19
|
describe('Migration item check for MCQ questions', () => {
|
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
|
|
127
97
|
currQuestionType = lrnQuestionTypesENUM.mcq
|
128
98
|
}
|
129
99
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
134
|
-
case lrnQuestionTypesENUM.essayResponse:
|
135
|
-
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
-
case lrnQuestionTypesENUM.drawingResponse:
|
137
|
-
return;
|
138
|
-
default: throw new Error('Invalid lrn question type');
|
139
|
-
}
|
100
|
+
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
101
|
+
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
102
|
+
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
140
103
|
}
|
141
104
|
});
|
142
105
|
}
|
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
|
|
2
2
|
import utilities from "../../support/helpers/utilities";
|
3
3
|
import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
|
4
4
|
import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
|
5
|
-
import {
|
5
|
+
import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
|
6
6
|
|
7
|
-
Cypress.
|
8
|
-
// cy.get('.lrn-spinner')
|
9
|
-
// .should('be.visible');
|
10
|
-
lrnPage.questionsLoader()
|
11
|
-
.should('not.be.visible');
|
12
|
-
lrnPage.questionWrapper()
|
13
|
-
.eq(0)
|
14
|
-
.should('be.visible');
|
15
|
-
});
|
16
|
-
|
17
|
-
Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
|
18
|
-
iePage.questionWrapper()
|
19
|
-
.then((elements) => {
|
20
|
-
if (retries <= 0) {
|
21
|
-
throw new Error('Itemengine questions did not lazy load in time');
|
22
|
-
};
|
23
|
-
if (elements.length < count) {
|
24
|
-
iePage.questionWrapper()
|
25
|
-
.last()
|
26
|
-
.scrollIntoView()
|
27
|
-
.wait(1000);
|
28
|
-
cy.lazyLoadPreviewQuestions(count, retries - 1)
|
29
|
-
};
|
30
|
-
cy.log('All question parts loaded');
|
31
|
-
});
|
32
|
-
iePage.barsPreloader()
|
33
|
-
.should('not.exist');
|
34
|
-
cy.learnosityLoaderWait();
|
35
|
-
})
|
36
|
-
|
37
|
-
const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
|
7
|
+
const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
|
38
8
|
const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
|
39
9
|
let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
|
40
10
|
let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
|
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
|
|
43
13
|
let lrnQuestionDataArr = [];
|
44
14
|
let lrnGradingDataArr = [];
|
45
15
|
|
46
|
-
let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(100, 200);//["
|
16
|
+
let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(100, 200);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
|
47
17
|
|
48
18
|
if (referenceIds.length > 0) {
|
49
19
|
describe('Migration item check for MCQ questions', () => {
|
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
|
|
127
97
|
currQuestionType = lrnQuestionTypesENUM.mcq
|
128
98
|
}
|
129
99
|
if (migrationQuestionTypesLrn.includes(currQuestionType)) {
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
134
|
-
case lrnQuestionTypesENUM.essayResponse:
|
135
|
-
case lrnQuestionTypesENUM.essayResponseBasic:
|
136
|
-
case lrnQuestionTypesENUM.drawingResponse:
|
137
|
-
return;
|
138
|
-
default: throw new Error('Invalid lrn question type');
|
139
|
-
}
|
100
|
+
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
101
|
+
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
102
|
+
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
140
103
|
}
|
141
104
|
});
|
142
105
|
}
|