add custom locator strategy by jlipps · Pull Request #1041 · appium/java-client

@jlipps

@jlipps

@mykola-mokhnach

It looks like the linter is not very happy

mykola-mokhnach

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

Choose a reason for hiding this comment

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

Why MobileSelector.IMAGE ?

Choose a reason for hiding this comment

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

Same question why IMAGE ?

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

mykola-mokhnach


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

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

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? :-)

mykola-mokhnach

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

Choose a reason for hiding this comment

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

same here

@jlipps

@jlipps

@jlipps

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)

saikrishna321

@jlipps

@jlipps

@jlipps

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)

mykola-mokhnach

@jlipps jlipps deleted the jlipps-custom-loc-strat branch

October 18, 2018 05:26

@SrinivasanTarget