When attaching a file you can provide the description of a file ({ filePath, mimeType, ... }) and even mock its contents via fileContent, but you can't mock its size.
Desired behavior:
I wish I could provide the file size without resorting to mock its content. That would be especially useful for mocking large files.
cy.get("input[type=file]").attachFile({ fileSize: 100 * 1024 * 1024 }); // Just an example, this doesn't work.
Hi @nandosangenetto,
There are some samples I found on Stackoverflow (this and this).
If you are interested, please feel free to submit a PR. This could be indeed a nice addition to simplify file upload testing.
Current behavior:
When attaching a file you can provide the description of a file (
{ filePath, mimeType, ... }
) and even mock its contents viafileContent
, but you can't mock its size.Desired behavior:
I wish I could provide the file size without resorting to mock its content. That would be especially useful for mocking large files.
Versions
n/a