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

chore: Add WDA-related XCUITestOptions #1552

Merged
merged 2 commits into from
Oct 26, 2021

Conversation

mykola-mokhnach
Copy link
Contributor

Change list

Added WDA-related XCUITestOptions

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)

Comment on lines +52 to +53
Optional.ofNullable(args).ifPresent((v) -> result.put("args", v));
Optional.ofNullable(env).ifPresent((v) -> result.put("env", v));
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor: parenthesis could be removed

Suggested change
Optional.ofNullable(args).ifPresent((v) -> result.put("args", v));
Optional.ofNullable(env).ifPresent((v) -> result.put("env", v));
Optional.ofNullable(args).ifPresent(v -> result.put("args", v));
Optional.ofNullable(env).ifPresent(v -> result.put("env", v));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer to keep them for better readability

Comment on lines 64 to 70
.map((v) -> {
try {
return (v instanceof URL) ? (URL) v : new URL(String.valueOf(v));
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor:

Suggested change
.map((v) -> {
try {
return (v instanceof URL) ? (URL) v : new URL(String.valueOf(v));
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
});
.map(v -> {
try {
return v instanceof URL ? (URL) v : new URL(String.valueOf(v));
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see above

Comment on lines 60 to 66
.map((v) -> {
try {
return (v instanceof URL) ? (URL) v : new URL(String.valueOf(v));
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor:

Suggested change
.map((v) -> {
try {
return (v instanceof URL) ? (URL) v : new URL(String.valueOf(v));
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
});
.map(v -> {
try {
return v instanceof URL ? (URL) v : new URL(String.valueOf(v));
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
});

} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

does it make sense to move the repeated logic to a new method CapabilityHelpers#toUrl(Object) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it does

Comment on lines 39 to 41
String signingId = cert.getXcodeSigningId() == null
? DEFAULT_XCODE_SIGNING_ID
: cert.getXcodeSigningId();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
String signingId = cert.getXcodeSigningId() == null
? DEFAULT_XCODE_SIGNING_ID
: cert.getXcodeSigningId();
String signingId = Optional.ofNullable(cert.getXcodeSigningId()).orElse(DEFAULT_XCODE_SIGNING_ID);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

@mykola-mokhnach mykola-mokhnach merged commit 523d643 into appium:master Oct 26, 2021
@mykola-mokhnach mykola-mokhnach deleted the xcuitest_options_2 branch October 26, 2021 18:32
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