Class: Selenium::DevTools::V130::FedCm

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

Constant Summary collapse

EVENTS =
{
  dialog_shown: 'dialogShown',
  dialog_closed: 'dialogClosed',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ FedCm

Returns a new instance of FedCm.



30
31
32
# File 'lib/selenium/devtools/v130/fed_cm.rb', line 30

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#click_dialog_button(dialog_id:, dialog_button:) ⇒ Object



54
55
56
57
58
# File 'lib/selenium/devtools/v130/fed_cm.rb', line 54

def click_dialog_button(dialog_id:, dialog_button:)
  @devtools.send_cmd('FedCm.clickDialogButton',
                     dialogId: dialog_id,
                     dialogButton: dialog_button)
end

#disableObject



44
45
46
# File 'lib/selenium/devtools/v130/fed_cm.rb', line 44

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

#dismiss_dialog(dialog_id:, trigger_cooldown: nil) ⇒ Object



67
68
69
70
71
# File 'lib/selenium/devtools/v130/fed_cm.rb', line 67

def dismiss_dialog(dialog_id:, trigger_cooldown: nil)
  @devtools.send_cmd('FedCm.dismissDialog',
                     dialogId: dialog_id,
                     triggerCooldown: trigger_cooldown)
end

#enable(disable_rejection_delay: nil) ⇒ Object



39
40
41
42
# File 'lib/selenium/devtools/v130/fed_cm.rb', line 39

def enable(disable_rejection_delay: nil)
  @devtools.send_cmd('FedCm.enable',
                     disableRejectionDelay: disable_rejection_delay)
end

#on(event, &block) ⇒ Object



34
35
36
37
# File 'lib/selenium/devtools/v130/fed_cm.rb', line 34

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["FedCm.#{event}"] << block
end

#open_url(dialog_id:, account_index:, account_url_type:) ⇒ Object



60
61
62
63
64
65
# File 'lib/selenium/devtools/v130/fed_cm.rb', line 60

def open_url(dialog_id:, account_index:, account_url_type:)
  @devtools.send_cmd('FedCm.openUrl',
                     dialogId: dialog_id,
                     accountIndex: ,
                     accountUrlType: )
end

#reset_cooldownObject



73
74
75
# File 'lib/selenium/devtools/v130/fed_cm.rb', line 73

def reset_cooldown
  @devtools.send_cmd('FedCm.resetCooldown')
end

#select_account(dialog_id:, account_index:) ⇒ Object



48
49
50
51
52
# File 'lib/selenium/devtools/v130/fed_cm.rb', line 48

def (dialog_id:, account_index:)
  @devtools.send_cmd('FedCm.selectAccount',
                     dialogId: dialog_id,
                     accountIndex: )
end