cypress-file-upload icon indicating copy to clipboard operation
cypress-file-upload copied to clipboard

[Bug] failed upload

Open FahirL opened this issue 4 years ago • 1 comments

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",

FahirL avatar Jul 25 '21 14:07 FahirL

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')

juanan22 avatar Nov 15 '21 16:11 juanan22