123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Inherits: Object
Defined in: rb/lib/selenium/webdriver/common/fedcm/dialog.rb

Constant Summary

Class Method Summary

Instance Method Summary

  • #accounts

    Returns the accounts shown in the account chooser.

  • #cancel

    Closes the dialog as if the user had clicked X.

  • #click

    Closes the dialog as if the user had clicked X.

  • #select_account(index)

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

  • #subtitle

    Returns the subtitle of the dialog or nil if none.

  • #title

    Returns the title of the dialog.

  • #type

    Returns the type of the open dialog.

Constructor Details

.new(bridge) ⇒ Dialog

[ GitHub ]

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

def initialize(bridge)
  @bridge = bridge
end

Instance Method Details

#accounts

Returns the accounts shown in the account chooser.

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

[ GitHub ]

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

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

#cancel

Closes the dialog as if the user had clicked X.

[ GitHub ]

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

def cancel
  @bridge.cancel_fedcm_dialog
end

#click

Closes the dialog as if the user had clicked X.

[ GitHub ]

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

def click
  @bridge.click_fedcm_dialog_button
end

#select_account(index)

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.

[ GitHub ]

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

def (index)
  @bridge. index
end

#subtitle

Returns the subtitle of the dialog or nil if none.

[ GitHub ]

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

def subtitle
  @bridge.fedcm_subtitle
end

#title

Returns the title of the dialog.

[ GitHub ]

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

def title
  @bridge.fedcm_title
end

#type

Returns the type of the open dialog.

One of DIALOG_TYPE_ACCOUNT_LIST and DIALOG_TYPE_AUTO_REAUTH.

[ GitHub ]

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

def type
  @bridge.fedcm_dialog_type
end