Class: Selenium::WebDriver::FedCM::Dialog

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/common/fedcm/dialog.rb

Constant Summary collapse

DIALOG_TYPE_ACCOUNT_LIST =
'AccountChooser'
DIALOG_TYPE_AUTO_REAUTH =
'AutoReauthn'

Instance Method Summary collapse

Constructor Details

#initialize(bridge) ⇒ Dialog

Returns a new instance of Dialog.



24
25
26
# File 'lib/selenium/webdriver/common/fedcm/dialog.rb', line 24

def initialize(bridge)
  @bridge = bridge
end

Instance Method Details

#accountsObject

Returns the accounts shown in the account chooser.

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



68
69
70
# File 'lib/selenium/webdriver/common/fedcm/dialog.rb', line 68

def accounts
  @bridge..map { || Account.new(**) }
end

#cancelObject

Closes the dialog as if the user had clicked X.



37
38
39
# File 'lib/selenium/webdriver/common/fedcm/dialog.rb', line 37

def cancel
  @bridge.cancel_fedcm_dialog
end

#clickObject

Closes the dialog as if the user had clicked X.



32
33
34
# File 'lib/selenium/webdriver/common/fedcm/dialog.rb', line 32

def click
  @bridge.click_fedcm_dialog_button
end

#select_account(index) ⇒ Object

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

Parameters:

  • index (Integer)

    The index of the account to select from the list returned by get_accounts.



44
45
46
# File 'lib/selenium/webdriver/common/fedcm/dialog.rb', line 44

def (index)
  @bridge. index
end

#subtitleObject

Returns the subtitle of the dialog or nil if none.



61
62
63
# File 'lib/selenium/webdriver/common/fedcm/dialog.rb', line 61

def subtitle
  @bridge.fedcm_subtitle
end

#titleObject

Returns the title of the dialog.



56
57
58
# File 'lib/selenium/webdriver/common/fedcm/dialog.rb', line 56

def title
  @bridge.fedcm_title
end

#typeObject

Returns the type of the open dialog.

One of DIALOG_TYPE_ACCOUNT_LIST and DIALOG_TYPE_AUTO_REAUTH.



51
52
53
# File 'lib/selenium/webdriver/common/fedcm/dialog.rb', line 51

def type
  @bridge.fedcm_dialog_type
end