Class: Capybara::Playwright::Node::TimeInput

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



287
288
289
290
291
292
293
# File 'lib/capybara/playwright/node.rb', line 287

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