Skip to content

first run at issue #1319 - propagate fill_in options to Element#set #1338

Merged
merged 2 commits into from Jun 23, 2014

3 participants

@twalpole
Collaborator

No description provided.

@abotalov abotalov commented on an outdated diff Jun 19, 2014
lib/capybara/node/element.rb
#
- def set(value)
- synchronize { base.set(value) }
+ def set(value, options={})
+ driver_supports_options = (base.method(:set).arity != 1)
+
+ if options && !options.empty? && !driver_supports_options
+ warn "Options passed to Capybara::Node#set but the driver doesnt support them" if options && !options.empty?
@abotalov
Collaborator
abotalov added a note Jun 19, 2014

Why double check for if options && !options.empty??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@sobrinho

@twalpole seems fine for me, just the double check that @abotalov mentioned has to be changed :shipit:

@twalpole
Collaborator

ok -- fixed the double check -- anyone have a preference between :fill_options and :set_options as the key that will be propagated from fill_in to set?

@twalpole twalpole Implementation for issue #1319 - propagate fill_in options to Element…
…#set
2ce3669
@abotalov
Collaborator

I vote for fill_options.

Also I think that there should be a way to not clear text field before trying to set its value. Should this possibility be added as a new method or just as a key for fill_options?

@twalpole
Collaborator

I think not clearing is a key passed to fill_options, and is driver specific (obviously it would be good to get some agreement between drivers on some of these options)

@twalpole twalpole merged commit 4113731 into master Jun 23, 2014

1 check passed

Details continuous-integration/travis-ci The Travis CI build passed
@twalpole twalpole deleted the fill_in_options branch Aug 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.