Skip to content
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

[js] Allow builder to set a single arbitrary capability #9857

Merged
merged 6 commits into from
Sep 29, 2021

Conversation

pujagani
Copy link
Contributor

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

Allow builder to set a single arbitrary capability. Fixes #9830.

Motivation and Context

Details are explained in #9830

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.

@titusfortner
Copy link
Member

I think setCapability() is the "right" method name, but might be worth considering using withCapabilities() since that sounds like it is the backward compatible name.

Also, can additional capabilities can be added to the browser options class like it can be in the other languages? Makes sense to have it in both places.

@pujagani
Copy link
Contributor Author

pujagani commented Sep 22, 2021

I think setCapability() is the "right" method name, but might be worth considering using withCapabilities() since that sounds like it is the backward compatible name.

@AutomatedTester You might have more context regarding this since it was deprecated for a reason. Can you please help answer this one? Thank you!

Also, can additional capabilities can be added to the browser options class like it can be in the other languages? Makes sense to have it in both places.

Yes, this is possible since the Options class inherits from Capabilities. So it is possible to set a capability using Options as with other languages.

@AutomatedTester
Copy link
Member

@titusfortner has been looking at these in all the different bindings, maybe he can leave his thoughts.

@titusfortner
Copy link
Member

My take is that as long as there's a setCapability() in the options class that works to set top level capabilities, then we should restore withCapabilities() for this functionality the builder. It's not the same method name as Java's builder class, but I think maintaining backwards compatibility would be more useful here.

@pujagani
Copy link
Contributor Author

I agree with @titusfortner. I will restore withCapabilities in a separate PR to ensure backward compatibility. But since other language bindings have a setCapability() in the builder, I might be a good idea to have both.

@pujagani pujagani merged commit 1c817b5 into SeleniumHQ:trunk Sep 29, 2021
@sonarcloud
Copy link

sonarcloud bot commented Sep 29, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

Convenience Builder method to set arbitrary capabilities (JavaScript/Node.js)
3 participants