abramenal / cypress-file-upload

File upload testing made easy
https://npm.im/cypress-file-upload
MIT License
496 stars 89 forks source link

[Bug] failed upload #317

Open FahirL opened 2 years ago

FahirL commented 2 years ago

Hey, I have a problem with the upload. One file is successfully uploaded, but one is not. The file that was successfully uploaded is .x_t, and .stl cannot. I've tried different ways with different codes, but it won't. Screenshot_1 Screenshot_2 Screenshot_3 Screenshot_4

The upload starts, but after a few seconds it simply disappears and a fail appears. I also can screen video, if screens are not enough. cy.fixture(fileName, "UTF-8").then(fileContent => { cy.get('.ant-upload.ant-upload-drag') .attachFile({ fileContent, fileName, mimeType: 'application/sla'},{ subjectType: 'drag-n-drop' }, { timeout: 150000 })

A successfully uploaded file has 50kb, and the one that will not has 1.5mb. What is wrong?

btw. When I upload a file without automation, it works.

"cypress": "^8.0.0",
"cypress-file-upload": "^5.0.8",
juanan22 commented 2 years ago

I had a similar problem but not the same, maybe this works: Try "cy.get('input[type="file"]').attachFile(nameoffilegoeshere.stl).trigger('input');" Adding the trigger('input')