[dotnet] Enhance Selenium Manager platform detection#15649
[dotnet] Enhance Selenium Manager platform detection#15649nvborisenko merged 2 commits intoSeleniumHQ:trunkfrom
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.
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
SupportedPlatformenum for clearer platform handlingImproved maintainability and clarity of platform-specific binary selection
Changes walkthrough 📝
SeleniumManager.cs
Refactor and enhance platform detection logic in SeleniumManagerdotnet/src/webdriver/SeleniumManager.cs
SupportedPlatformenum for platform abstraction