Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

attach_file doesn't attach the file #594

Closed
brandoncc opened this issue Mar 16, 2015 · 5 comments
Closed

attach_file doesn't attach the file #594

brandoncc opened this issue Mar 16, 2015 · 5 comments

Comments

@brandoncc
Copy link

I'm trying to use the code from #342 but I cannot get attach_file to work. It works fine in selenium, but not poltergeist.

pry(#<RSpec::ExampleGroups::SellerManagesProducts::EditsAProduct>)> attach_file("seleniumUpload#{index}", files[index])
=> true

pry(#<RSpec::ExampleGroups::SellerManagesProducts::EditsAProduct>)> evaluate_script('console.log($("#seleniumUpload0").get(0).files.length)')
0

The file does exist and this same code results in 1 being logged in selenium. I am using capybara 2.4.4 and poltergeist 1.6.0 with phantomjs 2.0.0.

I found the phantomjs uploadFile method, which I think is how I need to fix this problem but I can't figure out how to call a phantomjs method through poltergeist.

@route
Copy link
Contributor

route commented Mar 16, 2015

File uploading is broken in PhantomJS 2.0 you can downgrade to 1.9 or wait when they fix it

@route route closed this as completed Mar 16, 2015
@brandoncc
Copy link
Author

Thank you for your time, I thought it might be an incompatibility between 2.0 and poltergeist but I didn't think it would be 2.0 by itself.

@route
Copy link
Contributor

route commented Mar 16, 2015

No problem =) it's known issue ariya/phantomjs#12506

@twalpole
Copy link
Contributor

twalpole commented Nov 7, 2015

FYI -- this should be fixed via PR #686 - now merged into master

@brandoncc
Copy link
Author

Thank you @twalpole !

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