Skip to content

Conversation

rafe-g
Copy link
Contributor

@rafe-g rafe-g commented Mar 31, 2016

Change list

Please provide briefly described change list which are you going to propose.
Added NSPredicate string to the java-client to support xcuitest driver nspredicate element search.

Types of changes

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

  • 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

Please provide more details about changes if it is necessary. If there are new features you can provide code samples which show the way they
work and possible use cases. Also you can create gists with pasted java code samples or put them here using markdown.
About markdown please read Mastering markdown and Writing on GitHub

@rafe-g
Copy link
Contributor Author

rafe-g commented Mar 31, 2016

@jlipps @Jonahss
This is to support the NSPredicate string added to xcuitesting framework driver facebookarchive/WebDriverAgent#124. This wont hurt being in master, people using the old UIA framework just wont be able to use this support.

@rafe-g
Copy link
Contributor Author

rafe-g commented Mar 31, 2016

FYI @ericwengelking

@TikhomirovSergey
Copy link
Contributor

@Rafael-Chavez
It is cool! 👍
But there are some remarks:

  • Please improve the PR description
  • please add some test which show how the feature works.

}


public static By IosNsPredicateString(final String id) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 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.

sorry let me fix this, should be iOSPredicateString

@rafe-g
Copy link
Contributor Author

rafe-g commented Mar 31, 2016

@TikhomirovSergey added test and updated pr description.


public static By IosNsPredicateString(final String iOSNsPredicateString) {
if (iOSNsPredicateString == null) {
throw new IllegalArgumentException("Must supply an iOS NsPredicate String");

Choose a reason for hiding this comment

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

Since this is just a comment I would format it "NSPredicate" instead of "NsPredicate"

@ericwengelking
Copy link

lgtm thanks @Rafael-Chavez !

@SuppressWarnings("unchecked") @Override
public RequiredElementType findElementByIosNsPredicate(String using)
throws WebDriverException {
return (RequiredElementType) findElement("predicate string", using);
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer for the locator strategy to be called "-ios ns predicate" or "-ios predicate string". either way it must have a - in front of it (see "-ios uiautomation" for analogy above)

@TikhomirovSergey TikhomirovSergey added this to the 4.0.0 milestone Apr 1, 2016
@TikhomirovSergey
Copy link
Contributor

@Rafael-Chavez I'm going to check it and merge it if everything is ok.

@TikhomirovSergey TikhomirovSergey removed this from the 4.0.0 milestone Apr 8, 2016
@rafe-g
Copy link
Contributor Author

rafe-g commented Apr 26, 2016

@TikhomirovSergey can we ship this?

@TikhomirovSergey
Copy link
Contributor

@Rafael-Chavez
Sorry for the late response. I totally forgot about this PR.

Ok. I think that we are not able to merge this PR because:

@rafe-g
Copy link
Contributor Author

rafe-g commented Apr 27, 2016

Appium works with appium-xcuitest-driver (I have it running locally), however it does not come with it out of the box. Which one were you referring to @TikhomirovSergey ?

Yes ill isolate the xcui driver test that i added to a XCUIDriverTest.java class.

@TikhomirovSergey
Copy link
Contributor

@Rafael-Chavez
Ok. Please isolate the test and show here how do you run it. Also I'll ask a question to appium team.

@bootstraponline
Copy link
Member

Hi, I'm in favor of this change being merged. The documentation should clearly state it's limited to the XCUITest driver because the old UIAutomation JavaScript driver also supports predicates.

Once the test is moved to XCUIDriverTest.java then I think it'll be ready for merging.

@rafe-g
Copy link
Contributor Author

rafe-g commented Apr 27, 2016

@TikhomirovSergey isolated the test.

@TikhomirovSergey TikhomirovSergey added this to the 4.0.0 milestone Apr 28, 2016
@TikhomirovSergey
Copy link
Contributor

@Rafael-Chavez
Please add a new ISOLATED test.
...And you can provide additional documentation/description if there are many details. You can put it here: https://github.com/appium/java-client/tree/master/docs. I'll add the link to WIKI.

...And then I'll merge it

@rafe-g
Copy link
Contributor Author

rafe-g commented Apr 28, 2016

Moved the test to a separate file.

@TikhomirovSergey Is this for me to create a Readme file with instructions on how to install appium-xcuitest-driver?

@SrinivasanTarget
Copy link
Member

@Rafael-Chavez Yes, you can create one here, https://github.com/appium/java-client/tree/master/docs

@TikhomirovSergey
Copy link
Contributor

TikhomirovSergey commented Apr 29, 2016

@Rafael-Chavez
Well. Test is isolated but there are some more remarks. Please make it clear.
It is not necessary to use BaseIOSTest. It was added because many integration tests use the same app and the same capability set. If something is different you can implement it as a standalone test. Take a look at IOSScrollTest

@TikhomirovSergey
Copy link
Contributor

@Rafael-Chavez
also please squash commits.

import org.openqa.selenium.ScreenOrientation;
import org.openqa.selenium.html5.Location;

public class XCUIDriverTest extends BaseIOSTest {
Copy link
Contributor

@TikhomirovSergey TikhomirovSergey Apr 29, 2016

Choose a reason for hiding this comment

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

Please add remove extends BaseIOSTest and add @BeforeClass/@BeforeTest and @afterclass/@after methods. They should instantiate IOSDriver with specific capabilities, I think. May be it needs some specific server flags.

This test won't work. It is using regular iOS UI Automation.

Copy link
Contributor

@TikhomirovSergey TikhomirovSergey Apr 29, 2016

Choose a reason for hiding this comment

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

This test won't work. It is using regular iOS UI Automation.

I've read this document
https://github.com/appium/appium-xcuitest-driver#usage

But anyway BaseIOSTest uses another app. This test won't find the target element.

@rafe-g
Copy link
Contributor Author

rafe-g commented Apr 29, 2016

@TikhomirovSergey got it working with xcuitest driver. Ill push documentation then squash my commits.

screen shot 2016-04-29 at 12 01 35 pm

@rafe-g
Copy link
Contributor Author

rafe-g commented Apr 30, 2016

@bootstraponline
Copy link
Member

@TikhomirovSergey @SrinivasanTarget according to github admin users need to squash?

admins can squash for you, but it's better to do it yourself.

$ git reset --soft head~19
$ git commit --amend
$ git push -f

@rafe-g
Copy link
Contributor Author

rafe-g commented Apr 30, 2016

Thanks @bootstraponline !!!!

@TikhomirovSergey TikhomirovSergey mentioned this pull request May 1, 2016
2 tasks
@TikhomirovSergey
Copy link
Contributor

@Rafael-Chavez
Ok. I'm merging this PR.
There is #378. Code style issues have been resolved there.
https://github.com/appium/java-client/blob/master/docs/Note-for-developers.md#code-style

@TikhomirovSergey
Copy link
Contributor

Also #379 has been opened.

@TikhomirovSergey
Copy link
Contributor

#398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants