Record Espresso Test For Two InstantApp Modules

大兔子大兔子 提交于 2019-12-11 11:50:52

问题


PROBLEM: An instantapp activity from one module (base) calls activity from another module (my_feature). Both should be tested using 'Record Espresso Test' in Android Studio.

RESEARCH: Espresso-generated code for non-instant application has R.id.component references on both activities. In an instant-app generated code only references from the first module are in the scope. So you can't access components from an activity of another module.

QUESTION: How to test inter-module actions in Espresso?

Opened a bug issue at Google: https://issuetracker.google.com/u/4/issues/77502630


回答1:


As far as there is no movement on the bug, I've resulted with a workaround, using Appium. It can be integrated into Android Studio tests, though a parrallel Appium window should be kept open in your system.

Appium is a higher-level testing framework on base of Selenium Web Driver. So it doesn't use Android Project Resources like Espresso and allows cross-feature testing. Moreover it allows cross-app testing and testing your app integractions with Android System messaging, settings, power, cellular signal and other features.

Here is a detailed instruction on how to setup Appium with Android Studio testing.



来源:https://stackoverflow.com/questions/49609987/record-espresso-test-for-two-instantapp-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!