-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Making SeleniumManager a thin wrapper #13833
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
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?
| /// An array with two entries, one for the driver path, and another one for the browser path. | ||
| /// </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?
| 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
DriverFinderto be an instance class with enhanced capabilities for retrieving and validating browser and driver paths.ChromiumDriver,FirefoxDriver,InternetExplorerDriver, andSafariDriverto useDriverFinderfor path resolution.SeleniumManagerto 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 Resolutiondotnet/src/webdriver/Chromium/ChromiumDriver.cs
DriverFinderfor determining driver and browserpaths.
DriverFinderresults.DriverFinder.cs
Enhance DriverFinder with Browser and Driver Path Retrievaldotnet/src/webdriver/DriverFinder.cs
DriverFinderfrom static to instance class withDriverOptionsdependency.Manager.
arguments.
DriverService.cs
Update DriverService to Use DriverFinder for Executable Pathdotnet/src/webdriver/DriverService.cs
DriverFinderfor setting driver service executablepath.
FirefoxDriver.cs
Refactor FirefoxDriver to Use DriverFinder for Path Resolutiondotnet/src/webdriver/Firefox/FirefoxDriver.cs
DriverFinderfor determining driver and browserpaths.
DriverFinderresults.InternetExplorerDriver.cs
Update InternetExplorerDriver to Use DriverFinderdotnet/src/webdriver/IE/InternetExplorerDriver.cs
DriverFinderfor determining driver service path.SafariDriver.cs
Update SafariDriver to Use DriverFinder for Path Resolutiondotnet/src/webdriver/Safari/SafariDriver.cs
DriverFinderfor determining driver service path.SeleniumManager.cs
Refactor SeleniumManager to Support Enhanced Binary Path Retrievaldotnet/src/webdriver/SeleniumManager.cs
BinaryPathsmethod to accept arguments for Selenium Managerinvocation.