-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use cy.api() with blob file returning TypeError #102
Comments
will create support for this soon 👍 thanks for the report. one question - before |
Yes, I use |
Does it matter if you import a file by |
it seems that the it('uploads a file', () => {
cy.fixture('logo.png', 'binary').then(image => {
const blob = Cypress.Blob.binaryStringToBlob(image, 'image/png');
const formData = new FormData();
formData.append('image', blob, 'logo.png');
cy.api({
method: 'POST',
url: '/',
body: formData,
headers: {
'content-type': 'multipart/form-data'
},
})
})
}); it doesn’t do too much, but it does not throw the error. is it possible for you to provide an example of what the response for such API call is? |
Seeing the same issue. I am using a fixture and modifying some objects in the json before passing to the endpoint. The operation itself seems successful as I can see the desired values changed in my application but I get the above mentioned error at the end. There is no error when using cypress native method
|
Hello! I'm with problems when I try to send a blob file through formData. The error returned is the following:
Some points :
-The same error is obtained using requestMode.
Cypress version: 12.1.0
Cypress-api-plugin version: 2.9.0
Here is the piece of code:
The text was updated successfully, but these errors were encountered: