Closed MCFreddie777 closed 3 years ago
@MCFreddie777 Until this bug/feature is fixed, you can use the the readFile
option as a workaround
const filePath = 'cypress/downloads/example.csv'
cy.readFile(this.fileInput, 'binary')
.then(Cypress.Blob.binaryStringToBlob)
.then((fileContent) => {
cy.get(this.fileInput).attachFile({
filePath,
fileContent
})
})
Current behavior:
both result in
Desired behavior:
Seems like the package is using
cy.fixture
instead ofcy.readFile
which appendscypress/fixtures
by default, therefore its impossible to upload file elsewhere than this folder.Versions
Cypress: 4.12.1 Chrome: 85 OS: macOS 10.15 Catalina