Test React Native App using Firebase TestLab
Asked Answered
H

2

6

Is it possible to test a React Native (Expo Managed) app using Firebase TestLab?

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? Currently, the default Robo Test runs only very briefly (<~1min) then terminates 'successfully'. 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.

2) Is it possible to create a Robo Script that selects UI elements by testID? In React Native the control over the native rendered elements is minimal. It is, however, possible to specify testID on elements.

3) Is it possible to use Android Studio to generate a Robo Script on a React Native (Expo) app? 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).

Thank you

Hemorrhage answered 13/8, 2019 at 18:44 Comment(0)
M
2

1) Yes. From Web UI, this option is in Advanced options. Locally, you can pass the time in seconds using '--timeout-sec' parameter.

2) No, as of now, testID attribute is not supported by Roboscript (and by Robo).

3) No (as you've noticed from your experience). Roboscript recorder did not capture any of your actions, because it only works for regular Android widgets.

Massorete answered 13/8, 2019 at 20:8 Comment(2)
Thank you, very helpful. I was able to get a test running using a roboscript that just keeps the app running for a specified period of time.Hemorrhage
How to make it work with React Native?Lusatia
C
1

To answer #1 I think the test is terminating because it doesn't see any buttons to press.

For Android: I was able to get my app to test with Robo test. It would click around and is pretty useful.

For IOS: I made a big breakthrough this week. The app would launch on test lab but the robo tester wouldn't click around. I managed to make it click around when I added accessibilityRole="button" to my buttons. After that the robo tested was able to click around.

Once it starts to click around, it will not terminate the test

Caernarvonshire answered 7/3 at 14:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.