I need to upload a xlsx file which I have placed in fixture folder in to the application. Any suggestions how to do it using cypress?
I need to upload a xlsx file which I have placed in fixture folder in to the application. Any suggestions how to do it using cypress?
This what I found as the solution
Install cypress-file-upload
npm install --save-dev cypress-file-upload
Add following to command .js file
import 'cypress-file-upload';
Use cy.attachFile
const yourFixturePath = 'data.json'; cy.get('[data-cy="file-input"]').attachFile(yourFixturePath);
For details https://www.npmjs.com/package/cypress-file-upload