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

add custom locator strategy #1041

Merged
merged 4 commits into from
Oct 18, 2018
Merged

add custom locator strategy #1041

merged 4 commits into from
Oct 18, 2018

Conversation

jlipps
Copy link
Member

@jlipps jlipps commented Oct 17, 2018

Add the locator strategy in the client to go with appium/appium-base-driver#268.

I based this PR on #990 so hopefully it's OK.

@mykola-mokhnach
Copy link
Contributor

It looks like the linter is not very happy

* @since Appium 1.9.2
*/
default T findElementByCustom(String selector) {
return findElement(MobileSelector.IMAGE.toString(), selector);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why MobileSelector.IMAGE ?

Copy link
Member

Choose a reason for hiding this comment

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

Same question why IMAGE ?

Copy link
Member Author

Choose a reason for hiding this comment

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

that was a mistake; I changed it to CUSTOM


public interface FindsByCustom<T extends WebElement> extends FindsByFluentSelector<T> {
/**
* Performs the lookup for a single element by sending a selector to a custom element finding
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be handy to put a link to some online document here

Copy link
Member Author

Choose a reason for hiding this comment

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

How about promises that I will add documentation soon? :-)

* @since Appium 1.9.2
*/
default List<T> findElementsByCustom(String selector) {
return findElements(MobileSelector.IMAGE.toString(), selector);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@jlipps
Copy link
Member Author

jlipps commented Oct 17, 2018

the travis failure is because of some ios webview issue:

[debug] [W3C] Encountered internal error running command: Error: Could not navigate to webview! Err: Object.values is not a function
    [debug] [W3C]     at /Users/travis/.nvm/versions/node/v6.14.3/lib/node_modules/appium/node_modules/appium-ios-driver/lib/commands/context.js:520:15
    [debug] [W3C]     at throw (native)
    [debug] [W3C]     at asyncGeneratorStep (/Users/travis/.nvm/versions/node/v6.14.3/lib/node_modules/appium/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
    [debug] [W3C]     at _throw (/Users/travis/.nvm/versions/node/v6.14.3/lib/node_modules/appium/node_modules/@babel/runtime/helpers/asyncToGenerator.js:29:9)

@jlipps
Copy link
Member Author

jlipps commented Oct 18, 2018

Docs PR: appium/appium#11544

@jlipps
Copy link
Member Author

jlipps commented Oct 18, 2018

doc links added, though of course they will 404 till new docs are published (which should happen before the next java client publish i imagine, so i think it's ok to merge now)

@jlipps jlipps merged commit f10393a into master Oct 18, 2018
@jlipps jlipps deleted the jlipps-custom-loc-strat branch October 18, 2018 05:26
@SrinivasanTarget
Copy link
Member

👍

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.

4 participants