1
1
[ ![ 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 )
2
+
2
3
# [ Detox] ( https://github.com/wix/Detox ) Helper for [ CodeceptJS] ( https://codecept.io )
3
4
4
5
Testing Mobile Apps on iOS and Android can look like this:
@@ -23,7 +24,7 @@ I.runOnIOS(() => {
23
24
24
25
Example output:
25
26
26
- ```
27
+ ``` bash
27
28
creating output directory: /Users/runner/work/detox-helper/detox-helper/test/output
28
29
***************************************
29
30
nodeInfo: 20.14.0
@@ -40,63 +41,63 @@ Using test root "/Users/runner/work/detox-helper/detox-helper/test"
40
41
Helpers: Detox, ExpectHelper
41
42
Plugins: screenshotOnFail
42
43
43
- Acceptance Tests --
44
- [1] Starting recording promises
45
- Timeouts:
46
- 11:44:06.770 detox[8813] i App started
47
- 11:44:28.445 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
48
- /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
49
- 11:44:28.557 detox[8813] i --- STARTED "before each" hook: Before for "App started" ---
50
- 11:44:28.583 detox[8813] i I launch app
51
- 11:44:30.037 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
52
- /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
53
- 11:44:30.043 detox[8813] i I wait for element visible "#hello_button", 15
54
- 11:44:31.253 detox[8813] i --- ENDED "before each" hook: Before for "App started" ---
55
- 11:44:31.273 detox[8813] i I see "Welcome"
56
- 11:44:31.289 detox[8813] i ✔ OK in 25ms
57
- 11:44:31.289 detox[8813] i
58
- 11:44:31.301 detox[8813] i Get platform
59
- 11:44:34.736 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
60
- /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
61
- 11:44:40.582 detox[8813] i --- STARTED "before each" hook: Before for "Get platform" ---
62
- 11:44:40.588 detox[8813] i I launch app
63
- 11:44:42.271 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
64
- /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
65
- 11:44:42.274 detox[8813] i I wait for element visible "#hello_button", 15
66
- 11:44:43.126 detox[8813] i --- ENDED "before each" hook: Before for "Get platform" ---
67
- 11:44:43.150 detox[8813] i I grab platform
68
- 11:44:43.152 detox[8813] i I expect ""ios"" to equal ""ios""
69
- 11:44:43.158 detox[8813] i ✔ OK in 31ms
70
- 11:44:43.158 detox[8813] i
71
- 11:44:43.166 detox[8813] i Show hello screen after tap
72
- 11:44:46.251 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
73
- /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
74
- 11:44:52.308 detox[8813] i --- STARTED "before each" hook: Before for "Show hello screen after tap" ---
75
- 11:44:52.321 detox[8813] i I launch app
76
- 11:47:22.243 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
77
- /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
78
- 11:47:22.319 detox[8813] i I wait for element visible "#hello_button", 15
79
- 11:47:23.637 detox[8813] i --- ENDED "before each" hook: Before for "Show hello screen after tap" ---
80
- 11:47:23.668 detox[8813] i I dont see "Hello!!!"
81
- 11:47:23.699 detox[8813] i I click "#hello_button"
82
- 11:47:24.308 detox[8813] i I see "Hello!!!"
83
- 11:47:24.323 detox[8813] i ✔ OK in 684ms
84
- 11:47:24.323 detox[8813] i
85
- 11:47:24.334 detox[8813] i Show world screen after tap
86
- 11:47:27.298 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
87
- /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
88
- 11:47:33.604 detox[8813] i --- STARTED "before each" hook: Before for "Show world screen after tap" ---
89
- 11:47:33.608 detox[8813] i I launch app
90
- 11:47:36.074 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
91
- /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate 'process == "example"'
92
- 11:47:36.110 detox[8813] i I wait for element visible "#hello_button", 15
93
- 11:47:36.450 detox[8813] i --- ENDED "before each" hook: Before for "Show world screen after tap" ---
94
- 11:47:36.452 detox[8813] i I click "#world_button"
95
- 11:47:37.314 detox[8813] i I see "World!!!"
96
- 11:47:37.408 detox[8813] i ✔ OK in 935ms
97
- 11:47:37.409 detox[8813] i
98
- 11:47:37.468 detox[8813] i
99
- 11:47:37.470 detox[8813] i OK | 4 passed // 7m
44
+ Acceptance Tests --
45
+ [1] Starting recording promises
46
+ Timeouts:
47
+ 11:44:06.770 detox[8813] i App started
48
+ 11:44:28.445 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
49
+ /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate ' process == "example"'
50
+ 11:44:28.557 detox[8813] i --- STARTED " before each" hook: Before for " App started" ---
51
+ 11:44:28.583 detox[8813] i I launch app
52
+ 11:44:30.037 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
53
+ /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate ' process == "example"'
54
+ 11:44:30.043 detox[8813] i I wait for element visible " #hello_button" , 15
55
+ 11:44:31.253 detox[8813] i --- ENDED " before each" hook: Before for " App started" ---
56
+ 11:44:31.273 detox[8813] i I see " Welcome"
57
+ 11:44:31.289 detox[8813] i ✔ OK in 25ms
58
+ 11:44:31.289 detox[8813] i
59
+ 11:44:31.301 detox[8813] i Get platform
60
+ 11:44:34.736 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
61
+ /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate ' process == "example"'
62
+ 11:44:40.582 detox[8813] i --- STARTED " before each" hook: Before for " Get platform" ---
63
+ 11:44:40.588 detox[8813] i I launch app
64
+ 11:44:42.271 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
65
+ /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate ' process == "example"'
66
+ 11:44:42.274 detox[8813] i I wait for element visible " #hello_button" , 15
67
+ 11:44:43.126 detox[8813] i --- ENDED " before each" hook: Before for " Get platform" ---
68
+ 11:44:43.150 detox[8813] i I grab platform
69
+ 11:44:43.152 detox[8813] i I expect " " ios" " to equal " " ios" "
70
+ 11:44:43.158 detox[8813] i ✔ OK in 31ms
71
+ 11:44:43.158 detox[8813] i
72
+ 11:44:43.166 detox[8813] i Show hello screen after tap
73
+ 11:44:46.251 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
74
+ /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate ' process == "example"'
75
+ 11:44:52.308 detox[8813] i --- STARTED " before each" hook: Before for " Show hello screen after tap" ---
76
+ 11:44:52.321 detox[8813] i I launch app
77
+ 11:47:22.243 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
78
+ /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate ' process == "example"'
79
+ 11:47:22.319 detox[8813] i I wait for element visible " #hello_button" , 15
80
+ 11:47:23.637 detox[8813] i --- ENDED " before each" hook: Before for " Show hello screen after tap" ---
81
+ 11:47:23.668 detox[8813] i I dont see " Hello!!!"
82
+ 11:47:23.699 detox[8813] i I click " #hello_button"
83
+ 11:47:24.308 detox[8813] i I see " Hello!!!"
84
+ 11:47:24.323 detox[8813] i ✔ OK in 684ms
85
+ 11:47:24.323 detox[8813] i
86
+ 11:47:24.334 detox[8813] i Show world screen after tap
87
+ 11:47:27.298 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
88
+ /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate ' process == "example"'
89
+ 11:47:33.604 detox[8813] i --- STARTED " before each" hook: Before for " Show world screen after tap" ---
90
+ 11:47:33.608 detox[8813] i I launch app
91
+ 11:47:36.074 detox[8813] i com.wix.demo.react.native launched. To watch simulator logs, run:
92
+ /usr/bin/xcrun simctl spawn F44382C2-F0BE-466A-9683-AA6B37591FBA log stream --level debug --style compact --predicate ' process == "example"'
93
+ 11:47:36.110 detox[8813] i I wait for element visible " #hello_button" , 15
94
+ 11:47:36.450 detox[8813] i --- ENDED " before each" hook: Before for " Show world screen after tap" ---
95
+ 11:47:36.452 detox[8813] i I click " #world_button"
96
+ 11:47:37.314 detox[8813] i I see " World!!!"
97
+ 11:47:37.408 detox[8813] i ✔ OK in 935ms
98
+ 11:47:37.409 detox[8813] i
99
+ 11:47:37.468 detox[8813] i
100
+ 11:47:37.470 detox[8813] i OK | 4 passed // 7m
100
101
```
101
102
102
103
CodeceptJS provides next features over standard Detox:
@@ -265,6 +266,7 @@ Options:
265
266
- ` reloadReactNative ` - should be enabled for React Native applications.
266
267
- ` reuse ` - reuse application for tests. By default, Detox reinstalls and relaunches app.
267
268
- ` registerGlobals ` - (default: true) Register Detox helper functions ` by ` , ` element ` , ` expect ` , ` waitFor ` globally.
269
+ - ` 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.
268
270
269
271
#### Parameters
270
272
0 commit comments