Class: Selenium::DevTools::V130::FedCm
- Inherits:
-
Object
- Object
- Selenium::DevTools::V130::FedCm
- Defined in:
- lib/selenium/devtools/v130/fed_cm.rb
Constant Summary collapse
- EVENTS =
{ dialog_shown: 'dialogShown', dialog_closed: 'dialogClosed', }.freeze
Instance Method Summary collapse
- #click_dialog_button(dialog_id:, dialog_button:) ⇒ Object
- #disable ⇒ Object
- #dismiss_dialog(dialog_id:, trigger_cooldown: nil) ⇒ Object
- #enable(disable_rejection_delay: nil) ⇒ Object
-
#initialize(devtools) ⇒ FedCm
constructor
A new instance of FedCm.
- #on(event, &block) ⇒ Object
- #open_url(dialog_id:, account_index:, account_url_type:) ⇒ Object
- #reset_cooldown ⇒ Object
- #select_account(dialog_id:, account_index:) ⇒ Object
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 (dialog_id:, dialog_button:) @devtools.send_cmd('FedCm.clickDialogButton', dialogId: dialog_id, dialogButton: ) end |
#disable ⇒ Object
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: account_index, accountUrlType: account_url_type) end |
#reset_cooldown ⇒ Object
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 select_account(dialog_id:, account_index:) @devtools.send_cmd('FedCm.selectAccount', dialogId: dialog_id, accountIndex: account_index) end |