small refactor
This commit is contained in:
parent
b4bce58fd8
commit
4a55c1a7cb
|
@ -17,16 +17,13 @@ class Capybara::Driver::Selenium
|
|||
end
|
||||
|
||||
def set(value)
|
||||
if tag_name == 'input' and %w(text password hidden file).include?(type)
|
||||
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'
|
||||
node.select
|
||||
elsif tag_name == 'input' and type == 'checkbox'
|
||||
node.toggle
|
||||
elsif tag_name == "textarea"
|
||||
node.clear
|
||||
node.send_keys(value.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue