-
-
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
Split pr validate browsing context #12920
Split pr validate browsing context #12920
Conversation
Enhanced the BrowsingContext Constructor to Include Additional Validation for 'id' Parameter **Hello Selenium community! Your contribution matters and well-described pull requests make reviews and merges efficient. Thank you for your effort!** Before submitting your pull request, please review our [contributing guidelines](https://github.com/SeleniumHQ/selenium/blob/trunk/CONTRIBUTING.md). Keeping pull requests concise and focused helps reviewers. <!--- Provide a general summary of your changes in the Title above --> ### Description In this pull request, I've enhanced the `BrowsingContext` constructor to include additional validation for the 'id' parameter. The objective is to ensure that the 'id' parameter is not only non-null but also non-empty, providing an extra layer of validation. Additionally, I've introduced a validation step to confirm that the WebDriver instance supports the BiDi protocol before retrieving the BiDi instance. ### Motivation and Context This enhancement was motivated by the need to strengthen the validation process for the 'id' parameter in the `BrowsingContext` constructor. By introducing a check for empty string values, we ensure that the 'id' parameter is not only non-null but also contains meaningful content. Additionally, verifying the support for the BiDi protocol in the WebDriver instance helps prevent compatibility issues. ### Types of Changes - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ### Checklist <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I have read the [contributing guidelines](https://github.com/SeleniumHQ/selenium/blob/trunk/CONTRIBUTING.md). - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [] I have added tests to cover my changes. - [x] All new and existing tests passed.
In this commit, the LogEntryUtils interface is introduced to centralize the JSON deserialization logic for log entries. This helps eliminate code duplication in the GenericLogEntry and JavascriptLogEntry classes. The LogEntryUtils interface provides a common method for parsing JSON input into log entry objects. Additionally, a new test class, LogEntryUtilsTest, has been created to test the functionality of the LogEntryUtils interface. The JsonInputFactory class is utilized to create JsonInput instances consistently across tests.
Using Require.precondition()
…mment) Using Require.precondition()
Codecov ReportAll modified lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## trunk #12920 +/- ##
=======================================
Coverage 56.51% 56.51%
=======================================
Files 86 86
Lines 5255 5255
Branches 187 187
=======================================
Hits 2970 2970
Misses 2098 2098
Partials 187 187 ☔ View full report in Codecov by Sentry. |
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.
@manuelsblanco Thank you!
Co-authored-by: Diego Molina <diemol@users.noreply.github.com> Co-authored-by: Titus Fortner <titusfortner@users.noreply.github.com> Co-authored-by: Puja Jagani <puja.jagani93@gmail.com>
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
Added Require.precondition checks for string parameters to ensure they are not empty before proceeding with operations.
Motivation and Context
These changes are made to enhance the code's robustness and reliability by ensuring that the required string parameters are valid and not empty before performing various operations. This helps prevent unexpected errors and provides clear error messages when invalid input is detected.
Types of changes
Checklist