@@ -3,7 +3,7 @@ version: 2.1
33# Default VM config to be used for macOS builds
44macos_config : &macos_config
55 macos :
6- xcode : 15.3 .0
6+ xcode : 16.0 .0
77 resource_class : macos.m1.large.gen1
88 shell : /bin/bash --login -eo pipefail
99
@@ -20,7 +20,8 @@ executors:
2020 working_directory : ~/project
2121
2222orbs :
23- android :
circleci/[email protected] 23+ android :
circleci/[email protected] 24+ 2425
2526# Always run job
2627run_always : &run_always
@@ -55,17 +56,13 @@ jobs:
5556 command : |
5657 corepack enable
5758 yarn install --cwd example
58- yarn install --cwd example/e2e
5959 yarn install
6060 - save_cache :
6161 key : dependencies-{{ checksum "package.json" }}
6262 paths : node_modules
6363 - save_cache :
6464 key : dependencies-example-{{ checksum "example/package.json" }}
6565 paths : example/node_modules
66- - save_cache :
67- key : dependencies-example-e2e-{{ checksum "example/package.json" }}
68- paths : example/e2e/node_modules
6966 - persist_to_workspace :
7067 root : .
7168 paths : .
@@ -115,18 +112,25 @@ jobs:
115112 JAVA_OPTS : ' -Xms512m -Xmx1024m'
116113 executor :
117114 name : android/android-machine
115+ tag : default
118116 working_directory : ~/project
119117 steps :
120118 - checkout :
121119 path : ~/project
120+ - node/install :
121+ node-version : 18.17.0
122122
123123 - attach_workspace :
124124 at : ~/project
125125
126126 - << : *setup_env_file
127127
128128 - run :
129- working_directory : example/e2e
129+ name : Install Maestro
130+ command : curl -Ls "https://get.maestro.mobile.dev" | bash
131+
132+ - run :
133+ working_directory : example/test
130134 name : Build android
131135 command : npm run build:android
132136
@@ -141,10 +145,19 @@ jobs:
141145 post-emulator-launch-assemble-command : echo Emulator Started
142146
143147 - run :
144- working_directory : example/e2e
148+ name : Install app on emulator
149+ command : |
150+ adb install -r ~/project/example/android/app/build/outputs/apk/release/app-release.apk
151+
152+ - run :
153+ working_directory : example/test
145154 name : Run UI Tests
146155 command : npm run test:android
147156
157+ - store_artifacts :
158+ path : ~/.maestro/tests
159+ destination : maestro-tests
160+
148161 # Build the Test App used for UI Testing and save is to the workspace. This allows it to be used by other jobs.
149162 ios-e2e-test :
150163 << : *macos_config
@@ -155,28 +168,49 @@ jobs:
155168
156169 - << : *setup_env_file
157170
171+ - run :
172+ working_directory : example/e2e
173+ name : Install Maestro
174+ command : curl -Ls "https://get.maestro.mobile.dev" | bash
175+
158176 - restore_cache :
159177 keys :
160178 - pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }}
161179 - run :
162180 working_directory : example/ios
163181 name : Install Pods
164182 command : pod install
183+
165184 - save_cache :
166185 key : pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }}
167186 paths :
168187 - ~/project/example/ios/Pods
169188
170189 - run :
171- working_directory : example/e2e
190+ working_directory : example/test
172191 name : Build
173192 command : npm run build:ios
174193
175194 - run :
176- working_directory : example/e2e
195+ name : Create and boot iPhone 15 simulator
196+ command : |
197+ echo "Creating iPhone 15 simulator with runtime $RUNTIME"
198+ xcrun simctl create "iPhone 15" com.apple.CoreSimulator.SimDeviceType.iPhone-15 $RUNTIME
199+ xcrun simctl boot "iPhone 15" || true
200+
201+ - run :
202+ name : Install app on simulator
203+ command : |
204+ xcrun simctl install booted ~/project/example/test/build/Build/Products/Release-iphonesimulator/IntercomReactNativeExampleUI.app
205+
206+ - run :
207+ working_directory : example/test
177208 name : Run UI Tests
178209 command : npm run test:ios
179210
211+ - store_artifacts :
212+ path : ~/.maestro/tests
213+ destination : maestro-tests
180214
181215 release-to-npm :
182216 executor : default
@@ -224,22 +258,23 @@ workflows:
224258 << : *run_always
225259 requires :
226260 - install-dependencies
227- # - android-e2e-test:
228- # <<: *run_always
229- # requires:
230- # - install-dependencies
231- # - lint
232- # - typescript
233- # - unit-tests
234- # - build-package
235- # - ios-e2e-test:
236- # <<: *run_always
237- # requires:
238- # - install-dependencies
239- # - lint
240- # - typescript
241- # - unit-tests
242- # - build-package
261+ - android-e2e-test :
262+ << : *run_always
263+ requires :
264+ - install-dependencies
265+ - lint
266+ - typescript
267+ - unit-tests
268+ - build-package
269+ - ios-e2e-test :
270+ << : *run_always
271+ requires :
272+ - install-dependencies
273+ - lint
274+ - typescript
275+ - unit-tests
276+ - build-package
277+
243278 - release-to-npm :
244279 << : *run_on_release
245280 context :
@@ -250,5 +285,5 @@ workflows:
250285 - typescript
251286 - unit-tests
252287 - build-package
253- # - ios-e2e-test
254- # - android-e2e-test
288+ - ios-e2e-test
289+ - android-e2e-test
0 commit comments