#732 FIX#733
Conversation
|
@welnanick you can can comment the PR if you have something to say about this :) |
| /** | ||
| * @return name of the current mobile platform. | ||
| */ | ||
| default String getPlatformName() { |
There was a problem hiding this comment.
I'd also mark these with Nullable annotation
There was a problem hiding this comment.
same comment for the stuff below
| boolean isBrowser(); | ||
| default boolean isBrowser() { | ||
| return ofNullable(getSessionDetail("browserName")) | ||
| .map(browserName -> browserName.toString()) |
There was a problem hiding this comment.
can be String::valueOf
| Response response = execute(GET_SESSION); | ||
| Map<String, Object> resultMap = Map.class.cast(response.getValue()); | ||
|
|
||
| return ImmutableMap.<String, Object>builder() |
There was a problem hiding this comment.
It might be helpful to have a comment here about why additional filtering is necessary
| @Override public boolean isBrowser() { | ||
| return !getContext().toLowerCase().contains("NATIVE_APP".toLowerCase()); | ||
| return super.isBrowser() | ||
| && !getContext().toLowerCase().contains("NATIVE_APP".toLowerCase()); |
There was a problem hiding this comment.
Apache's StringUtils has StringUtils.containsIgnoreCase method
|
Overall good, just several minor things |
|
@mykola-mokhnach I made improvements. |
| Response response = execute(GET_SESSION); | ||
| Map<String, Object> resultMap = Map.class.cast(response.getValue()); | ||
|
|
||
| //this filtering was added to clear returned result. |
There was a problem hiding this comment.
-> was added to avoid unexpected NPE on putAll call if the response map contains null value(s)
There was a problem hiding this comment.
@mykola-mokhnach Not only for this purpose. I think empty strings is not useful data and it increases complexity of further operations. So let there will be something useful or null-value when user tries
driver.getSessionDetail("someDetail")There was a problem hiding this comment.
of course, just mention the same thing in the comment
|
@SrinivasanTarget have you run iOS test in legacy and xCUIT mode? What was the result? Could you try to run some browser/webview script in xCUIT mode and check class of elements that are found? What the result? |
|
Srini, was on vacation. if he is not back today ... I can help run tests on iOS and close it today .... |
|
Yup i did tested on XCUIT mode including native and webviews but i dont have old xcode to test in legacy mode. Everything looks perfectly fine in XCUIT mode. Will download xcode 7.0.1 and give a try today. Code looks good to me as well. Will keep you posted about legacy mode (including native and webviews) |
|
Is there a way I can build this locally to verify my issue is fixed? Do I just clone the repo and run a gradle build? |
|
@welnanick You can try this, |
|
@SrinivasanTarget Alright, once I get a chance here in a few minutes I'll try that and let you all know the results. |
|
Thanks @welnanick |
|
What you suggested to try to get the build didn't work, I get this error through gradle: |
SrinivasanTarget
left a comment
There was a problem hiding this comment.
Tested, everything looks fine on both legacy and XCUIT modes.
Change list
#732 FIX
Types of changes
Details
Also I found out that logic of Selenium Capabilities has changed since Jan'2017 and
capabilities.getCapability("platformName")is not the same as the platform name that user gives to start Android/iOS/Windows session.@SrinivasanTarget Could you run iOS tests with this change?
I am looking forward to improve tests to make them run on Sauce env (will be the next PR).