184
Native End to End Testing
Brooke
Right now using detox with Expo isn't a great experience (IMHO), plus I get the feeling the detox team doesn't enjoy supporting expo. Fair enough for the wix team, it reduces their support requests but makes recommending detox unlikely.
Having experienced the dizzying joys of cypress testing with expo-web, the greatest wish at our company would be for an expo e2e testing tool that lets us test native iOS/Android using expo! We'd happily pay for features like test recording, or test runner servers etc.
Also, see React Native Radio podcast discussion from 26:30 (https://www.reactnativeradio.com/episodes/180-testing-strategies-tools-and-frameworks). I know others would love an expo blessed e2e testing solution!
Activity
Newest
Oldest
P
Pradeep Pandey
This is needed now more than ever with the ever-growing popularity and user base of expo developers. It's baffling to see there's no proper support for e2e testing and getting detox to work with expo is a nightmare.
Brooke
Thanks to those keeping the discussion open and input. The config plugin and detox examples are good. But still I think there is a big chance to improve the testing story with Expo and achieve it's rightful place as 👑of cross-platform dev
C
Conor
The lack of e2e testing for managed expo is seriously concerning. Given that it used to be a supported feature I would have thought this would be considered a regression? From what I can see the lack of documentation for this sort of functionality renders expo unusable unless you wish to release untested applications. Not sure why this has so few votes.
Kim Brandwijk
open
j
jack@questmate.com
Kim Brandwijk: Hi Kim, just checking in. What does it mean that this has changed from "Planned" to "Open"?
Jack Kinsella
The latest solution to this problem (iOS-only) is to use the exact packages in this sample repo: https://github.com/fschoenfeldt/clean-expo-detox-testing
In general, I think it would be a big boost to Expo if an
expo-detox
library was maintained. It would provide a maintained easy, way to interface between a local Expo app and detox and not worry about package versions and ENV variables etc.I would suggest that, in the meantime, we pool our efforts into keeping the example repo up to date and document the evolving process in its README.
Evan Bacon
Merged in a post:
Detox + Android + Expo (not bare)
Denys Morozov
React native community have such great library as Detox for automations e2e tests. It works perfectly on iOS simulator, but we have issues with Android :(
For example (issues):
1) DetoxRuntimeError: No instrumentation runner found on device emulator-5554 for package com.test.expoDetoxAndroid
2)'/Users/user/Development/expo-detox/androidTest/detox/expo-detox-androidTest.apk' could not be found, did you run './gradlew assembleAndroidTest'?
3) etc...
We have alternatives, like Appium and other libraries, but a lot of developers really like Detox and facing issues with Detox + Android + Expo
As for now, we can use such flows:
1) Detox for iOS and Appium for Android
2) Appium for both
3) Using Detox with ejecting (expo eject)
Evan Bacon
planned
We plan to add this as an Expo config plugin. Here is a proof of concept.
Evan Bacon
Roland Rust
I am using Appium for both iOS and Android currently. Works well so far, only issue is the speed especially on android, tests run a bit faster on iOS. I tried to get Detox to work, but no luck so far. Interested in thought exchange. :-)
Denys Morozov
Roland Rust: Hi. I've tried to 'expo eject' and then install detox - got success with fresh expo project:
1) expo init ....
2) install detox
3) expo eject
4) add configs for android
5) build and run detox
6) success
Roland Rust
Denys Morozov: Thx Denys!
Confirm that this works. But for various reasons I don't want to eject. The project I am working on is huge and complex and build around the managed workflow.
Denys Morozov
Roland Rust: We are ejecting only for tests and that's all. You can write script for that and keep project "not ejected" for development
So, we are working with managed workflow every day and ejecting expo project only at, like, CircleCI and running tests
Roland Rust
Denys Morozov: Ah! Nice approach :-) thanks a lot for the tip, gotta try that out soon...
M
Matt
Denys Morozov: Have you had continued success with the eject approach? What scares me is the detailed setup instructions for android - https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md. Would you then have to put all of that in a pipeline for every test run?
P
Pradeep Pandey
Matt: what approach did you go with? is it possible to setup a pipeline to configure all the steps involved for android?
M
Matt
Pradeep Pandey: I left my job to focus on web. Pretty much hit the nuclear button.
P
Pradeep Pandey
Matt: there seems to be a new solution to this: expo config-plugin for detox: https://www.npmjs.com/package/@config-plugins/detox
Once you install this package and use 'expo prebuild' it'll eject your app with detox configuration pre-baked. All you need to do next is "detox build" and 'detox test'.
Note: despite this solution, I still haven't been able to run a single android test yet due to a multitude of new errors related to the device.launchapp() and app staying idle. Will update in the future if I succeed to get these resolved.
Ori Harel
I believe @quinlanj had some involvement in working on this in the past. perhaps she has some insights? @brentvatne
Load More
→