Only clear Firefox file input when necessary
This commit is contained in:
parent
dffdfcfd1c
commit
6261641d70
|
@ -26,7 +26,8 @@ class Capybara::Selenium::MarionetteNode < Capybara::Selenium::Node
|
|||
end
|
||||
|
||||
def set_file(value) # rubocop:disable Naming/AccessorMethodName
|
||||
native.clear # By default files are appended so we have to clear here
|
||||
# By default files are appended so we have to clear here if its multiple and already set
|
||||
native.clear if multiple? && driver.evaluate_script("arguments[0].files", self).any?
|
||||
return super if browser_version >= 62.0
|
||||
|
||||
# Workaround lack of support for multiple upload by uploading one at a time
|
||||
|
|
Loading…
Reference in New Issue