Cypress file upload plugin - Not able to upload file for a hidden input tag #17273
Unanswered
Asingh0106
asked this question in
Plugins
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to upload a file to my application using cypress-file-upload plugin but my input tag has style attribute as display:none. I tried removing the display attribute and upload the file but the file name is not displayed properly after upload. The execution is green but functionally it's wrong.

cy.fixture('/testImages/clock.jpeg', 'base64')
.then( (fileContent) => {
cy.get('input[type="file"]')
.invoke('show')
.attachFile(
{filePath: '/testImages/clock.jpeg'},
{subjectType: 'input'}
)
});
cy.get('input[type="file"]').invoke('attr','style','display:none')
Beta Was this translation helpful? Give feedback.
All reactions