Detox support for multiple interacting devices?
I'm a developer for a RN video chat education app that connects pairs of users. Detox looks fantastic for testing single app instances, but I was not able to find anything about testing multiple app instances on more than one device interacting with each other. Is it possible to do this kind of testing with Detox on multiple simulators/emulators?
Not possible at the moment without some work on your part. Theoretically you could run two different tests in two different shells, with two different configurations for each test. I assume this could work.
That’s an interesting scenario. We plan to support concurrent testing on several devices, but that’s different.
what @LeoNatan said. This currently out of the scope of the projects for us.
I was able to achieve something similar for testing a chat app. Basically, it works as @LeoNatan described: two detox instances with different configurations and a simple HTTP server for syncing between two instances (one may need to wait for another instance before performing an action) and sharing the context (such as sharing username just created).

Right now I did all basic tests such as sign in, search, exchanging messages. I'll continue with this approach with adding more and more tests, and if it works well, I'm planning to write a blog post or/and add an example repository.
I must say, I love Detox :)
@ptmt This looks awesome! Please let us know when the post and/or example is live.
There you go https://github.com/ptmt/inter-device-detox
It's an experiment and I'm really bad at writing notes for it. Anyway, it's a few lines of js, so you can get inspiration and do better. I'll continue experimenting with this since I found it really handy not just for tests, but for reproducing the environment from the scratch.
Hi @LeoNatan, do you know how far is the plan you mentioned above? (running concurrent devices with the same set of tests)
I am currently scripting a rake script (or fastlane) to run multiple instances of detox on a collection of iOS simulators (and possibly a collection of android emulators as well).
Multiple instances of detox is supported on iOS from 7.4.0. this requires a t at runner with parallel execution support, like Jest.
I meant, running the test in variants of devices... iPhone 8, iPhone xs, iPhone SE, etc, at the same time. Is that documented anywhere?
I've been digging through the cli and I can see there is a way to provide the number of workers and maybe provide a device name with a given artefact so it doesn't need to recompile the code. But I've been unable to find a way to provide multiple simulators to test variations based on screen size or os variations.
Ideally, what I wanted to do is:
detox test -o e2e/someconfig.json -p ios -a ci/the.ipa -devices "iPhone 8, iPhone XS, iPhone XS Max, iPhone SE" -c 'device configuration'
No, it's not supported, but you can just run it in two different commands, either one after the other, or by sending one one process to background with shell, something like detox test -c ios.sim.iphonex& detox test -c ios.sim.iphone8
Probably a better idea to run both in background and then wait for both:
detox test -c ios.sim.iphonex&
detox test -c ios.sim.iphone8&
wait
What he said
That's basically what I am doing :)
This should be fixed by #1144
the fixed in which version is? Can we do
detox test -o e2e/someconfig.json -p ios -a ci/the.ipa -devices "iPhone 8, iPhone XS, iPhone XS Max, iPhone SE" -c 'device configuration'.
or have to specify each device separated? @manuquentin
the fixed in which version is? Can we do
detox test -o e2e/someconfig.json -p ios -a ci/the.ipa -devices "iPhone 8, iPhone XS, iPhone XS Max, iPhone SE" -c 'device configuration'.or have to specify each device separated? @manuquentin
Have you figured this out? Is this in the documentation somewhere?
+1
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this reporsitory, read this discussion.
The issue has been closed for inactivity.
Reopened because we might want to support that one day.