End to End testing using detox

Hi,

I’d like to end to end test my app, and for React Native app testing in general, detox (in combination with jest) seems to be the best solution out there. It looks like there was some work to support expo + detox, but that was done 2 years ago: https://github.com/expo/detox-tools#readme

I’ve tried following the guidelines, but the tests timeout and I get the following warning

The warning is:
detox[5697] WARN: [Client.js/PENDING_REQUESTS] App has not responded to the network requests below: (id = -1000) isReady: {}

There is a closed issue on the detox repo, but no solution - the issue was closed as the detox folks don’t intend to support expo themselves https://github.com/wix/Detox/issues/1422

Has anyone got expo + detox working, or an alternative solution to end to end testing of expo apps?

Many thanks,

Platform: iOS
SDK version: 39

1 Like

I’m interested in this as well. It seems like there’s a manual patch tho, but I haven’t tried it yet.

Hey,

Forking expo-detox-typescript-example and making the amends mentioned in this StackOverflow post I was able to get it to work with Expo SDK v40 and Detox v17.

Repo: GitHub - ourmaninamsterdam/expo-detox-e2e at dynamic-config .

I’ll try and get the patch made into a PR for detox-expo-helpers at some point.

I’ve been unable to to get tests running on an Expo app which uses a dynamic config (via app.config.js), as we get this error:

    TypeError: Cannot read property 'detach' of null

      at ../../../../../../xdl@51.6.4/src/UrlUtils.js:208:13
      at step (../node_modules/xdl/build/UrlUtils.js:386:191)
      at ../node_modules/xdl/build/UrlUtils.js:386:361

It seems @expo-cli/xdl only reads static configs (app.json) and not dynamic configs. Perhaps there’s a step missing on my side. expo-detox-helpers is using quite an old version (51.6.4) of xdl. Maybe Expo Team can shed some light on this.

I was able to fix the dynamic config issues by forking detox-expo-helpers and bumping xdl to v59. The other patches by lookitsatravis (Travis Vignon) · GitHub have also been applied to that branch, removing the need to use patch-package.