-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] test Selenium Manager #16775
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?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
Co-authored-by: Michael Render <[email protected]>
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
|
In my opinion this is bad precedent. What we test... We should test that binding "invokes external dependency with proper parameters" and properly parse response. That's it. Testing... how to test... i don't see real unit tests. No clue. |
|
Well, needing unit tests in dotnet is a completely separate issue. 😂 Even then, this should be part of a slightly bigger change, and applied across the bindings. |
|
But also, something is weird on Windows... SM is not seeing the environment variables I'm passing in. Not sure if it is how the test is wired up, or an issue with how .NET is calling it. Once I figure out why, then we'll know if a unit test would have caught it. 😄 |
I don't mind having one integration test to invoke SM executing on GHA. +1 |
| var service = CreateServiceForCurrentBrowser(driverPath); | ||
|
|
||
| try | ||
| { | ||
| service.Start(); | ||
| Assert.That(service.ServiceUrl, Is.Not.Null); | ||
| Assert.That(service.ServiceUrl.IsAbsoluteUri, Is.True); | ||
| } | ||
| finally | ||
| { | ||
| service.Dispose(); | ||
| } |
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.
using statement
| string homeDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile); | ||
| if (!string.IsNullOrWhiteSpace(homeDirectory)) | ||
| { | ||
| return Path.Combine(homeDirectory, ".cache", "selenium"); | ||
| } |
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.
This is responsibility of SM, dotnet should not know about this folder.
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.
This is a way for us to see that it has in fact been downloaded and not just using the current installation. The contract is SE_CACHE_PATH which we check first. This is currently failing in windows, and again, depending on why would validate the need for this test. 😄
We could also set SE_CACHE_PATH as part of the test which would exercise the contract that way. That might be the right way to do this.
User description
🔗 Related Issues
.NET equivalent of #16756
💥 What does this PR do?
🔧 Implementation Notes
This could be split out in each of the browser directories instead of all handled in one test
💡 Additional Considerations
PR Type
Tests, Enhancement
Description
Add Selenium Manager tests for .NET across Windows, macOS, and Ubuntu
Verify driver and browser path discovery via DriverFinder
Validate driver service startup with discovered paths
Configure CI workflow with OS-specific caching and test matrix
Skip Safari and IE browsers as they don't require Selenium Manager
Diagram Walkthrough
File Walkthrough
SeleniumManagerTest.cs
New Selenium Manager test suite for .NETdotnet/test/common/SeleniumManagerTest.cs
DriverFinder.GetDriverPath()andGetBrowserPath()methodsDriverService.Start()with discovered driver pathsIgnoreBrowserattributesci-dotnet.yml
Add CI workflow for Selenium Manager tests.github/workflows/ci-dotnet.yml
manager-testsjob running on Windows, macOS, and Ubuntuhandling
falseto OS-specific keysBUILD.bazel
Update test suite configurationdotnet/test/common/BUILD.bazel