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
[java] implement DriverFinder completely independent of Service classes #11491
Conversation
Codecov ReportBase: 54.65% // Head: 54.65% // No change to project coverage 👍
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## trunk #11491 +/- ##
=======================================
Coverage 54.65% 54.65%
=======================================
Files 85 85
Lines 5643 5643
Branches 244 244
=======================================
Hits 3084 3084
Misses 2315 2315
Partials 244 244 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Can we not have a
If executable is passed explicitly, it should not be null. Since
Just a suggestion, I might be missing something here. |
Driver finder needs the options instance. |
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.
I think this PR looks better than #11411, thanks @titusfortner!
However, I agree with the comments, it'd be nice to have a single DriverFinder
class.
a59e870
to
2e91ebf
Compare
So, this moves all the Really, though, combining the builder pattern with the one-off setter/getter feels really weird to me. It's nice that it just works without the user needing to do anything, but I was hoping there might be a better way to do this... 😄 |
Oh, and I changed the default error message to link to our documentation instead of directly to the driver URLs, which I think is preferable. |
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.
A small change requested to help code readability. Everything else looks 👍
Thank you!
Looks good to me overall. |
I'm moving this to draft because there is a selenium manager issue that needs to get resolved first, and it won't get released until at least 4.9 |
I figured out a simple way to remove the need for the |
7748b5b
to
d4c1846
Compare
@diemol all the issues I ran into with the selenium manager binary have been sorted now. |
a73b7d3
to
148cb95
Compare
There seems to be a linting error in the GeckoDriverServiceTest. Can you please help fix it? Overall, the PR LGTM. |
675372b
to
413ce3a
Compare
413ce3a
to
aa9243f
Compare
Diego wanted me to keep the constants in the Service class; instead of calling the service class values from the driver, I created an interface and methods to get the values in the drivers. Except, I can't get that class to load with Bazel. (please help) Also, I updated the DriverInfo classes because |
aa9243f
to
6d6fad8
Compare
moves driver location out of the Service classes
6d6fad8
to
673cd7e
Compare
I did not notice this PR being ready and I caused the conflict. I will review, solve the conflict, and if everything OK, I will merge it. |
# Conflicts: # java/src/org/openqa/selenium/remote/service/DriverService.java
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.
Thank you, @titusfortner!
CI failures are not related to this change.
Description
This is an alternate implementation of #11411
Advantages:
Disadvantages:
Motivation and Context
I got the idea from trying to see how I would implement this functionality in Ruby.
The underlying problem is that a user can create a service instance before the options instance. We can either:
Is there a better Java pattern here? Like, I guess we can avoid the setter/getter by building a new Service instance from the Driver constructor with a builder method that takes an existing Service instance and the executable path from the DriverFinder, but that doesn't prevent a Service instance from having a null executable value when constructed, and errors still happen in driver constructor rather than the service construction.
Any feedback appreciated.