https://github.com/nitaking/detox-boilerplate
wip
https://github.com/nitaking/detox-boilerplate
Last synced: 3 months ago
JSON representation
wip
- Host: GitHub
- URL: https://github.com/nitaking/detox-boilerplate
- Owner: nitaking
- License: mit
- Created: 2019-11-04T05:20:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-11T12:19:17.000Z (over 6 years ago)
- Last Synced: 2025-03-11T04:37:57.119Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 639 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# detox-boilerplate
## 依存パッケージのインストール
### Install brew packages.
Detox uses a simulator tool called applesimutils to operate the simulator.
```bash
brew tap wix/brew
brew install applesimutils
```
If you get the following error:
```
Error: You have not agreed to the Xcode license. Please resolve this by running:
sudo xcodebuild -license accept
```
After executing `sudo xcodebuild -license accept`, execute the` brew` command again.
### Detox command line tool installed globally.
## Add Detox for project
```bash
npm install -g detox-cli
```
Add Detox config to package.json
```
yarn add -D detox
```
```bash
detox init -r jest
```
Create directory: e2e
And Modify package.json
```diff
"detox": {
"test-runner": "jest"
}
}
```
### Edit package.json
```diff
"detox": {
+ "configurations": {
+ "ios.sim.debug": {
+ "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/.app",
+ "build": "xcodebuild -workspace ios/.xcworkspace -scheme -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
+ "type": "ios.simulator",
+ "device": {
+ "type": "iPhone 11 Pro"
+ }
+ },
"test-runner": "jest"
}
}
```
### Start test suits
Build test:
```bash
detox build
```
Run Test:
```bash
detox test
```
Maybe, failed test:
```
FAIL e2e/firstTest.spec.js (75.235s)
Example
✕ should have welcome screen (893ms)
✕ should show hello screen after tap (878ms)
✕ should show world screen after tap (2517ms)
```
## Write Test