-
-
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 DriverService
and DriverFinder
#15028
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:
|
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.
Description
Removes code duplication by consolidating
GenerateDriverServiceCommandExecutor
into an instance method onDriverService
. Also addsTry*
method toDriverFinder
to simplify lookups.Motivation and Context
Some quick code cleanup opportunity I noticed.
Types of changes
Checklist
PR Type
Enhancement
Description
Consolidated
GenerateDriverServiceCommandExecutor
intoDriverService
asCreateCommandExecutor
.Simplified driver initialization across multiple driver classes.
Enhanced
DriverFinder
with nullability, error handling, and aTryGetBrowserPath
method.Improved code readability and reduced duplication in driver service handling.
Changes walkthrough 📝
ChromiumDriver.cs
Simplified ChromiumDriver initialization.
dotnet/src/webdriver/Chromium/ChromiumDriver.cs
GenerateDriverServiceCommandExecutor
withCreateCommandExecutor
.DriverFinder.cs
Enhanced DriverFinder with nullability and new methods.
dotnet/src/webdriver/DriverFinder.cs
TryGetBrowserPath
method for safer browser path retrieval.BinaryPaths
for better readability and caching.DriverService.cs
Centralized command executor creation in DriverService.
dotnet/src/webdriver/DriverService.cs
CreateCommandExecutor
method to centralize command executorcreation.
DriverService
.FirefoxDriver.cs
Simplified FirefoxDriver initialization.
dotnet/src/webdriver/Firefox/FirefoxDriver.cs
GenerateDriverServiceCommandExecutor
withCreateCommandExecutor
.InternetExplorerDriver.cs
Simplified InternetExplorerDriver initialization.
dotnet/src/webdriver/IE/InternetExplorerDriver.cs
GenerateDriverServiceCommandExecutor
withCreateCommandExecutor
.SafariDriver.cs
Simplified SafariDriver initialization.
dotnet/src/webdriver/Safari/SafariDriver.cs
GenerateDriverServiceCommandExecutor
withCreateCommandExecutor
.