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

Multiple file upload support #37

Closed
paulca opened this issue Feb 7, 2010 · 21 comments
Closed

Multiple file upload support #37

paulca opened this issue Feb 7, 2010 · 21 comments
Labels

Comments

@paulca
Copy link

paulca commented Feb 7, 2010

Hi,

I have a file upload field called "attachments[]" which I'm trying to test using capybara.

The field name works fine in the browser and passes the attachment back to Rails as part of an array "attachments" ... however, when the form is submitted via capybara, it appears as this:

"attachments"=>[{"text\n"=>""}]

I'd appreciate any insight,

Cheers,

—Paul

@jnicklas
Copy link
Collaborator

jnicklas commented Feb 7, 2010

Which driver are you using for this? Rack-test's support for file
uploads doesn't seem to be entirely correct, so that might be an
issue. Try running it under Culerity and see if it works.

/Jonas

@paulca
Copy link
Author

paulca commented Feb 8, 2010

Hi,

I was just using the default rack-test. Culerity was perfect. Should I file an issue with rack-test?

—P

@jnicklas
Copy link
Collaborator

This is another issue caused by http://github.com/jnicklas/capybara/issues/#issue/60

@louismrose
Copy link

I'm running a forked rack-test and capybara that supports multiple uploads with the rack-test driver:

http://github.com/louismrose/rack-test
http://github.com/louismrose/capybara

I'm waiting to see whether the rack-test changes are pulled, as the support in capybara relies on this.

@jnicklas
Copy link
Collaborator

@luismrose any update on what happened to the rack-test patch?

@louismrose
Copy link

The patch made it into rack-test. Here's the commit:
http://github.com/brynary/rack-test/commit/a7a059fd266d7add5b24444b4b0c65916eca36f7

I was waiting for a new gem version of rack-test before sending the pull request for the capybara patch. Would it help if I sent the pull request now?

@jnicklas
Copy link
Collaborator

jnicklas commented Jul 3, 2010

It depends, is it broken with the current version of rack-test?

@louismrose
Copy link

Actually, it looks as though the patch just made it into rack-test 0.5.4. I'll send a pull request for the patch.

@louismrose
Copy link

The patch I refer to above is here:
http://github.com/louismrose/capybara/commit/ae94cbab5b4548726fb5abbe95b05d1f1f71ac00#commitcomment-116893

This works only with Rack::Test, and not, for example, Culerity. As such it won't be pulled into Capybara. If somebody wishes to extend the patch to support Culerity, please feel free to extend the above patch, if you wish.

@jnicklas
Copy link
Collaborator

jnicklas commented Oct 8, 2010

Seems like activity here has been low. I'm closing this issue, please reopen if someone feels strongly about this.

@langalex
Copy link

i'm at a point where i could use that patch. unfortunately it looks like @louismrose deleted his fork.

@louismrose
Copy link

@langalex I'm sorry about that: I did a bit of spring cleaning earlier in the year, and didn't realise this might still be useful. If it's any consolation, I wasn't keeping the fork up-to-date so I doubt very much that the patch would have applied cleanly.

@jipiboily
Copy link

I would love to be able to test multiple files upload too. You guys have any hints on how to do that or what needs to be "fixed"?

@mejibyte
Copy link

I'm also trying to test multiple files upload. Does anyone have a hint on how to write an attach_files method that works simliar to attach_file but receives an array instead of a single file?

@obie
Copy link

obie commented Sep 14, 2012

Another vote for this to be reopened. Thanks

@DanCoughlin
Copy link

+1 to opening this again to test multiple files upload

@Loremaster
Copy link

+1 to adding posibility to attach few files!

@biske
Copy link

biske commented Feb 23, 2013

+1

1 similar comment
@wzcolon
Copy link

wzcolon commented Mar 19, 2013

+1

@abotalov
Copy link
Collaborator

Attaching several files isn't supported by Selenium so I doubt Capybara will have support for it through page

@twalpole
Copy link
Member

The patch to allow this in Selenium with firefox is pretty simple, preparing a pull request for selenium - just trying to figure out where the tests for file upload are in selenium (Its selenium PR 34 - SeleniumHQ/selenium#34 - still cant find the tests though)

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests