Class: Capybara::Playwright::Node::ClickOptions
- Inherits:
-
Object
- Object
- Capybara::Playwright::Node::ClickOptions
- Defined in:
- lib/capybara/playwright/node.rb
Constant Summary collapse
- MODIFIERS =
{ alt: 'Alt', ctrl: 'Control', control: 'Control', meta: 'Meta', command: 'Meta', cmd: 'Meta', shift: 'Shift', }.freeze
Instance Method Summary collapse
- #as_params ⇒ Object
-
#initialize(element, keys, options, default_timeout) ⇒ ClickOptions
constructor
A new instance of ClickOptions.
Constructor Details
#initialize(element, keys, options, default_timeout) ⇒ ClickOptions
Returns a new instance of ClickOptions.
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/capybara/playwright/node.rb', line 379 def initialize(element, keys, , default_timeout) @element = element @modifiers = keys.map do |key| MODIFIERS[key.to_sym] or raise ArgumentError.new("Unknown modifier key: #{key}") end if [:x] && [:y] @coords = { x: [:x], y: [:y], } @offset_center = [:offset] == :center end @wait = [:_playwright_wait] @delay = [:delay] @default_timeout = default_timeout end |
Instance Method Details
#as_params ⇒ Object
396 397 398 399 400 401 402 403 |
# File 'lib/capybara/playwright/node.rb', line 396 def as_params { delay: delay_ms, modifiers: modifiers, position: position, timeout: timeout + delay_ms.to_i, }.compact end |