Skip to content
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

update command to accept multiple fixtures. fixes #203 #227

Closed
wants to merge 1 commit into from

Conversation

Hypercubed
Copy link

@Hypercubed Hypercubed commented Sep 4, 2020

This PR seperates out events from attaching files. The attachFile now accepts an array of fixtures. Each fixture is attached sequentually then the events are trigger.

Added tests and verified in recipes/angularjs-ng-file-upload.

Closes #203

@abramenal
Copy link
Owner

abramenal commented Sep 6, 2020

@Hypercubed thanks for submitting MR! Looks good 👍
I will need 1-2 days to add more tests to other frameworks to make sure it's being tested on every setup.

Also it is worth updating README.md with simple snippet to illustrate how this should work.

@abramenal abramenal self-assigned this Sep 6, 2020
@abramenal
Copy link
Owner

@all-contributors add @Hypercubed for code

Repository owner deleted a comment from allcontributors bot Sep 6, 2020
@allcontributors
Copy link
Contributor

@abramenal

I've put up a pull request to add @Hypercubed! 🎉

@abramenal
Copy link
Owner

abramenal commented Sep 9, 2020

@Hypercubed unfortunately this is not working with react drag-n-drop. The reason is – before dataTransfer object contained all the files added, and for drag-n-drop case it triggered specific events with that dataTransfer object.
Right now every file gets attached separately, and then it cannot trigger valid event containing all the files

@Hypercubed
Copy link
Author

I'm not sure I undetstand what you mean by "cannot trigger valid event containing all the files". Does this mean it break react drag-n-drop entirely or only when passing multiple fixtures. I wonder if it ever work with the older version.

@abramenal
Copy link
Owner

It breaks entirely regardless of files count. You can reproduce it when running examples/react-dropzone repo tests – there you can tweak import 'cypress-file-upload' to use your local version import '../../../../src/index'.

I planned to look into it this weekend, but feel free to investigate if you have time.

@tommy-anderson
Copy link

Hey there, @abramenal , @Hypercubed any idea when this will happen?

Our project relies heavily on uploading files and we just started updating from cypress 4.12.1 to cypress 6.4.1 so naturally need to update the cypress-file-upload plugin. Would hate to leave the the mulitple-images upload test cases hanging.

Sadly I don't have enough technical background to dive into the issues myself.

@abramenal
Copy link
Owner

Hi @tommy-anderson,
I know this is painful, really appreciate your patience on that.

I see @paulblyth submitted a PR, I am happy to look at it during weekend. Hopefully this will work just fine so I can release it quickly. Will keep this PR posted as well.

@abramenal
Copy link
Owner

#251 is merged, so closing this one. Thanks anyways, appreciate your effort and welcome to the contributors list ❤️

@abramenal abramenal closed this Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow uploading of multiple files outside of chaining attachFile
3 participants