Skip to content

Commit

Permalink
Fix Detox failure for new ignited projects
Browse files Browse the repository at this point in the history
  • Loading branch information
derekgreenberg committed Oct 14, 2021
1 parent d900ef5 commit 89fc2c7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
18 changes: 18 additions & 0 deletions boilerplate/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@ brew tap wix/brew && brew install applesimutils
yarn global add detox-cli
```

## Configuring tests

You'll need to set the Detox configuration settings in `package.json` to run Detox tests on a simulator name + OS version that is installed in your environment.

In Xcode, open `Window -> Devices and Simulators `
Tap the `Simulators` tab at the top of the modal.
On the left hand side of the modal screen, select iPhone 11 (or some other Simulator)

Note the iOS version value displayed on the left hand side below the name of the device being simulated. For example "iOS 13.2.2 (17B102)" This is the value displayed if `iPhone 11` is selected in the left hand list under `iOS`.

Set the iOS value that matches the simulator to be tested in the Detox configuration settings found in the `package.json` generated for your new project.

Example:

"device": { "name": "iPhone 11", "os": "iOS 13.2" }

NOTE: as of 10/14/2021, do not set the iOS value to `15.0` or higher, or a Detox crash may occur. This is a Detox issue that is well documented and should be fixed soon.

## Adding tests

We've gotten you started with `./e2e/firstTest.spec.js`, which tests that the two main example screens render properly.
Expand Down
10 changes: 8 additions & 2 deletions boilerplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,19 @@
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/HelloWorld.app",
"build": "xcodebuild -workspace ios/HelloWorld.xcworkspace -scheme HelloWorld -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -destination 'name=iPhone 11'",
"type": "ios.simulator",
"name": "iPhone 11"
"device": {
"name": "iPhone 11",
"os": "iOS 13.2"
}
},
"ios.sim.release": {
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/HelloWorld.app",
"build": "xcodebuild -workspace ios/HelloWorld.xcworkspace -scheme HelloWorld -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -destination 'name=iPhone 11'",
"type": "ios.simulator",
"name": "iPhone 11"
"device": {
"name": "iPhone 11",
"os": "iOS 13.2"
}
}
}
},
Expand Down

1 comment on commit 89fc2c7

@derekgreenberg
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes Detox failures as reported here: #1804

Please sign in to comment.