简体   繁体   English

使用 Firebase TestLab 测试 React Native App

[英]Test React Native App using Firebase TestLab

Is it possible to test a React Native (Expo Managed) app using Firebase TestLab?是否可以使用 Firebase TestLab 测试 React Native(Expo Managed)应用程序?

I have not succeeded.我没有成功。 Several possible routes, none successful thus far:几种可能的路线,到目前为止都没有成功:

1) Is it possible to force a Robo Test to keep running for a specified period of time? 1) 是否可以强制 Robo 测试在指定的时间段内继续运行? Currently, the default Robo Test runs only very briefly (<~1min) then terminates 'successfully'.目前,默认的 Robo 测试仅运行非常短暂(<~1 分钟),然后“成功”终止。 If I could just get the test to continue for longer, I could run all of the needed testing internally within the app.如果我能让测试持续更长时间,我就可以在应用程序内部运行所有需要的测试。 The Game Loop approach doesn't appear to be viable for a React Native app. Game Loop 方法似乎不适用于 React Native 应用程序。

2) Is it possible to create a Robo Script that selects UI elements by testID? 2) 是否可以创建一个通过 testID 选择 UI 元素的 Robo 脚本? In React Native the control over the native rendered elements is minimal.在 React Native 中,对原生渲染元素的控制是最小的。 It is, however, possible to specify testID on elements.但是,可以在元素上指定 testID。

3) Is it possible to use Android Studio to generate a Robo Script on a React Native (Expo) app? 3) 是否可以使用 Android Studio 在 React Native (Expo) 应用程序上生成 Robo 脚本? When I've tried, I can get the app to run using Android Studio->Firebase->Record Robo Script, but when I perform actions on the device, they are not logged in the scrip (actually, nothing is so no script is produced, just empty JSON).当我尝试过时,我可以使用 Android Studio->Firebase->Record Robo Script 来运行应用程序,但是当我在设备上执行操作时,它们并没有记录在脚本中(实际上,没有什么,所以没有脚本是生成,只是空的 JSON)。

Thank you谢谢

1) Yes. 1)是的。 From Web UI, this option is in Advanced options. 在Web UI中,此选项位于“高级”选项中。 Locally, you can pass the time in seconds using '--timeout-sec' parameter. 在本地,您可以使用'--timeout-sec'参数以秒为单位传递时间。

2) No, as of now, testID attribute is not supported by Roboscript (and by Robo). 2)不,到目前为止,Roboscript(以及Robo)不支持testID属性。

3) No (as you've noticed from your experience). 3)不(正如您从经验中注意到的那样)。 Roboscript recorder did not capture any of your actions, because it only works for regular Android widgets. Roboscript记录器无法捕获您的任何操作,因为它仅适用于常规的Android小部件。

I read the question but you've not shared anything about what you've done so far, anything about what you've been struggling with, but you just asked questions without even given a snippet of code to orient us about your real need, because sometimes questions about opinions can quickly lead to speculations. 我读了这个问题,但您至今尚未分享您所做的任何事情,您一直在奋斗的事情,但是您只是问了一些问题,甚至没有一小段代码就我们的实际需求确定了方向,因为有时关于意见的问题会很快引起猜测。

But about whetter you can use react native with Firebase Labtest, the answer is yes and to start there are two options depending on your skills with react native. 但是关于您可以在Firebase Labtest中使用React Native的方法,答案是肯定的,首先,有两种选择取决于您使用React Native的技能。 You can manually integrate react native firebase into your project if you are an experienced react native developper and really know what you're doing. 如果您是经验丰富的React Native开发人员并且确实知道自己在做什么,则可以手动将React Native Firebase集成到项目中。 But you can also install react native firebase into your standart react native template by going to the react native firebase's website. 但是,您也可以通过访问react native firebase的网站将react native firebase安装到标准的react native模板中。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM