itemengine-cypress-automation 1.0.324 → 1.0.326-IEI-4285-168e56f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import { correctAnswerViewPage, uploadResponsePage, itemPreviewPage, studentView
|
|
2
2
|
import { gradingViewPage } from "../../../pages";
|
3
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
4
|
import utilities from "../../../support/helpers/utilities";
|
5
|
+
import { largeFileName } from './thumbNail.smoke';
|
5
6
|
const css = Cypress.env('css');
|
6
7
|
let gradingAndCorrectAnsView = ['Grading view', 'Correct answer view']
|
7
8
|
const views = utilities.getViews(gradingAndCorrectAnsView);
|
@@ -70,6 +71,46 @@ describe('Create item page - Upload response: Grading view, Correct answer view
|
|
70
71
|
cy.verifyUploadFilePreviewDownload('highlightImage.jpg');
|
71
72
|
});
|
72
73
|
});
|
74
|
+
|
75
|
+
describe('Upload file with a very large name', { tags: 'smoke' }, () => {
|
76
|
+
abortEarlySetup();
|
77
|
+
before(() => {
|
78
|
+
cy.log('Navigating to Upload response question type');
|
79
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
80
|
+
cy.barsPreLoaderWait();
|
81
|
+
uploadResponsePage.steps.allotPoints(10);
|
82
|
+
uploadResponsePage.steps.addTextInQuestionInstructionsInputField('Question text');
|
83
|
+
uploadResponsePage.steps.setMaximumNumberOfFiles(3);
|
84
|
+
uploadResponsePage.steps.clickOnSaveQuestionButton();
|
85
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
86
|
+
//Global variable issue, not working inside before
|
87
|
+
itemPreviewPage.referenceID()
|
88
|
+
.invoke('text')
|
89
|
+
.then(($refID) => {
|
90
|
+
itemReferenceID = $refID;
|
91
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
92
|
+
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
93
|
+
|
94
|
+
uploadResponsePage.steps.clickOnEditDisplayTextIcon(0);
|
95
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.dialogBox(), 'exist');
|
96
|
+
uploadResponsePage.steps.enterTextInEditDisplayTextPopupInputField(largeFileName);
|
97
|
+
uploadResponsePage.steps.verifyTextInEditDisplayTextPopupInputField(largeFileName);
|
98
|
+
uploadResponsePage.steps.clickAcceptButtonInPopup();
|
99
|
+
uploadResponsePage.steps.verifyUploadedFileName(0, largeFileName);
|
100
|
+
studentViewPage.steps.submitResponse();
|
101
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
102
|
+
});
|
103
|
+
});
|
104
|
+
|
105
|
+
it('Thumbnail should not get compressed', () => {
|
106
|
+
uploadResponsePage.imageThumbnailGradingPage()
|
107
|
+
.invoke('css', ['width', 'height'])
|
108
|
+
.then(({ width, height }) => {
|
109
|
+
expect(Math.round(parseFloat(width))).to.be.closeTo(80, 1);
|
110
|
+
expect(Math.round(parseFloat(height))).to.be.closeTo(80, 1);
|
111
|
+
});
|
112
|
+
});
|
113
|
+
});
|
73
114
|
}
|
74
115
|
|
75
116
|
if (views.includes('Correct answer view')) {
|
@@ -2,11 +2,12 @@ import { uploadResponsePage, itemPreviewPage } from "../../../pages";
|
|
2
2
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
3
|
import utilities from "../../../support/helpers/utilities";
|
4
4
|
const css = Cypress.env('css');
|
5
|
-
let previewContentViews = ['Question preview'
|
5
|
+
let previewContentViews = ['Question preview'];
|
6
6
|
const views = utilities.getViews(previewContentViews);
|
7
7
|
var itemReferenceID = "";
|
8
8
|
const filename = ['sample.csv', 'sample.xlsx', 'sample.gif', 'sample.jpg', 'sample.pdf', 'image.png', 'sample.ppt', 'sample.pub', 'sample.rtf', 'sample.txt', 'sample.doc', 'sample.xps', 'sample.zip', 'sample.heif', 'sample.heic'];
|
9
9
|
const fileThumbNail = ['notExist', 'notExist', 'visible', 'visible', 'notExist', 'visible', 'notExist', 'notExist', 'notExist', 'notExist', 'notExist', 'notExist', 'notExist', 'notExist', 'notExist']
|
10
|
+
export const largeFileName = 'nature imagenature imagenature imagenature imagenature imagenature imagenature imagenature imagenature imagenature imagenature imagenature imagenature';
|
10
11
|
|
11
12
|
describe('Create item page - Upload response : Preview contents', () => {
|
12
13
|
before(() => {
|
@@ -88,7 +89,7 @@ describe('Create item page - Upload response : Preview contents', () => {
|
|
88
89
|
});
|
89
90
|
|
90
91
|
it(`${view} - When user clicks on the thumbnail then popup should open, and on clicking the close button the popup should close and the uploaded files should be displayed`, () => {
|
91
|
-
utilities.verifyElementCount(uploadResponsePage.imageThumbNail(),
|
92
|
+
utilities.verifyElementCount(uploadResponsePage.imageThumbNail(), 1);
|
92
93
|
uploadResponsePage.steps.clickOnImageThumbNail();
|
93
94
|
uploadResponsePage.steps.verifyImagePopUpDetail();
|
94
95
|
cy.eyesCheckWindow(`${view} - Thumbnail popup`);
|
@@ -105,6 +106,21 @@ describe('Create item page - Upload response : Preview contents', () => {
|
|
105
106
|
utilities.verifyElementCount(uploadResponsePage.fileName(), 1);
|
106
107
|
});
|
107
108
|
|
109
|
+
it(`${view} - When user uploads file with a very large name then thumbnail should not get compressed`, () => {
|
110
|
+
uploadResponsePage.steps.clickOnEditDisplayTextIcon(0);
|
111
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.dialogBox(), 'exist');
|
112
|
+
uploadResponsePage.steps.enterTextInEditDisplayTextPopupInputField(largeFileName);
|
113
|
+
uploadResponsePage.steps.verifyTextInEditDisplayTextPopupInputField(largeFileName);
|
114
|
+
uploadResponsePage.steps.clickAcceptButtonInPopup();
|
115
|
+
uploadResponsePage.steps.verifyUploadedFileName(0, largeFileName);
|
116
|
+
uploadResponsePage.imageThumbNail()
|
117
|
+
.invoke('css', ['width', 'height'])
|
118
|
+
.then(({ width, height }) => {
|
119
|
+
expect(Math.round(parseFloat(width))).to.be.closeTo(80, 1);
|
120
|
+
expect(Math.round(parseFloat(height))).to.be.closeTo(80, 1);
|
121
|
+
});
|
122
|
+
});
|
123
|
+
|
108
124
|
it(`${view} - When user uploads different file types then only image files should be displayed with thumbnail`, () => {
|
109
125
|
for (let number = 0; number < 13; number++) {
|
110
126
|
uploadResponsePage.steps.deleteFile();
|
@@ -90,13 +90,14 @@ const selectors = {
|
|
90
90
|
maximumFileSize: () => cy.get('[class*="UploadQuestionPreviewstyle__MaxFileLimitDesc"]'),
|
91
91
|
unSupportedFileInfoIcon: () => cy.get('[class*="UploadedDocumentsstyle__UnSupportedFileIcon"]'),
|
92
92
|
//Thumb nail
|
93
|
-
imageThumbNail: () => cy.get('[class*="UploadedDocumentsstyle__ImageContainer"]'),
|
93
|
+
imageThumbNail: () => cy.get('img[class*="UploadedDocumentsstyle__ImageContainer"]'),
|
94
94
|
imageThumbNailButton: () => cy.get('[class*="UploadedDocumentsstyle__ImageContainerButton"]'),
|
95
95
|
popUpWrapper: () => cy.get('[class*="UploadedDocumentsstyle__ImagePopupDiv"]'),
|
96
96
|
imageDisplayedInsidePopUp: () => cy.get('.image-upload-popup-wrapper'),
|
97
97
|
downloadIconOfPopUp: () => cy.get('.download-icon'),
|
98
98
|
downloadTextOfPopUp: () => cy.get('[class*="UploadedDocumentsstyle__DownloadTextWrapper"]'),
|
99
99
|
closePopUpButton: () => cy.get('.close-popup-btn'),
|
100
|
+
imageThumbnailGradingPage: () => cy.get('img[class*="UploadQuestionPreviewstyle__ImageContainer"]'),
|
100
101
|
}
|
101
102
|
|
102
103
|
const steps = {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "itemengine-cypress-automation",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.326-IEI-4285-168e56f.0",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -52,4 +52,4 @@
|
|
52
52
|
"devDependencies": {
|
53
53
|
"@applitools/eyes-cypress": "^3.47.0"
|
54
54
|
}
|
55
|
-
}
|
55
|
+
}
|