173
Native End to End Testing
planned
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
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?
Ori Harel
I believe @quinlanj had some involvement in working on this in the past. perhaps she has some insights? @brentvatne
Denys Morozov
Brent Vatne
We definitely would like to have a seamless and high quality e2e testing tool and a service that users can depend on to run their tests. It's not our top priority right now but it's something we're conscious of. In the meantime, if there are some changes that you know we can make to better integrate with tools that you would like to use or you would like to open PRs to support them better, that'd be great.
Brooke
Brent Vatne: Thanks Brent, I'll take a look at how well detox runs with Expo over the next couple months, (and play with appium).
Detox used to be our primary iOS e2e testing tool, but keeping detox and expo working well together required an internal detox fork and the changes that broke expo tended to suck up a lot of time, so we're back to relying on web cypress tests for now and will add in an appium smoke test.
I think a expo-detox fork could be a worthwhile solution, but long term feel like 'there's gotta be a better way' for testing that the community is hungry for. Our company would happily spend double what we do on cypress runners and recordings, one can dream....
Anyway keep up the good work!
Scott Pritchard
This probably belongs in the forum (and it's worth creating a thread there to discuss further) since Canny is for suggestions, but I figure I'll share some insight.
The best solution I've come across is Appium using the WD driver. You have to add some accessibility props, and you have to build the app to run the tests, but you can automate things like screenshots, taps, entering text, etc. Bonus points are that it works on Mac, and Windows (and Linux as far as I know, but I haven't personally tried). It doesn't rely on hacky workarounds like running in the browser - it runs the tests on an actual device or simulator/emulator so you can be sure that it works in the way you've built it.
One caveat: iOS testing won't work properly on AWS Device Farm with Expo apps - I've spent a good chunk of time trying to make it work, but there's some sort of issues that I couldn't figure out. Android works fine though. You can test both of them locally without any issue in any case.
Brooke
Scott Pritchard: Thanks I will pursue this. Appium sounds like makes a lot of sense when it's time to prepare videos/screenshots and run a final 'smoke' test on our app.
Something I feel we are missing that works really well with cypress is a bit more integration level (but with real interaction) testing. We have cypress tests we run on every pull request with mocked network responses and real interactions, what's handy is we only need run an expo server on the test machine, and don't need to wait for a build.
Roland Rust
Brooke: using Appium as well. IMHO the tests run incredibly slow due to WD compared to cypress which we use for web.
Tanas Gjorgoski
Official support would be great!
Load More
→