Use JS to clear field, should be more performant
This commit is contained in:
parent
7859efb757
commit
08a8fd6834
|
@ -32,8 +32,8 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
|
||||||
path_names = value.to_s.empty? ? [] : value
|
path_names = value.to_s.empty? ? [] : value
|
||||||
native.send_keys(*path_names)
|
native.send_keys(*path_names)
|
||||||
elsif tag_name == 'textarea' or tag_name == 'input'
|
elsif tag_name == 'textarea' or tag_name == 'input'
|
||||||
chars = native[:value].size
|
driver.browser.execute_script "arguments[0].value = ''", native
|
||||||
native.send_keys(([:right] * chars) + ([:backspace] * chars) + [ value.to_s ])
|
native.send_keys(value.to_s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue