-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Modernize exception handling in tests #14776
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
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
@nvborisenko Feedback has been addressed, this PR is ready for another look The feedback so far could be used to improve already-existing tests, but I wanted to keep this PR within reason. Maybe that can be a follow-up |
|
Thank you, @RenderMichael ! CI is failing due to unrelated changes (ShadowRoot). |

User description
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
This uses modern methods when making assertions or suppressions of exceptions.
Motivation and Context
Modernization and avoiding first-chance exceptions.
Types of changes
Checklist
PR Type
Enhancement, Tests
Description
Assert.That.Changes walkthrough 📝
10 files
AlertsTest.cs
Modernize exception handling in AlertsTestdotnet/test/common/AlertsTest.cs
Assert.Thatwith exception expectations.NetworkEventsTest.cs
Update exception handling in NetworkEventsTestdotnet/test/common/BiDi/Network/NetworkEventsTest.cs
ConfigureAwaitOptions.SuppressThrowing.CorrectEventFiringTest.cs
Simplify exception handling in CorrectEventFiringTestdotnet/test/common/CorrectEventFiringTest.cs
ElementAttributeTest.cs
Refactor exception handling in ElementAttributeTestdotnet/test/common/ElementAttributeTest.cs
Assert.Thatfor exceptions.RemoteSeleniumServer.cs
Enhance HTTP request handling in RemoteSeleniumServerdotnet/test/common/Environment/RemoteSeleniumServer.cs
TestWebServer.cs
Simplify HTTP request handling in TestWebServerdotnet/test/common/Environment/TestWebServer.cs
ExecutingJavascriptTest.cs
Modernize exception handling in ExecutingJavascriptTestdotnet/test/common/ExecutingJavascriptTest.cs
Assert.Thatfor exception expectations.FrameSwitchingTest.cs
Update frame switching exception handlingdotnet/test/common/FrameSwitchingTest.cs
TargetLocatorTest.cs
Refactor exception handling in TargetLocatorTestdotnet/test/common/TargetLocatorTest.cs
Assert.That.WindowSwitchingTest.cs
Modernize exception handling in WindowSwitchingTestdotnet/test/common/WindowSwitchingTest.cs
Assert.Thatfor exception handling.