Class: Capybara::Playwright::Node::SendKeys::PressKey
- Inherits:
-
Object
- Object
- Capybara::Playwright::Node::SendKeys::PressKey
- Defined in:
- lib/capybara/playwright/node.rb
Instance Method Summary collapse
- #execute_for(element) ⇒ Object
-
#initialize(key:, modifiers:) ⇒ PressKey
constructor
A new instance of PressKey.
Constructor Details
#initialize(key:, modifiers:) ⇒ PressKey
Returns a new instance of PressKey.
578 579 580 581 582 583 584 585 |
# File 'lib/capybara/playwright/node.rb', line 578 def initialize(key:, modifiers:) puts "PressKey: key=#{key} modifiers: #{modifiers}" if modifiers.empty? @key = key else @key = (modifiers + [key]).join('+') end end |
Instance Method Details
#execute_for(element) ⇒ Object
587 588 589 |
# File 'lib/capybara/playwright/node.rb', line 587 def execute_for(element) element.press(@key) end |