Module: Selenium::WebDriver::DriverExtensions::HasFedCmDialog Private

Defined in:
lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#enable_fedcm_delay=(enable) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Disables the promise rejection delay for FedCm.

FedCm by default delays promise resolution in failure cases for privacy reasons. This method allows turning it off to let tests run faster where this is not relevant.



28
29
30
# File 'lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb', line 28

def enable_fedcm_delay=(enable)
  @bridge.fedcm_delay(enable)
end

#fedcm_dialogObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



40
41
42
# File 'lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb', line 40

def fedcm_dialog
  @fedcm_dialog ||= FedCM::Dialog.new(@bridge)
end

#reset_fedcm_cooldownObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Resets the FedCm dialog cooldown.

If a user agent triggers a cooldown when the account chooser is dismissed, this method resets that cooldown so that the dialog can be triggered again immediately.



36
37
38
# File 'lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb', line 36

def reset_fedcm_cooldown
  @bridge.reset_fedcm_cooldown
end

#wait_for_fedcm_dialog(timeout: 5, interval: 0.2, message: nil, ignore: nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



44
45
46
47
48
49
50
51
# File 'lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb', line 44

def wait_for_fedcm_dialog(timeout: 5, interval: 0.2, message: nil, ignore: nil)
  wait = Wait.new(timeout: timeout, interval: interval, message: message, ignore: ignore)
  wait.until do
    fedcm_dialog if fedcm_dialog.type
  rescue Error::NoSuchAlertError
    nil
  end
end