-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[dotnet] Remove client side validation of well-known Options #16120
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
base: trunk
Are you sure you want to change the base?
[dotnet] Remove client side validation of well-known Options #16120
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
OMG! var options = new ChromeOptions();
options.AddAdditionalOption("myCustomOption", "myCastomValue");
using var driver = new ChromeDriver(options);
It silently ignores unknown options! :( |
User description
This resolves design issue in .NET driver options class. Options class is a wrapper of well-known supported remote-end options, usually via strong typing. But meanwhile there is
AddAdditionalOption(...)
method which allows user to do what he wants.The issue in design is that
AddAdditionalOption(...)
method doesn't allow user what he wants because this method dictates to use another API. This is really bad, at compile time user is going to do something legible, but gets weird exception in runtime.🔗 Related Issues
It contributes to #16102, but doesn't resolve completely.
💥 What does this PR do?
Do not validate that user uses Selenium library improperly, he uses it correctly.
🔄 Types of changes
PR Type
Bug fix
Description
Remove client-side validation preventing legitimate API usage
Clean up constructor code removing capability name tracking
Simplify
ValidateCapabilityName
method implementationFix design issue with
AddAdditionalOption
method restrictionsDiagram Walkthrough
File Walkthrough
DriverOptions.cs
Remove capability validation infrastructure
dotnet/src/webdriver/DriverOptions.cs
ValidateCapabilityName
to only check for null/emptyChromiumOptions.cs
Remove ChromiumOptions constructor validation
dotnet/src/webdriver/Chromium/ChromiumOptions.cs
AddKnownCapabilityName
callsFirefoxOptions.cs
Clean up FirefoxOptions constructor
dotnet/src/webdriver/Firefox/FirefoxOptions.cs
AddKnownCapabilityName
calls from constructorInternetExplorerOptions.cs
Clean up InternetExplorerOptions constructor
dotnet/src/webdriver/IE/InternetExplorerOptions.cs
AddKnownCapabilityName
calls from constructorSafariOptions.cs
Clean up SafariOptions constructor
dotnet/src/webdriver/Safari/SafariOptions.cs
AddKnownCapabilityName
calls from constructor