Skip to content

Commit

Permalink
In Selenium, support "<input type='search'/>" etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernerd Schaefer and Tim Pope authored and Pairing Workstation Sears committed Jun 16, 2010
1 parent 46962e1 commit 88d58ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/capybara/driver/selenium_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def value
end

def set(value)
if tag_name == 'textarea' or (tag_name == 'input' and %w(text password hidden file).include?(type))
node.clear
node.send_keys(value.to_s)
elsif tag_name == 'input' and type == 'radio'
if tag_name == 'input' and type == 'radio'
node.click
elsif tag_name == 'input' and type == 'checkbox'
node.click if node.attribute('checked') != value
elsif tag_name == 'textarea' or tag_name == 'input'
node.clear
node.send_keys(value.to_s)
end
end

Expand Down
1 change: 0 additions & 1 deletion lib/capybara/spec/session/fill_in_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
end

it "should fill in a field with a custom type" do
pending "selenium doesn't seem to find custom fields" if @session.mode == :selenium
@session.fill_in('Schmooo', :with => 'Schmooo is the game')
@session.click_button('awesome')
extract_results(@session)['schmooo'].should == 'Schmooo is the game'
Expand Down

0 comments on commit 88d58ce

Please sign in to comment.