Skip to content

Latest commit

 

History

History

example

Example Application

iOS local setup

  1. Install applesimutils:
brew tap wix/brew
brew install applesimutils
  1. 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.
  2. Open XCode, then go to XCode > Preferences > Locations.
  3. Under Derived Data, click Advanced….
  4. Select Custom > Relative to Workspace, then set Products as Build/Products.
  5. Click Done to save the changes.

Android local setup

  1. Install the latest Android SDK.
sdkmanager "system-images;android-30;google_apis;x86"
sdkmanager --licenses
  1. Create the emulator using npm run e2e:android-create-emulator from the /detox folder. Android testing requires an emulator named detox_pixel_4_xl_api_30 and the script helps to create it automatically.

How to install the example application

  1. Clean install node modules for the example application.
rm -rf node_modules
npm install
  1. Install the example application to simulator/emulator device.

iOS,

cd ios
pod install
cd ..
npm run ios

Android,

npm run android

How to run Detox E2E tests against the example application

  1. Run the mockserver, fast image server, file upload server, and WebSocket server. Follow instructions at

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.

  1. Clean install node modules for detox.
cd detox
rm -rf node_modules
npm install
cd ..
  1. Launch the simulator/emulator device where the example application is installed, then start the react packager/server.
npm run start
  1. Run detox tests.

iOS,

cd detox
npm run e2e:ios-test

Android,

cd detox
npm run e2e:android-build
npm run e2e:android-test
  1. 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.