Class: Capybara::Playwright::Node::DateTimeInput

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

Instance Method Summary collapse

Methods included from UpdateValueJS

#update_value_js

Methods inherited from Settable

#initialize

Constructor Details

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

Instance Method Details

#set(value, **options) ⇒ Object



299
300
301
302
303
304
305
# File 'lib/capybara/playwright/node.rb', line 299

def set(value, **options)
  if !value.is_a?(String) && value.respond_to?(:to_time)
    update_value_js(@element, value.to_time.strftime('%Y-%m-%dT%H:%M'))
  else
    @element.fill(value.to_s, timeout: @timeout)
  end
end