-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
[Feature] Support File API polyfill #71
Comments
Hi @mark-veenstra |
@abramenal Thnx for helping out. I used TEST 4 from above (no encoding at all). If I open the console within Cypress, the |
@abramenal I also added a breakpoint on this line where the error is thrown. At that point |
@mark-veenstra I've removed the original file content from your comment as it blows the comments history 😄 |
@abramenal We are using cordova and it seems that the plugin When I remove this specific cordova implementation of
Now I have to figure out how I can use this cordova plugin and also use your plugin to automate some testing. |
@mark-veenstra that's actually a great finding! Will investigate that thing this week. Help appreciated. |
That repository is mentioned on the modernizr Wiki: https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills#file-api |
@abramenal Did you close this issue for a reason? I did open an issue on the issue tracker of Cordova, but as you can see they will not do this within a short notice since it is a breaking change. It can even be that this takes years for them to solve. I have posted more issue on that tracker and some take months to years to solve. Could we still add a polyfill in this repository? Or do you want to wait on Cordova to make some changes? |
@mark-veenstra Ideally it can be a separate method that a user can import (like |
@abramenal I could also fork the cordova plugin and expose the window.File etc to a differrent namespace and include that forked and adjusted plugin in my project. I understand that you have lack of time and that Cordova should fix this. Adjusting and forking the plugin is quite easy and a quick win on my side. |
@mark-veenstra |
@mark-veenstra any updates on that? |
I created a fork and changed the way the plugin exposes to the window object and all seems to work. |
@mark-veenstra great! |
Well as long as cordova-plugin-file does not solve it and people use this plugin together with your cypress plugin it will fail. People could try the same "hack" I did. Or hopefully a major release in the future of cordova-plugin-file will still solve it completely. Or as we said before a shim is needed in this plugin. But that feels a bit strange because it a standard API you are using. |
@mark-veenstra I don't see any harm in making the change in this plugin, especially if it can be made safely. If you have time, could you please try experimenting with the plugin? What I would be okay with is having an extra config field called Here is a list of polyfills to start with: |
@mark-veenstra |
Unfortunately not |
Hey @mark-veenstra |
We are working with a fork of the Cordova plugin for now and changed the expose to a Cordova namespaces window object. Which solves all issues (for now). |
Current behavior:
It throws the following error:
Desired behavior:
That the PDF file is uploaded
Steps to reproduce: (app code and test code)
I try to upload the PDF with the following different solutions of the code. Using
force: true
because elements are hidden:TEST 1:
TEST 2:
TEST 3:
TEST 4:
I run Cypress in a docker image and the image does see the file:
Versions
Cypress 3.2.0
The text was updated successfully, but these errors were encountered: