-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Allow driver path to be set using ENV variables #14287
[rb] Allow driver path to be set using ENV variables #14287
Conversation
…e/selenium into rb_use_env_var_for_driver_location
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
The only test failing is an unrelated Edge test, which I will create a PR for but I need #14433 to be merged first |
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.
Few comments from my side:
- What do you think about making the code more explicit rather than relying on class names? For example, we can make every service class have a constant specifying which environment variable can be used to override the finder behavior. This would make it easier for anyone looking at the code and we would be able to document it.
module Selenium
module WebDriver
module Safari
class Service
# You can explicitly specify the location of the driver
# using SE_SAFARIDRIVER="..." environment variable.
DRIVER_PATH_ENV_KEY = "SE_SAFARIDRIVER"
- Looking at the specs, I feel like they belong more to the unit tests, rather than integration ones because they don't need to start the driver. Can you update accordingly?
1 - That's a great idea with the constant to have the env variable, I just changed that
|
Yes, if you want to test Selenium Manager - it would be an integration test. However, if you only want to test the logic for fetching driver path via |
…on' into rb_use_env_var_for_driver_location
That's a great point, I moved everything as a unit test know because you are right the main core of this test is to fetch the ENV value I ran all the unit tests locally and all seem to be good so it's ready for re-review @p0deje |
Are there docs for this? |
Not really, we probably need to add it somewhere in https://www.selenium.dev/documentation/selenium_manager/? |
@aguspe do you have time to add docs for this? |
@aguspe I wrote a comment and I did not see your reply, sorry! |
Sorry for the delay but here is the PR for the doc update: SeleniumHQ/seleniumhq.github.io#1950 Let me know if any changes or more info is needed! |
Description
I added a new method on the common service class that sets the path equal to the value of the environment variable for the respective driver or returns nil
Motivation and Context
As explained in #14045 the goal of this PR is to provide users with an alternative option to set the path to their own drivers if they do not want to use selenium manager
Types of changes
Checklist