Skip to content

[java] Ensure options presents in capabilities are merged as expected#11396

Merged
pujagani merged 5 commits intoSeleniumHQ:trunkfrom
pujagani:merge-options-in-caps
Dec 26, 2022
Merged

[java] Ensure options presents in capabilities are merged as expected#11396
pujagani merged 5 commits intoSeleniumHQ:trunkfrom
pujagani:merge-options-in-caps

Conversation

@pujagani
Copy link
Copy Markdown
Contributor

@pujagani pujagani commented Dec 9, 2022

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

Ensure options present in capabilities are merged as expected

Motivation and Context

  MutableCapabilities browserCaps = new MutableCapabilities();
    browserCaps.setCapability("binary", "/path/to/browser");
    MutableCapabilities addCaps = new MutableCapabilities();
    addCaps.setCapability("goog:chromeOptions", browserCaps);
    ChromeOptions options = existingOptions.merge(addCaps);

The above example is a valid use-case that was not accounted for earlier. The changes address the same and fix it.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@pujagani pujagani requested a review from titusfortner December 9, 2022 06:25
Comment thread java/src/org/openqa/selenium/chromium/ChromiumOptions.java Outdated
Comment thread java/test/org/openqa/selenium/chrome/ChromeOptionsTest.java Outdated
Comment thread java/src/org/openqa/selenium/firefox/FirefoxOptions.java Outdated
Comment thread java/test/org/openqa/selenium/chrome/ChromeOptionsTest.java Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 9, 2022

Codecov Report

Base: 54.54% // Head: 54.54% // No change to project coverage 👍

Coverage data is based on head (07eeb01) compared to base (21fe296).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #11396   +/-   ##
=======================================
  Coverage   54.54%   54.54%           
=======================================
  Files          85       85           
  Lines        5627     5627           
  Branches      243      243           
=======================================
  Hits         3069     3069           
  Misses       2315     2315           
  Partials      243      243           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pujagani pujagani added this to the 4.8 milestone Dec 22, 2022
@pujagani pujagani force-pushed the merge-options-in-caps branch from 395c7a3 to d5ed1b3 Compare December 26, 2022 08:07
@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@pujagani pujagani merged commit e30a7eb into SeleniumHQ:trunk Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants