Class: Selenium::DevTools::V130::Autofill

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v130/autofill.rb

Constant Summary collapse

EVENTS =
{
  address_form_filled: 'addressFormFilled',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Autofill

Returns a new instance of Autofill.



29
30
31
# File 'lib/selenium/devtools/v130/autofill.rb', line 29

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#disableObject



50
51
52
# File 'lib/selenium/devtools/v130/autofill.rb', line 50

def disable
  @devtools.send_cmd('Autofill.disable')
end

#enableObject



54
55
56
# File 'lib/selenium/devtools/v130/autofill.rb', line 54

def enable
  @devtools.send_cmd('Autofill.enable')
end

#on(event, &block) ⇒ Object



33
34
35
36
# File 'lib/selenium/devtools/v130/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/v130/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/v130/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