1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Emulate user input to prevent onchange from being triggered twice in Selenium driver

This commit is contained in:
Andrew Kasper 2012-07-12 08:25:31 -04:00
parent ae8de68308
commit 6dc095b3fa

View file

@ -25,8 +25,7 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
elsif tag_name == 'input' and type == 'file'
native.send_keys(value.to_s)
elsif tag_name == 'textarea' or tag_name == 'input'
native.clear
native.send_keys(value.to_s)
native.send_keys(("\b" * native[:value].size) + value.to_s)
end
end