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

feat: create driver option classes #1331

Merged
merged 3 commits into from
Apr 6, 2020
Merged

Conversation

titusfortner
Copy link
Contributor

@titusfortner titusfortner commented Apr 3, 2020

Change list

  • Added MobileOptions, IOSOptions and AndroidOptions for easier capability generation

Types of changes

  • No changes in production code.
  • Bugfix (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 not work as expected)

Details

Replacement PR for #1319

I've decided that it is too much of a pain to implement all of the options for Android & iOS.
All the subclasses will do is create the correct platform name. Any platform specific values will need to be added by a user with setCapability().

Again, the reasoning for this approach is it is similar to how Selenium encapsulates the capabilities for the driver specific options, and this will be a better thing to encourage users away from using DesiredCapabilities when that class gets deprecated.

Also, should these be named IOSOptions and AndroidOptions or does "Mobile" need to be in there?

@titusfortner titusfortner changed the title New opts feat: create driver option classes Apr 3, 2020
* @return this MobileOptions, for chaining.
* @see org.openqa.selenium.remote.CapabilityType#PLATFORM_NAME
*/
public T setPlatformName(String platform) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this option is not just mobile, but is also applicable to other driver, like for example the Mac OS or Windows one. I was also thinking about what we could do with these. Perhaps, it makes sense to extract such common options into an interface with default method implementations (aka java-like mixin) and add this interface into concrete option classes for different platforms?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but of the 10 capabilities specified in the w3c, this is really the only one that applies to mobile, so I don't think it is worth spending time on the overlap.

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.

None yet

3 participants