-
-
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
[dotnet] Making SeleniumManager a thin wrapper #13833
Conversation
Also moving things to the driver classes and DriverFinder. Logging warnings from Selenium Manager as well, and debug messages when that level is enabled.
PR Description updated to latest commit (b7fff80)
|
PR Review
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
return BinaryPaths()[DriverPathKey]; | ||
} | ||
|
||
public bool HasBrowserPath() |
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.
Seems better having a property HasBrowserPath
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.
How would you do it as a property?
/// </returns> | ||
public static string DriverPath(DriverOptions options) | ||
public static Dictionary<string, string> BinaryPaths(string arguments) |
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.
It is public API, where we should be careful. Can we split this method to two methods? For BrowserBinaryPath
and DriverBinaryPath
?
Dictionary in public API doesn't look intuitive for users.
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.
Theoretically, BinaryPaths
should only be used from DriverFinder
. Should we make it private?
@@ -214,6 +186,27 @@ public static string DriverPath(DriverOptions options) | |||
throw new WebDriverException($"Error deserializing Selenium Manager's response: {output}", ex); | |||
} | |||
|
|||
if (result.ContainsKey("logs")) |
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.
result
object can be strongly typed, just deserialize to object from the json, later it is comfortable to work with this object.
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.
Isn't this what I did in the following line?
Dictionary<string, string> logs = result["logs"] as Dictionary<string, string>;
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.
Maybe I do not understand what you are suggesting.
User description
Also moving things to the driver classes and
DriverFinder.
Logging warnings from Selenium Manager as well,
and debug messages when that level is enabled.
.NET implementation for #13022
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
Motivation and Context
Types of changes
Checklist
Type
enhancement
Description
DriverFinder
to be an instance class with enhanced capabilities for retrieving and validating browser and driver paths.ChromiumDriver
,FirefoxDriver
,InternetExplorerDriver
, andSafariDriver
to useDriverFinder
for path resolution.SeleniumManager
to accept arguments for Selenium Manager invocation and added logging for debug messages and warnings.Changes walkthrough
ChromiumDriver.cs
Refactor ChromiumDriver to Use DriverFinder for Path Resolution
dotnet/src/webdriver/Chromium/ChromiumDriver.cs
DriverFinder
for determining driver and browserpaths.
DriverFinder
results.DriverFinder.cs
Enhance DriverFinder with Browser and Driver Path Retrieval
dotnet/src/webdriver/DriverFinder.cs
DriverFinder
from static to instance class withDriverOptions
dependency.Manager.
arguments.
DriverService.cs
Update DriverService to Use DriverFinder for Executable Path
dotnet/src/webdriver/DriverService.cs
DriverFinder
for setting driver service executablepath.
FirefoxDriver.cs
Refactor FirefoxDriver to Use DriverFinder for Path Resolution
dotnet/src/webdriver/Firefox/FirefoxDriver.cs
DriverFinder
for determining driver and browserpaths.
DriverFinder
results.InternetExplorerDriver.cs
Update InternetExplorerDriver to Use DriverFinder
dotnet/src/webdriver/IE/InternetExplorerDriver.cs
DriverFinder
for determining driver service path.SafariDriver.cs
Update SafariDriver to Use DriverFinder for Path Resolution
dotnet/src/webdriver/Safari/SafariDriver.cs
DriverFinder
for determining driver service path.SeleniumManager.cs
Refactor SeleniumManager to Support Enhanced Binary Path Retrieval
dotnet/src/webdriver/SeleniumManager.cs
BinaryPaths
method to accept arguments for Selenium Managerinvocation.