-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[dotnet] Enhance Selenium Manager platform detection #15649
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] Enhance Selenium Manager platform detection #15649
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
@qodo you are wrong, docs explicitly says pattern matching handles |
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.
Pull Request Overview
This PR refactors the platform detection logic for Selenium Manager to use the new OperatingSystem.Is*() API for .NET 8+ while falling back to RuntimeInformation.IsOSPlatform() for netstandard2.0. The changes include introducing a SupportedPlatform enum, using a switch expression for binary path selection, and improving error handling for unsupported platforms.
User description
🔗 Related Issues
Fixes #15646
💥 What does this PR do?
For .NET 8 target framework we use new
OperatingSystem.Is*()
API, and fallback toRuntimeInformation.IsOSPlatform()
in netstandard 2.0.🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement, Bug fix
Description
Refactored platform detection for Selenium Manager in .NET
OperatingSystem.Is*()
API for .NET 8+RuntimeInformation.IsOSPlatform()
for netstandard2.0Introduced
SupportedPlatform
enum for clearer platform handlingImproved maintainability and clarity of platform-specific binary selection
Changes walkthrough 📝
SeleniumManager.cs
Refactor and enhance platform detection logic in SeleniumManager
dotnet/src/webdriver/SeleniumManager.cs
SupportedPlatform
enum for platform abstraction