-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[dotnet] Simplify testing driver factory #15245
base: trunk
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
@@ -30,6 +30,11 @@ public DefaultSafariDriver(SafariOptions options) | |||
{ | |||
} | |||
|
|||
public DefaultSafariDriver(SafariDriverService service) |
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.
Not sure it is in runtime. As I remember we always use ctor with service
and options
.
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 saw it was included in your PR #14662 so it would be simpler to include it here and shrink that PR.
If we don't use it, then that's OK. I think it doesn't hurt anything, and makes potential future refactorings simpler, no?
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 don't think code, which is not used, makes life easier.
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.
Fixed
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.
We should define a strategy how we want to introduce async methods. As soon as we have clear vision, then will proceed.
@@ -208,41 +207,16 @@ protected void OnDriverLaunching(DriverService service, DriverOptions options) | |||
return options; | |||
} | |||
|
|||
|
|||
private T MergeOptions<T>(object baseOptions, DriverOptions overriddenOptions) where T : DriverOptions, new() |
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.
Completely unused method
Please ignore my last comment, wrong tab. |
No worries! I removed the extra constructors on the testing driver implementations. Let me know if there's anything else this PR needs |
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Motivation and Context
Taking some code changes out of #14662 which can be added without that feature.
Preparatory work for taking more changes from that PR.
Types of changes
Checklist
PR Type
Enhancement, Tests
Description
Added constructors to driver classes for
DriverService
initialization.Refactored
DriverFactory
for improved readability and functionality.Simplified
EnvironmentManager
by introducing readonly fields and properties.Removed redundant methods and improved code consistency across files.
Changes walkthrough 📝
11 files
Added constructor for `SafariDriverService` initialization.
Added constructor for `ChromeDriverService` initialization.
Added constructor for `EdgeDriverService` initialization.
Added constructor for `InternetExplorerDriverService` initialization.
Added constructor for `FirefoxDriverService` initialization.
Added constructor for `SafariDriverService` initialization.
Added constructor for `ChromeDriverService` initialization.
Added constructor for `EdgeDriverService` initialization.
Added constructor for `FirefoxDriverService` initialization.
Refactored `DriverFactory` for better readability and functionality.
Simplified `EnvironmentManager` with readonly fields and properties.