Open iampopovich opened 2 days ago
β±οΈ Estimated effort to review [1-5] | 2 |
π§ͺ Relevant tests | Yes |
π Security concerns | No |
β‘ Key issues to review | None |
Category | Suggestion | Score |
Possible bug |
Add null check for
___
**Consider checking for nullity of | 9 |
Enhancement |
Improve assertion to provide detailed error messages___ **UseassertEquals instead of equals inside the assert statement to ensure that any assertion failure provides a clear and detailed message about the discrepancy between the expected and actual results.** [java/test/org/openqa/selenium/chrome/ChromeOptionsTest.java [397]](https://github.com/SeleniumHQ/selenium/pull/14217/files#diff-a2da4c56efda1ff71535e17798b3e48b6599280a2e215d9837d082182061a584R397-R397) ```diff -assert original.asMap().equals(merged.asMap()); +assertEquals(original.asMap(), merged.asMap()); ``` - [ ] **Apply this suggestion** Suggestion importance[1-10]: 8Why: Using `assertEquals` instead of `equals` inside the `assert` statement ensures that any assertion failure provides a clear and detailed message about the discrepancy between the expected and actual results, improving test diagnostics. | 8 |
Add detailed assertions for each property to ensure correct merging___ **Add assertions to check individual properties of the merged capabilities to ensure thateach property is correctly merged, especially focusing on Android-specific options.** [java/test/org/openqa/selenium/chrome/ChromeOptionsTest.java [395]](https://github.com/SeleniumHQ/selenium/pull/14217/files#diff-a2da4c56efda1ff71535e17798b3e48b6599280a2e215d9837d082182061a584R395-R395) ```diff var merged = original.merge(caps); +assertEquals("co_activity", merged.getAndroidActivity()); +assertEquals("co_package", merged.getAndroidPackage()); +assertEquals("co_experimental", merged.getExperimentalOption("experimental")); +assertTrue(merged.getArguments().contains("--co_argument")); ``` - [ ] **Apply this suggestion** Suggestion importance[1-10]: 7Why: Adding assertions for individual properties of the merged capabilities ensures that each property is correctly merged, especially focusing on Android-specific options. This enhances the thoroughness of the test. | 7 | |
Best practice |
Use
___
**Consider using | 6 |
@iampopovich seems the tests cannot be built https://github.com/SeleniumHQ/selenium/actions/runs/9745320822/job/26892961031?pr=14217#step:15:725
@diemol my bad , i forgot to import assertEquals
fix's on the way
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
according to bug #14133 I added androidOptions to merge method ChromiumOptions.mergeInPlace I also added a test for the new functionality.
Motivation and Context
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
androidOptions
inChromiumOptions.mergeInPlace
method to handle Android-specific parameters.ChromeOptionsTest
to verify the correct merging of Android-specific options.Changes walkthrough π
ChromiumOptions.java
Add merging of Android-specific options in ChromiumOptions
java/src/org/openqa/selenium/chromium/ChromiumOptions.java
androidOptions
inmergeInPlace
method.androidOptions
before merging.ChromeOptionsTest.java
Add test for merging Android-specific options in ChromeOptions
java/test/org/openqa/selenium/chrome/ChromeOptionsTest.java