【发布时间】:2016-10-20 16:20:00
【问题描述】:
我尝试在 Google Cloud 测试实验室中运行我的测试。我的单元测试和 espressos 测试顺利通过。
但是对于一些需要 Google API 的 espresso 测试,例如地图和地点,我的测试失败了。
当我在 Google Cloud Test Lab 中运行此确切代码时,它会失败并返回“没有可用的播放服务!” :
@org.junit.Test
public void testPlayServicesAvailables() throws Exception {
GoogleApiAvailability googleAPI = GoogleApiAvailability.getInstance();
int result = googleAPI.isGooglePlayServicesAvailable(WayzUpApp.getContext());
if (result != ConnectionResult.SUCCESS) {
throw new Exception("No play services availables !");
}
}
要启动我的云测试,我使用以下命令:
gcloud beta test android run --app app/build/outputs/apk/app-debug.apk --test app/build/outputs/apk/app-debug-androidTest.apk --device-ids Nexus5 -- os-version-ids 23 --locales fr --orientations Portrait
有没有办法让 Cloud Test Lab 上的 Play 服务可用?
谢谢。
【问题讨论】:
-
我没有改变我原来的配置的任何问题了。
标签: android testing google-play-services gcloud