Skip to content

Commit

Permalink
fix(docs): update docs (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent authored Aug 14, 2024
1 parent b342a5f commit 7cf9c28
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 58 deletions.
118 changes: 60 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Publish npm Package](https://github.com/codeceptjs/detox-helper/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/codeceptjs/detox-helper/actions/workflows/npm-publish.yml) [![e2e-android](https://github.com/codeceptjs/detox-helper/actions/workflows/e2e-android.yml/badge.svg)](https://github.com/codeceptjs/detox-helper/actions/workflows/e2e-android.yml) [![e2e-ios](https://github.com/codeceptjs/detox-helper/actions/workflows/e2e-ios.yml/badge.svg)](https://github.com/codeceptjs/detox-helper/actions/workflows/e2e-ios.yml)

# [Detox](https://github.com/wix/Detox) Helper for [CodeceptJS](https://codecept.io)

Testing Mobile Apps on iOS and Android can look like this:
Expand All @@ -23,7 +24,7 @@ I.runOnIOS(() => {

Example output:

```
```bash
creating output directory: /Users/runner/work/detox-helper/detox-helper/test/output
***************************************
nodeInfo: 20.14.0
Expand All @@ -40,63 +41,63 @@ Using test root "/Users/runner/work/detox-helper/detox-helper/test"
Helpers: Detox, ExpectHelper
Plugins: screenshotOnFail

Acceptance Tests --
[1] Starting recording promises
Timeouts:
11:44:06.770 detox[8813] i App started
11:44:28.445 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:44:28.557 detox[8813] i --- STARTED "before each" hook: Before for "App started" ---
11:44:28.583 detox[8813] i I launch app
11:44:30.037 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:44:30.043 detox[8813] i I wait for element visible "#hello_button", 15
11:44:31.253 detox[8813] i --- ENDED "before each" hook: Before for "App started" ---
11:44:31.273 detox[8813] i I see "Welcome"
11:44:31.289 detox[8813] i ✔ OK in 25ms
11:44:31.289 detox[8813] i
11:44:31.301 detox[8813] i Get platform
11:44:34.736 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:44:40.582 detox[8813] i --- STARTED "before each" hook: Before for "Get platform" ---
11:44:40.588 detox[8813] i I launch app
11:44:42.271 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:44:42.274 detox[8813] i I wait for element visible "#hello_button", 15
11:44:43.126 detox[8813] i --- ENDED "before each" hook: Before for "Get platform" ---
11:44:43.150 detox[8813] i I grab platform
11:44:43.152 detox[8813] i I expect ""ios"" to equal ""ios""
11:44:43.158 detox[8813] i ✔ OK in 31ms
11:44:43.158 detox[8813] i
11:44:43.166 detox[8813] i Show hello screen after tap
11:44:46.251 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:44:52.308 detox[8813] i --- STARTED "before each" hook: Before for "Show hello screen after tap" ---
11:44:52.321 detox[8813] i I launch app
11:47:22.243 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:47:22.319 detox[8813] i I wait for element visible "#hello_button", 15
11:47:23.637 detox[8813] i --- ENDED "before each" hook: Before for "Show hello screen after tap" ---
11:47:23.668 detox[8813] i I dont see "Hello!!!"
11:47:23.699 detox[8813] i I click "#hello_button"
11:47:24.308 detox[8813] i I see "Hello!!!"
11:47:24.323 detox[8813] i ✔ OK in 684ms
11:47:24.323 detox[8813] i
11:47:24.334 detox[8813] i Show world screen after tap
11:47:27.298 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:47:33.604 detox[8813] i --- STARTED "before each" hook: Before for "Show world screen after tap" ---
11:47:33.608 detox[8813] i I launch app
11:47:36.074 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:47:36.110 detox[8813] i I wait for element visible "#hello_button", 15
11:47:36.450 detox[8813] i --- ENDED "before each" hook: Before for "Show world screen after tap" ---
11:47:36.452 detox[8813] i I click "#world_button"
11:47:37.314 detox[8813] i I see "World!!!"
11:47:37.408 detox[8813] i ✔ OK in 935ms
11:47:37.409 detox[8813] i
11:47:37.468 detox[8813] i
11:47:37.470 detox[8813] i OK | 4 passed // 7m
Acceptance Tests --
[1] Starting recording promises
Timeouts:
11:44:06.770 detox[8813] i App started
11:44:28.445 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:44:28.557 detox[8813] i --- STARTED "before each" hook: Before for "App started" ---
11:44:28.583 detox[8813] i I launch app
11:44:30.037 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:44:30.043 detox[8813] i I wait for element visible "#hello_button", 15
11:44:31.253 detox[8813] i --- ENDED "before each" hook: Before for "App started" ---
11:44:31.273 detox[8813] i I see "Welcome"
11:44:31.289 detox[8813] i ✔ OK in 25ms
11:44:31.289 detox[8813] i
11:44:31.301 detox[8813] i Get platform
11:44:34.736 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:44:40.582 detox[8813] i --- STARTED "before each" hook: Before for "Get platform" ---
11:44:40.588 detox[8813] i I launch app
11:44:42.271 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:44:42.274 detox[8813] i I wait for element visible "#hello_button", 15
11:44:43.126 detox[8813] i --- ENDED "before each" hook: Before for "Get platform" ---
11:44:43.150 detox[8813] i I grab platform
11:44:43.152 detox[8813] i I expect ""ios"" to equal ""ios""
11:44:43.158 detox[8813] i ✔ OK in 31ms
11:44:43.158 detox[8813] i
11:44:43.166 detox[8813] i Show hello screen after tap
11:44:46.251 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:44:52.308 detox[8813] i --- STARTED "before each" hook: Before for "Show hello screen after tap" ---
11:44:52.321 detox[8813] i I launch app
11:47:22.243 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:47:22.319 detox[8813] i I wait for element visible "#hello_button", 15
11:47:23.637 detox[8813] i --- ENDED "before each" hook: Before for "Show hello screen after tap" ---
11:47:23.668 detox[8813] i I dont see "Hello!!!"
11:47:23.699 detox[8813] i I click "#hello_button"
11:47:24.308 detox[8813] i I see "Hello!!!"
11:47:24.323 detox[8813] i ✔ OK in 684ms
11:47:24.323 detox[8813] i
11:47:24.334 detox[8813] i Show world screen after tap
11:47:27.298 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:47:33.604 detox[8813] i --- STARTED "before each" hook: Before for "Show world screen after tap" ---
11:47:33.608 detox[8813] i I launch app
11:47:36.074 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
11:47:36.110 detox[8813] i I wait for element visible "#hello_button", 15
11:47:36.450 detox[8813] i --- ENDED "before each" hook: Before for "Show world screen after tap" ---
11:47:36.452 detox[8813] i I click "#world_button"
11:47:37.314 detox[8813] i I see "World!!!"
11:47:37.408 detox[8813] i ✔ OK in 935ms
11:47:37.409 detox[8813] i
11:47:37.468 detox[8813] i
11:47:37.470 detox[8813] i OK | 4 passed // 7m
```

CodeceptJS provides next features over standard Detox:
Expand Down Expand Up @@ -265,6 +266,7 @@ Options:
- `reloadReactNative` - should be enabled for React Native applications.
- `reuse` - reuse application for tests. By default, Detox reinstalls and relaunches app.
- `registerGlobals` - (default: true) Register Detox helper functions `by`, `element`, `expect`, `waitFor` globally.
- `url` - URL to open via deep-link each time the app is launched (android) or immediately afterwards (iOS). Useful for opening a bundle URL at the beginning of tests when working with Expo.

#### Parameters

Expand Down
Binary file modified test/android/.DS_Store
Binary file not shown.

0 comments on commit 7cf9c28

Please sign in to comment.