如何将Firebase TestLab与React Native一起使用 [英] How to use firebase TestLab with react native

查看:162
本文介绍了如何将Firebase TestLab与React Native一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在firebase TestLab上为我的react本地应用程序运行robo测试,但是我无法获得robo test pass登录.

I was trying to run a robo test for my react native app on firebase TestLab, but I couldn't get the robo test pass login.

第一个问题是它没有输入电子邮件和密码.

The first problem is that it doesn't type in email and password.

在我的js文件中,我有:

In my js file I had:

<Input ... testID="usernameInput" />
<Input ... testID="passwordInput" />

然后将其放在Firebase控制台中

and I put this in my firebase console

但是,它根本没有用.我检查了录像,没有输入.

However, it didn't work at all. I checked the video recording, it was not typed in.

第二个问题是,即使我在调试apk中对我的用户名和密码进行了硬编码,它甚至都不会单击定义为的登录按钮:

Second problem is that even if I hard code my username and password in debug apk, it won't even click on the login button which is defined as:

<Button onClick={() => {this.handleLogin()}}>Login</Button>

我想知道这里正在发生什么.有没有人使用过React Native应用程序进行过Firebase TestLab机器人测试?

I wonder what is happening here. Did anyone ever got firebase TestLab robo test working with react native app?

推荐答案

当前,Robo仅允许您预填充可由本机Android资源ID(例如EditText小部件)唯一标识的表单字段.我对React native不太熟悉,但是看起来它将生成一个Native Android应用.这可能就是Robo完全可以导航您的应用程序的原因-它使用一些本机Android小部件来实现您的UI.但是,如果您可以让React使用本机Android资源ID(或弄清楚已经使用了哪些资源ID),并在测试中引用这些名称,那可能会起作用.

Currently, Robo only allows you to pre-fill form fields that can be identified uniquely by native Android resource IDs (like an EditText widget). I'm not too familiar with react native, but it looks like it will generate a native Android app. That's probably why Robo can navigate your app at all -- it's using some native Android widgets to implement your UI. But if you can get React to use native Android resource IDs (or figure out which resource IDs are already being used), and reference those names in your test, that might work.

这篇关于如何将Firebase TestLab与React Native一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆