-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Gracefully handle clashing device names #14713
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
This is the first time when I see suggestions from codium seems reasonable, @RenderMichael is it? (except caching) |
The pattern matching is actually a good suggestion! The maintainability one seems like overkill, especially with the lambda expression. Let me implement the pattern matching |
@nvborisenko changes are implemented ✅ |
CI is failing:
|
@nvborisenko That's a separate bug I found. Not sure why it's failing now Can I include a fix in this PR, or a separate one that would need to get merged first? |
Ah I understand now. I have the bug fixed locally, so it was passing for me. Also, I don't think any other test exercised this code path. |
Tests coverage is another topic, we even don't know what is covered. But please at least for your "simple" changes, given that you already added a test, let's keep it workable in this PR. |
The unrelated bug that this caught has been fixed in this PR |
CI is clean now, let me know if more changes are needed! |
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.
Thank you @RenderMichael !
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 handles the scenario where you request names clash between different types of devices.
Motivation and Context
Today, this throws an unhelpful
InvalidCastException
, with no indication that the user did anything wrong. Now, it throws anInvalidOperationException
(an exception whose meaning is "user cannot do this") with a better message.Types of changes
Checklist
PR Type
Bug fix, Tests
Description
InvalidCastException
withInvalidOperationException
for better clarity.FindDeviceById
to streamline device lookup and reduce code duplication.Changes walkthrough 📝
Actions.cs
Handle clashing device names with improved exception handling
dotnet/src/webdriver/Interactions/Actions.cs
FindDeviceById
method for device lookup.CombinedInputActionsTest.cs
Add tests for clashing device name handling
dotnet/test/common/Interactions/CombinedInputActionsTest.cs