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

Workaround to find UiObject2 and invoke actions #371

Merged
merged 8 commits into from
Jan 18, 2019

Conversation

rajdeepv
Copy link
Collaborator

@rajdeepv rajdeepv commented Jan 13, 2019

This is a workaround for #359. There are a few cases where we have no option but drive out of app areas somehow. As per @dpgraham , we need to merge uiautomator2 and espresso drivers, but until that is done this can be a stop-gap
eg.
@driver.execute_script("mobile: uiautomator", {:byMethod => 'clazz', locator: 'android.widget.TextView', index: 2, :action => "click"})

@sravanmedarapu
Copy link
Member

sravanmedarapu commented Jan 13, 2019

Like this approach, this workaround approach should also help in scrolling related operations if we make minor changes to this PR, #59 until we implement hamcrest-matcher selector strategy.

@sravanmedarapu
Copy link
Member

I think in the given scope of the PR, achieving UIScrollable of UIAutomator1.0 support would required a considerable changes and I feel we can take up that feature as a separate PR.

@mykola-mokhnach
Copy link
Contributor

mykola-mokhnach commented Jan 14, 2019

it would be nice to have at least two e2e tests for this endpoint (one for index == null and the other for index != null)

See https://github.com/appium/appium-espresso-driver/blob/master/test/functional/commands/mobile-e2e-specs.js for the reference

@imurchie imurchie added this to the Sprint 30 milestone Jan 15, 2019
@@ -93,4 +93,15 @@ describe('mobile', function () {
await driver.execute('mobile: scrollToPage', {element: el, scrollTo: 'left', smoothScroll: true}).should.eventually.be.rejectedWith(/Could not perform scroll to on element/);
});
});

describe('mobile:uiautomator', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@mykola-mokhnach mykola-mokhnach merged commit 8dbbfc4 into appium:master Jan 18, 2019
@KazuCocoa
Copy link
Member

Can you add this brilliant command in https://github.com/appium/appium/blob/master/docs/en/commands/mobile-command.md like mobile:backdoor when you have a time?

@rajdeepv rajdeepv deleted the uiautomator branch January 19, 2019 13:14
@rajdeepv
Copy link
Collaborator Author

@KazuCocoa appium/appium#12038

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.

6 participants