You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here are some key observations to aid the review process:
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review
Type Conversion The change from ChangeType to ToInt64 for JavaScript result conversion may affect type handling. Verify that ToInt64 handles all expected numeric types correctly.
Dictionary Comparison The change in dictionary comparison from CollectionAssert to Is.EquivalentTo should be validated to ensure equivalent behavior, especially for nested dictionaries and collections.
Use appropriate integer type conversion for scroll position values
Use Convert.ToInt32() instead of Convert.ToInt64() since the JavaScript scroll position is typically returned as a 32-bit integer. Using Int64 could lead to overflow issues with very large scroll positions.
Why: While both Int32 and Int64 would work, using Int32 is more appropriate for scroll position values as they rarely exceed 32-bit integer limits. However, this is a minor optimization with minimal impact on functionality.
nvborisenko
changed the title
[dotnet] Migrate remaining NUnit assertions to modern syntax
[dotnet] Migrate remaining NUnit assertions to Assert.That and Has.CountDec 6, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Migrates remaining assertions to
Assert.That, including improving some hand-rolled exception assertionsMotivation and Context
Contributes to #14852
Types of changes
Checklist
PR Type
enhancement, tests
Description
Assert.ThatwithHasandThrowsfor improved readability and consistency.Throwssyntax for better clarity.Changes walkthrough 📝
19 files
BrowserTest.cs
Update assertion syntax for user context count check.dotnet/test/common/BiDi/Browser/BrowserTest.cs
Has.Count.GreaterThanOrEqualTo.NetworkEventsTest.cs
Update assertion syntax for request cookies count check.dotnet/test/common/BiDi/Network/NetworkEventsTest.cs
Has.Count.EqualTo.ScriptCommandsTest.cs
Update assertion syntax for realm count checks.dotnet/test/common/BiDi/Script/ScriptCommandsTest.cs
Has.Count.EqualTo.StorageTest.cs
Update assertion syntax for cookie count checks.dotnet/test/common/BiDi/Storage/StorageTest.cs
Has.Count.EqualTo.ClickScrollingTest.cs
Modify JavaScript result conversion method.dotnet/test/common/ClickScrollingTest.cs
DriverElementFindingTest.cs
Update assertion syntax for element count checks.dotnet/test/common/DriverElementFindingTest.cs
Has.Count.EqualTo.ElementElementFindingTest.cs
Update assertion syntax for child element count checks.dotnet/test/common/ElementElementFindingTest.cs
Has.Count.EqualTo.ExecutingAsyncJavascriptTest.cs
Update assertion syntax for async JavaScript tests.dotnet/test/common/ExecutingAsyncJavascriptTest.cs
Has.Count.EqualTo.ExecutingJavascriptTest.cs
Update assertion syntax for JavaScript execution tests.dotnet/test/common/ExecutingJavascriptTest.cs
Has.Length.GreaterThan.ActionBuilderTest.cs
Update dictionary equivalence assertion syntax.dotnet/test/common/Interactions/ActionBuilderTest.cs
FileLogHandlerTest.cs
Update assertion syntax for log file content checks.dotnet/test/common/Internal/Logging/FileLogHandlerTest.cs
Has.Count.EqualTo.NavigationTest.cs
Update navigation assertion syntax for async methods.dotnet/test/common/NavigationTest.cs
Throws.Nothing.PositionAndSizeTest.cs
Update commented assertion syntax for position tests.dotnet/test/common/PositionAndSizeTest.cs
FirefoxDriverTest.cs
Update exception handling assertion syntax.dotnet/test/firefox/FirefoxDriverTest.cs
RemoteWebDriverSpecificTests.cs
Update driver type check assertion syntax.dotnet/test/remote/RemoteWebDriverSpecificTests.cs
EventFiringWebDriverTest.cs
Update exception handling assertion syntax.dotnet/test/support/Events/EventFiringWebDriverTest.cs
LoadableComponentTests.cs
Update exception handling assertion syntax.dotnet/test/support/UI/LoadableComponentTests.cs
SlowLoadableComponentTest.cs
Update exception handling assertion syntax.dotnet/test/support/UI/SlowLoadableComponentTest.cs
WebDriverWaitTest.cs
Update exception handling assertion syntax.dotnet/test/support/UI/WebDriverWaitTest.cs