google / mobly

E2E test framework for tests with complex environment requirements.
https://github.com/google/mobly
Apache License 2.0
621 stars 174 forks source link

Check that some views are present on Activity #888

Closed AntonMalyshev closed 9 months ago

AntonMalyshev commented 1 year ago

Hi guys, How can I test that my activity has specific TextViews displaying specific text, do you have some functions for that?

xpconanfan commented 9 months ago

This is not a mobly question? Pls check Android resources.

AntonMalyshev commented 9 months ago

Doesn't Mobly provide this functionality?

xpconanfan commented 9 months ago

Just like Mobly doesn't provide the functionality of installing apks. But it doesn't mean you can't install apks in Mobly tests.

AntonMalyshev commented 9 months ago

I see, thank you. Probably I misunderstood what can be done with Mobly. The documentation suggests to use it only for the testing of end-to-end Bluetooth connectivity...

xpconanfan commented 9 months ago

Ah I see. Sorry about the confusion. We don't own that particular page. Thanks for bringing it to our attention.

Mobly is used for BT testing for sure, but it's not the only use case of it :)

AntonMalyshev commented 9 months ago

Anyway, regarding the original question is Mobly good for end to end UI testing of some Android app screens or is it better to use Espresso or Appium? Would really appreciate any guidance here / references to documentation / etc.

xpconanfan commented 9 months ago

The decision is really up to you.

You can use https://github.com/google/snippet-uiautomator in Mobly tests to operate app UIs. It's pretty easy to set up. You can give it a try.