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

fix: bring back ability to automatically quote desired capabilities on win #1454

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

root-intruder
Copy link
Contributor

@root-intruder root-intruder commented Mar 23, 2021

Change list

  • Bring back automatic quote escaping for desired capabilities command line arguments on windows

Types of changes

What types of changes are you proposing/introducing to Java client?
Put an x in the boxes that apply

  • 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

Escaped quotes are necessary for starting appium from the command line on windows systems (see http://appium.io/docs/en/writing-running-appium/default-capabilities-arg/).

This capability to automatically quote on windows systems was completely removed with commit #1337. Since #1336 discovered a special case where automatic quote escaping on windows was not possible. That means, that windows users now need to manually escape the JSON such as:

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("\"platformName\"", "\"Android\"");

AppiumServiceBuilder builder = new AppiumServiceBuilder();
builder.withCapabilities(cap);

For a normal user this additional escape "\"platformName\"" is cumbersome and not intuitive at all. It also makes it hard to write java code running on windows and unix/linux systems.

From my understanding, the escaping should be done automatically by the java-client. However, this is a breaking change, thus I propose a switch to be able to enable quote escaping. If desired, I could also implement quote escaping as default behaviour with a switch to disable it. But I think this decision should be on your side.

Cheers!

@root-intruder root-intruder changed the title bring back ability to automatically quote desired capabilities on win fix: bring back ability to automatically quote desired capabilities on win Mar 23, 2021
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach left a comment

Choose a reason for hiding this comment

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

Thanks, I like it

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.

2 participants