-
-
Notifications
You must be signed in to change notification settings - Fork 768
find element by nspredicate string. #352
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
Conversation
@jlipps @Jonahss |
FYI @ericwengelking |
@Rafael-Chavez
|
} | ||
|
||
|
||
public static By IosNsPredicateString(final String id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Id?
There was a problem hiding this comment.
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
@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"); |
There was a problem hiding this comment.
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"
lgtm thanks @Rafael-Chavez ! |
@SuppressWarnings("unchecked") @Override | ||
public RequiredElementType findElementByIosNsPredicate(String using) | ||
throws WebDriverException { | ||
return (RequiredElementType) findElement("predicate string", using); |
There was a problem hiding this comment.
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)
@Rafael-Chavez I'm going to check it and merge it if everything is ok. |
@TikhomirovSergey can we ship this? |
@Rafael-Chavez Ok. I think that we are not able to merge this PR because:
|
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. |
@Rafael-Chavez |
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 |
@TikhomirovSergey isolated the test. |
@Rafael-Chavez ...And then I'll merge it |
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? |
@Rafael-Chavez Yes, you can create one here, https://github.com/appium/java-client/tree/master/docs |
@Rafael-Chavez |
@Rafael-Chavez |
import org.openqa.selenium.ScreenOrientation; | ||
import org.openqa.selenium.html5.Location; | ||
|
||
public class XCUIDriverTest extends BaseIOSTest { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@TikhomirovSergey got it working with xcuitest driver. Ill push documentation then squash my commits. |
@TikhomirovSergey @SrinivasanTarget according to github admin users need to squash? https://help.github.com/articles/about-pull-request-merge-squashing/ |
admins can squash for you, but it's better to do it yourself.
|
Thanks @bootstraponline !!!! |
@Rafael-Chavez |
addition to the PR #352
Also #379 has been opened. |
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 applyDetails
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