Reputation: 3630
Our Android app is very large and we need a good portion of our code to be covered via Automation testing and we use Appium for this. Most of our Appium tests exercise portions of code that call endpoints and hence are time consuming. To a question by user asking how to mock endpoints, a reply in Appium forum (https://discuss.appium.io/t/how-to-mock-api-backend-in-native-apps/4183) seems to suggest to use Appium for end to end tests only?
My question is how in industry Appium tests are written? By definition of test pyramid, we should write very few end to end tests. So are industry apps using Appium have very few such tests? Is it uncommon to try to mock endpoints when using Appium? If not, how to mock endpoints with appium, for e.g. using WireMock?
Regards,
Paddy
Upvotes: 2
Views: 427
Reputation: 3658
Appium is perfect framework for UI automation of mobile apps, but it is definitely not intended to give 100% test coverage of the product (that includes not only mobile/web clients, but back-end services, databases, etc.)
The good practise with Appium (same to WebDriver on web) is too write short quick tests as much as its possible, meaning generate/prepare/remove test data or application state via api calls/database interactions. Appium does not force you to implement fully e2e tests: you can easily start appropriate Activity via Appium and continue test from that step, skipping bunch of previous steps covered in other test.
The common problem is when engineers are trying to build mobile automation testing on UI actions only relying on Appium, so that tests become time consuming, flaky and slow.
There is no much sense to start your UI tests suite if auth
service is down, right? And the quick way to get those errors is to have good API/integration test coverage - here we are back to test pyramid ;)
Upvotes: 1