简体   繁体   English

无法在Esbase脚本中找到用于检测不同设备的摄像头按钮的解决方案,以便在Firebase测试实验室上运行

[英]Not able to find solution for detecting camera button for different devices in Espresso script to be run on Firebase Test Lab

I have to create a script using Espresso to test my app in Firebase test lab. 我必须使用Espresso创建一个脚本,以在Firebase测试实验室中测试我的应用程序。 My app uses Camera to capture images and I have opened the default camera app. 我的应用程序使用相机捕获图像,我已打开默认的相机应用程序。

For testing on my device I give package name for the testing device that I am using. 为了在我的设备上进行测试,我给出了我正在使用的测试设备的包名。 The issue is that the camera app package names for different Android devices is different, and we do not know each of it. 问题是不同Android设备的相机应用程序包名称是不同的,我们不知道它们中的每一个。 Also it is not good to hard code package names. 硬编码包名称也不好。

I have searched out and not able to find a way to find a solution. 我已经搜索过,无法找到找到解决方案的方法。

Thanking in advance. 提前感谢。

I don't think there's a good way to do this with the actual camera app, since the camera app often differs between device models and Android versions. 我不认为使用实际的相机应用程序有一个很好的方法,因为相机应用程序通常在设备型号和Android版本之间有所不同。

How about you fake this dependency in your tests? 你在测试中伪造这种依赖性怎么样? Either by abstracting the code that calls the camera app, or by adding your own fake camera activity that will get called and returns you a picture the way it's supposed to happen. 要么通过抽象调用相机应用程序的代码,要么通过添加自己的假相机活动来调用它,并按照应该发生的方式返回一个图片。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Firebase测试实验室中并行运行Espresso工具测试? - How to run Espresso instrumentation tests in parallel in Firebase Test Lab? 录制 Firebase Test Lab Robot Script 时出现“Espresso Testing Framework does not support Compose projects” - "Espresso Testing Framework does not support Compose projects" when recording Firebase Test Lab Robot Script Android espresso 测试在本地通过,但在 Firebase 测试实验室失败 - Android espresso test pass locally but fails on Firebase Test Lab Firebase - 测试实验室 - 在物理设备上上传文件 - Firebase - Test Lab - Uploading files on physical devices 在Firebase测试实验室中获取可用设备的列表 - Get list of available devices in Firebase Test Lab Iabhelper在某些设备上的Firebase测试实验室中崩溃 - Iabhelper crashes in Firebase Test lab on some devices 是否可以将测试数据上传到 Firebase 测试实验室中的设备? - Is it possible to upload test data to devices in the Firebase test lab? Firebase测试实验室可以运行Monkeyrunner测试吗? - Can Firebase Test Lab run Monkeyrunner tests? 如何从CLI测试后获取gcloud Firebase测试实验室Android Espresso结果? - How to fetch gcloud Firebase test lab Android Espresso results after testing from CLI? Robo 脚本不适用于 Firebase 测试实验室中的 Robo 测试 - Robo Script is not working for Robo Test in Firebase Test Lab
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM