Class: Capybara::Playwright::Node::FileUpload

Inherits:
Settable
  • Object
show all
Defined in:
lib/capybara/playwright/node.rb

Instance Method Summary collapse

Methods inherited from Settable

#initialize

Constructor Details

This class inherits a constructor from Capybara::Playwright::Node::Settable

Instance Method Details

#set(value, **options) ⇒ Object



257
258
259
260
261
262
263
264
265
266
267
# File 'lib/capybara/playwright/node.rb', line 257

def set(value, **options)
  file =
    if value.is_a?(File)
      value.path
    elsif value.is_a?(Enumerable)
      value.map(&:to_s)
    else
      value.to_s
    end
  @element.set_input_files(file, timeout: @timeout)
end