Skip to content

Commit 36b0685

Browse files
feat: running tests as part of the pipeline
1 parent 743b158 commit 36b0685

File tree

2 files changed

+41
-21
lines changed

2 files changed

+41
-21
lines changed

.circleci/config.yml

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ jobs:
125125

126126
- <<: *setup_env_file
127127

128+
- run:
129+
working_directory: example/e2e
130+
name: Install Maestro
131+
command: npm run maestro:install
132+
128133
- run:
129134
working_directory: example/e2e
130135
name: Build android
@@ -145,6 +150,10 @@ jobs:
145150
name: Run UI Tests
146151
command: npm run test:android
147152

153+
- store_artifacts:
154+
path: ~/.maestro/tests
155+
destination: maestro-tests
156+
148157
# Build the Test App used for UI Testing and save is to the workspace. This allows it to be used by other jobs.
149158
ios-e2e-test:
150159
<<: *macos_config
@@ -155,6 +164,11 @@ jobs:
155164

156165
- <<: *setup_env_file
157166

167+
- run:
168+
working_directory: example/e2e
169+
name: Install Maestro
170+
command: npm run maestro:install
171+
158172
- restore_cache:
159173
keys:
160174
- pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }}
@@ -177,6 +191,9 @@ jobs:
177191
name: Run UI Tests
178192
command: npm run test:ios
179193

194+
- store_artifacts:
195+
path: ~/.maestro/tests
196+
destination: maestro-tests
180197

181198
release-to-npm:
182199
executor: default
@@ -224,22 +241,23 @@ workflows:
224241
<<: *run_always
225242
requires:
226243
- 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
244+
- android-e2e-test:
245+
<<: *run_always
246+
requires:
247+
- install-dependencies
248+
- lint
249+
- typescript
250+
- unit-tests
251+
- build-package
252+
- ios-e2e-te st:
253+
<<: *run_always
254+
requires:
255+
- install-dependencies
256+
- lint
257+
- typescript
258+
- unit-tests
259+
- build-package
260+
243261
- release-to-npm:
244262
<<: *run_on_release
245263
context:
@@ -250,5 +268,5 @@ workflows:
250268
- typescript
251269
- unit-tests
252270
- build-package
253-
# - ios-e2e-test
254-
# - android-e2e-test
271+
- ios-e2e-test
272+
- android-e2e-test

example/e2e/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"build:android": "../android/gradlew assembleFossRelease -p ../android",
7+
"build:android": "../android/gradlew assembleRelease -p ../android",
88
"build:ios": "xcodebuild build -workspace ../ios/IntercomReactNativeExample.xcworkspace -scheme IntercomReactNativeExampleUI -configuration Release -sdk iphonesimulator -derivedDataPath ./build",
9-
"test:android": "npx wdio ./wdio.android.conf.ts",
10-
"test:ios": "npx wdio ./wdio.ios.conf.ts"
9+
"test:android": "maestro test ./maestro/android/*.yaml",
10+
"test:ios": "maestro test ./maestro/ios/*.yaml",
11+
"maestro:install": "curl -Ls \"https://get.maestro.mobile.dev\" | bash"
1112
},
1213
"keywords": [],
1314
"author": "",
@@ -25,6 +26,7 @@
2526
"@wdio/mocha-framework": "^7.7.3",
2627
"@wdio/spec-reporter": "^9.5.0",
2728
"chromedriver": "^131.0.4",
29+
"maestro-cli": "^1.0.6",
2830
"ts-node": "^10.0.0",
2931
"typescript": "^4.3.2",
3032
"wdio-chromedriver-service": "^8.1.1"

0 commit comments

Comments
 (0)