- Install applesimutils:
brew tap wix/brew
brew install applesimutils
- Set XCode’s build location so that the built app, especially debug, is expected at the project’s location instead of the Library’s folder which is unique/hashed.
- Open XCode, then go to XCode > Preferences > Locations.
- Under Derived Data, click Advanced….
- Select Custom > Relative to Workspace, then set Products as Build/Products.
- Click Done to save the changes.
- Install the latest Android SDK.
sdkmanager "system-images;android-30;google_apis;x86"
sdkmanager --licenses
- Create the emulator using
npm run e2e:android-create-emulator
from the/detox
folder. Android testing requires an emulator nameddetox_pixel_4_xl_api_30
and the script helps to create it automatically.
- Clean install node modules for the example application.
rm -rf node_modules
npm install
- Install the example application to simulator/emulator device.
iOS,
cd ios
pod install
cd ..
npm run ios
Android,
npm run android
- Run the mockserver, fast image server, file upload server, and WebSocket server. Follow instructions at
- How to run Mockserver
- How to run File Download Server
- How to run File Upload Server
- How to run WebSocket Server
Important: Detox tests require that the Mockserver, File Download Server, File Upload Server, and WebSocket Server are running. If they're not running, then the test will launch them.
- Clean install node modules for detox.
cd detox
rm -rf node_modules
npm install
cd ..
- Launch the simulator/emulator device where the example application is installed, then start the react packager/server.
npm run start
- Run detox tests.
iOS,
cd detox
npm run e2e:ios-test
Android,
cd detox
npm run e2e:android-build
npm run e2e:android-test
- To run a specific test file, append the path to the test file like in the example below,
npm run e2e:ios-test -- e2e/test/get/get_generic_client_request.e2e.js
For more detailed information on Detox, please visit the official Detox Documentation.
Note: Before running tests, toggle off smart punctuation to disable smart quotes on device. For iOS, go to Settings > General > Keyboard, and toggle off Smart Punctuation.