123456789_123456789_123456789_123456789_123456789_

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

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#enable_fedcm_delay=(enable) (writeonly)

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.

[ GitHub ]

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

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

Instance Method Details

#fedcm_dialog

[ GitHub ]

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

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

#reset_fedcm_cooldown

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.

[ GitHub ]

  
# File 'rb/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)

[ GitHub ]

  
# File 'rb/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