-
-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rb] Add FedCM support to the ruby selenium client #13796
base: trunk
Are you sure you want to change the base?
[rb] Add FedCM support to the ruby selenium client #13796
Conversation
…guspe/selenium into add_fedcm_support_for_the_ruby_library
…guspe/selenium into add_fedcm_support_for_the_ruby_library
PR Review 🔍
|
PR Code Suggestions ✨
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely looks like a great start, thank you for working on this!
Can we add more tests to verify all the endpoints such as delays and cooldowns?
rb/lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb
Outdated
Show resolved
Hide resolved
rb/lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb
Outdated
Show resolved
Hide resolved
module WebDriver | ||
module FedCM | ||
describe Dialog, exclusive: {browser: :chrome} do | ||
let(:url) { 'https://fedcm-rp-demo.glitch.me/' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, our tests should be atomic and not depend on external websites. Is it possible to replicate a demo similar to how we test basic authentication (
selenium/rb/spec/integration/selenium/webdriver/spec_support/rack_server.rb
Lines 122 to 123 in 2994952
when '/basicAuth' | |
authorize(env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes a lot of sense, I will give this a look tomorrow to this, to see if I can replicate the flow without any external calls
…guspe/selenium into add_fedcm_support_for_the_ruby_library
I will add the extra tests tomorrow morning, I added a thumbs up to all the resolved comments, so anything else I can improve or fix just let me know Thank you so much @p0deje for the quick review! super appreciated, and thanks for taking the time to help me out :) |
User description
Description
As mentioned in #12088
The goal is to add support for the Federal credential management API (FedCM) so users have access to commands that will enable them to automate it
Reference Docs:
https://fedidcg.github.io/FedCM/#automation
https://developer.mozilla.org/en-US/docs/Web/API/FedCM_API
Motivation and Context
On Chrome 108 FedCM has shipped and it's already implemented by several web solutions, by adding support to the client library we guarantee that more users can automate this functionality without work arounds
Types of changes
Checklist
PR Type
Enhancement, Tests
Description
FedCM
module withAccount
andDialog
classes.HasFedCmDialog
driver extension for managing FedCM dialogs.Changes walkthrough 📝
12 files
webdriver.rb
Add autoload for FedCM module.
rb/lib/selenium/webdriver.rb
FedCM
.driver.rb
Include HasFedCmDialog in driver extensions.
rb/lib/selenium/webdriver/chromium/driver.rb
HasFedCmDialog
to driver extensions.common.rb
Require has_fedcm_dialog in common driver extensions.
rb/lib/selenium/webdriver/common.rb
has_fedcm_dialog
in common driver extensions.has_fedcm_dialog.rb
Add HasFedCmDialog module for FedCM dialog management.
rb/lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb
HasFedCmDialog
module with methods for FedCM dialog management.fedcm.rb
Introduce FedCM module with autoload.
rb/lib/selenium/webdriver/fedcm.rb
account.rb
Add Account class for FedCM accounts.
rb/lib/selenium/webdriver/fedcm/account.rb
dialog.rb
Add Dialog class for FedCM interactions.
rb/lib/selenium/webdriver/fedcm/dialog.rb
bridge.rb
Add FedCM dialog management methods in bridge.
rb/lib/selenium/webdriver/remote/bridge.rb
commands.rb
Add FedCM commands to bridge.
rb/lib/selenium/webdriver/remote/bridge/commands.rb
account.rbs
Add type signatures for FedCM Account.
rb/sig/lib/selenium/webdriver/fedcm/account.rbs
dialog.rbs
Add type signatures for FedCM Dialog.
rb/sig/lib/selenium/webdriver/fedcm/dialog.rbs
has_fed_cm_dialog.rbs
Add type signatures for HasFedCmDialog.
rb/sig/selenium/web_driver/driver_extensions/has_fed_cm_dialog.rbs
3 files
dialog_spec.rb
Add integration tests for FedCM dialog.
rb/spec/integration/selenium/webdriver/fedcm/dialog_spec.rb
account_spec.rb
Add unit tests for FedCM Account.
rb/spec/unit/selenium/webdriver/fedcm/account_spec.rb
dialog_spec.rb
Add unit tests for FedCM Dialog.
rb/spec/unit/selenium/webdriver/fedcm/dialog_spec.rb