File upload e2e testing
Looking at the following docs I do not see an option for doing a file upload.
http://docs.angularjs.org/guide/dev_guide.e2e-testing
Can anyone help me in the right direction, or perhaps considering adding support for this?
Thank you
Currently there is no support for file upload in e2e/unit testing. I'am searching for a solution too. Most (all) browsers refuse file uploads from JavaScript because it would leave the door wide open for some security problems. See http://dev.w3.org/2006/webapi/FileAPI/#security-discussion for some examples. When using PhantomJS you could try out https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage#wiki-webpage-uploadFile
Regards, Fabian
Thanks Fabian, have you managed to find a solution out of interest sake?
No, there is no practical Solution at the moment. I've asked on the w3 mailing list for a solution, and i've got the following answer from tobie:
That's work in the scope of the Browser Testing and Tools WG. Afaik, there's ongoing discussions on how to
best support that, but there's nothing in the Webdriver spec[2] yet.
----
--tobie
1: http://www.w3.org/testing/browser/
2: http://www.w3.org/TR/webdriver/
I further evaluated the Phantomjs path but i came to the conclusion that this is not practical. A possible approach would be:
- extend karma testrunner so that you could request fileupload on client side (in unit tests)
- pass the request to phantomjs
- do the fileupload
The webdriver spec mentioned by tobie looks very promising to me. I think we have to wait a little bit longer, until the spec produces something workable.
We should keep an eye on the spec so they consider our use case ;)
Best Regards,
Fabian
As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months.
Please try the newest versions of Angular (1.0.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.
Thanks!