Class: Selenium::WebDriver::FedCM::Dialog
- Inherits:
-
Object
- Object
- Selenium::WebDriver::FedCM::Dialog
- 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
-
#accounts ⇒ Object
Returns the accounts shown in the account chooser.
-
#cancel ⇒ Object
Closes the dialog as if the user had clicked X.
-
#click ⇒ Object
Closes the dialog as if the user had clicked X.
-
#initialize(bridge) ⇒ Dialog
constructor
A new instance of Dialog.
-
#select_account(index) ⇒ Object
Selects an account as if the user had clicked on it.
-
#subtitle ⇒ Object
Returns the subtitle of the dialog or nil if none.
-
#title ⇒ Object
Returns the title of the dialog.
-
#type ⇒ Object
Returns the type of the open dialog.
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
#accounts ⇒ Object
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.fedcm_account_list.map { |account| Account.new(**account) } end |
#cancel ⇒ Object
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 |
#click ⇒ Object
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. end |
#select_account(index) ⇒ Object
Selects an account as if the user had clicked on it.
44 45 46 |
# File 'lib/selenium/webdriver/common/fedcm/dialog.rb', line 44 def select_account(index) @bridge.select_fedcm_account index end |
#subtitle ⇒ Object
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 |
#title ⇒ Object
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 |
#type ⇒ Object
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 |