JSPM

@nrwl/detox

13.8.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26510
  • Score
    100M100P100Q150309F
  • License MIT

Detox Plugin for Nx

Package Exports

  • @nrwl/detox
  • @nrwl/detox/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nrwl/detox) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Detox Plugin for Nx

License NPM Version Join the chat at https://gitter.im/nrwl-nx/community Join us @nrwl/community on slack

Table of Contents

Setup

Install applesimutils (Mac only)

applesimutils is a collection of utils for Apple simulators.

brew tap wix/brew
brew install applesimutils

Install Jest Globally

npm install -g jest

Commands

Note: For e2e tests to work, the app must be running (nx start <app-name>). A built app must exist before run test commands.

  • nx build-ios <app-name-e2e>: build the iOS app (Mac only)
  • nx test-ios <app-name-e2e>: run e2e tests on the built iOS app (Mac only)
  • nx build-ios <app-name-e2e> --prod and nx test-ios <app-name-e2e> --prod: build and run release version of iOS app. Note: you might need open the xcode project under iOS and choose a team under "Sign & Capabilities".
  • nx build-android <app-name-e2e>: build the android app
  • nx test-android <app-name-e2d>: run e2e tests on the built android app
  • nx build-android <app-name-e2e> --prod and nx test-android <app-name-e2e> --prod: build and run release version of android app.

Manually Add E2E Folder

A <app-name-e2e> folder is automatically generated when you create a react native app. However, if you want to add e2e folder manually, you need to:

Change Testing Simulator/Emulator

For iOS, in terminal, run xcrun simctl list to view a list of simulators on your Mac. To open your active simulator, run open -a simulator. In <app-name-e2e>/.detoxrc.json, you could change the simulator under devices.simulator.device.

For Android: in terminal, run emulator -list-avds to view a list of emulators installed. To open your emulator, run emulator -avd <your emulator name>. In <app-name-e2e>/.detoxrc.json, you could change the simulator under devices.emulator.device.

To override the device name specified in a configuration, you could use --device-name option: nx test-ios <app-name-e2e> --device-name "iPhone 11".

Learn more

Visit the Nx Documentation to learn more.