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.
602 603 604 605 606 607 608 609 |
# File 'lib/capybara/playwright/node.rb', line 602 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
611 612 613 |
# File 'lib/capybara/playwright/node.rb', line 611 def execute_for(element) element.press(@key) end |