Class: Selenium::DevTools::V128::Autofill
- Inherits:
-
Object
- Object
- Selenium::DevTools::V128::Autofill
- Defined in:
- lib/selenium/devtools/v128/autofill.rb
Constant Summary collapse
- EVENTS =
{ address_form_filled: 'addressFormFilled', }.freeze
Instance Method Summary collapse
- #disable ⇒ Object
- #enable ⇒ Object
-
#initialize(devtools) ⇒ Autofill
constructor
A new instance of Autofill.
- #on(event, &block) ⇒ Object
- #set_addresses(addresses:) ⇒ Object
- #trigger(field_id:, frame_id: nil, card:) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ Autofill
Returns a new instance of Autofill.
29 30 31 |
# File 'lib/selenium/devtools/v128/autofill.rb', line 29 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#disable ⇒ Object
50 51 52 |
# File 'lib/selenium/devtools/v128/autofill.rb', line 50 def disable @devtools.send_cmd('Autofill.disable') end |
#enable ⇒ Object
54 55 56 |
# File 'lib/selenium/devtools/v128/autofill.rb', line 54 def enable @devtools.send_cmd('Autofill.enable') end |
#on(event, &block) ⇒ Object
33 34 35 36 |
# File 'lib/selenium/devtools/v128/autofill.rb', line 33 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Autofill.#{event}"] << block end |
#set_addresses(addresses:) ⇒ Object
45 46 47 48 |
# File 'lib/selenium/devtools/v128/autofill.rb', line 45 def set_addresses(addresses:) @devtools.send_cmd('Autofill.setAddresses', addresses: addresses) end |
#trigger(field_id:, frame_id: nil, card:) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/selenium/devtools/v128/autofill.rb', line 38 def trigger(field_id:, frame_id: nil, card:) @devtools.send_cmd('Autofill.trigger', fieldId: field_id, frameId: frame_id, card: card) end |