class Selenium::WebDriver::FedCM::Dialog

Constants

DIALOG_TYPE_ACCOUNT_LIST
DIALOG_TYPE_AUTO_REAUTH

Public Class Methods

new(bridge) click to toggle source
# File lib/selenium/webdriver/common/fedcm/dialog.rb, line 24
def initialize(bridge)
  @bridge = bridge
end

Public Instance Methods

accounts() click to toggle source

Returns the accounts shown in the account chooser.

If this is an auto reauth dialog, returns the single account that is being signed in.

# File lib/selenium/webdriver/common/fedcm/dialog.rb, line 68
def accounts
  @bridge.fedcm_account_list.map { |account| Account.new(**account) }
end
cancel() click to toggle source

Closes the dialog as if the user had clicked X.

# File lib/selenium/webdriver/common/fedcm/dialog.rb, line 37
def cancel
  @bridge.cancel_fedcm_dialog
end
click() click to toggle source

Closes the dialog as if the user had clicked X.

# File lib/selenium/webdriver/common/fedcm/dialog.rb, line 32
def click
  @bridge.click_fedcm_dialog_button
end
select_account(index) click to toggle source

Selects an account as if the user had clicked on it.

@param [Integer] index The index of the account to select from the list returned by get_accounts.

# File lib/selenium/webdriver/common/fedcm/dialog.rb, line 44
def select_account(index)
  @bridge.select_fedcm_account index
end
subtitle() click to toggle source

Returns the subtitle of the dialog or nil if none.

# File lib/selenium/webdriver/common/fedcm/dialog.rb, line 61
def subtitle
  @bridge.fedcm_subtitle
end
title() click to toggle source

Returns the title of the dialog.

# File lib/selenium/webdriver/common/fedcm/dialog.rb, line 56
def title
  @bridge.fedcm_title
end
type() click to toggle source

Returns the type of the open dialog.

One of DIALOG_TYPE_ACCOUNT_LIST and DIALOG_TYPE_AUTO_REAUTH.

# File lib/selenium/webdriver/common/fedcm/dialog.rb, line 51
def type
  @bridge.fedcm_dialog_type
end