cypress upload file

JavaScript
const fileName = 'data.json'; cy.fixture(fileName).then(fileContent => {  cy.get('[data-cy="dropzone"]').upload(    { fileContent, fileName, mimeType: 'application/json' },    { subjectType: 'drag-n-drop' },  );});
Source

Also in JavaScript: