Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

File upload e2e testing #2686

Closed
psteyn opened this issue May 17, 2013 · 4 comments
Closed

File upload e2e testing #2686

psteyn opened this issue May 17, 2013 · 4 comments

Comments

@psteyn
Copy link

psteyn commented May 17, 2013

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

@Mischi
Copy link

Mischi commented May 20, 2013

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

@psteyn
Copy link
Author

psteyn commented Jun 20, 2013

Thanks Fabian, have you managed to find a solution out of interest sake?

@Mischi
Copy link

Mischi commented Jun 20, 2013

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

@btford btford closed this as completed Aug 24, 2013
@btford
Copy link
Contributor

btford commented Aug 24, 2013

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants