Flavors and instrumentation tests - gradle configuration

╄→гoц情女王★ 提交于 2019-12-01 12:16:51

When you setup a new project in android studio it creates a main folder and an androidTest folder. Gradle uses the androidTest folder for common tests across all flavors. See link. So if you try try to write a flavour specific test and put it in the androidTest folder, it will be run against all your flavors and will probably fail.

So if you want to create flavor specific tests you need to add a new test folder for that flavor containing the java folder and your test. The naming convention has to be androidTestFlavorName. See image below.

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