Skip to content

Commit 2d4e016

Browse files
Merge 46782a8 into 3aae5bf
2 parents 3aae5bf + 46782a8 commit 2d4e016

File tree

5 files changed

+43
-15
lines changed

5 files changed

+43
-15
lines changed

.github/workflows/sample-application.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,20 @@ jobs:
200200
rn-architecture: 'new'
201201
ios-use-frameworks: 'no-frameworks'
202202
build-type: 'production'
203+
test-command: 'yarn test-ios-auto' # tests native auto init from JS
204+
205+
- platform: ios
206+
runs-on: macos-15
207+
rn-architecture: 'new'
208+
ios-use-frameworks: 'no-frameworks'
209+
build-type: 'production'
210+
test-command: 'yarn test-ios'
203211

204212
- platform: android
205213
runs-on: ubuntu-latest
206214
rn-architecture: 'new'
207215
build-type: 'production'
216+
test-command: 'yarn test-android'
208217

209218
steps:
210219
- uses: actions/checkout@v4
@@ -277,7 +286,7 @@ jobs:
277286
- name: Run Detox iOS Tests
278287
if: ${{ matrix.platform == 'ios' }}
279288
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
280-
run: yarn test-ios
289+
run: ${{ matrix.test-command }}
281290

282291
- name: Run tests on Android
283292
if: ${{ matrix.platform == 'android' }}
@@ -303,4 +312,4 @@ jobs:
303312
-camera-front none
304313
-timezone US/Pacific
305314
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
306-
script: yarn test-android
315+
script: ${{ matrix.test-command }}

samples/react-native/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"set-test-dsn-ios": "scripts/set-dsn-ios.mjs",
1717
"test-android": "scripts/test-android.sh",
1818
"test-ios": "scripts/test-ios.sh",
19+
"test-ios-auto": "scripts/test-ios-auto.sh",
1920
"lint": "npx eslint . --ext .js,.jsx,.ts,.tsx",
2021
"fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
2122
"pod-install-debug-static": "scripts/pod-install-debug-static.sh",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Exit on error and print commands
4+
set -xe
5+
6+
if [ -z "$IOS_DEVICE" ]; then
7+
# Get the first booted simulator device type and version
8+
BOOTED_DEVICE=$(xcrun simctl list devices | grep "Booted" | head -n 1)
9+
10+
if [ -z "$BOOTED_DEVICE" ]; then
11+
echo "No booted iOS simulator found"
12+
exit 1
13+
fi
14+
15+
# Extract device type from booted device
16+
export IOS_DEVICE=$(echo "$BOOTED_DEVICE" | cut -d "(" -f1 | xargs)
17+
echo "Using booted iOS simulator: $IOS_DEVICE"
18+
fi
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
# Exit on error and print commands
4+
set -xe
5+
6+
thisFilePath=$(dirname "$0")
7+
8+
cd "${thisFilePath}/.."
9+
10+
"${thisFilePath}/detect-ios-sim.sh"
11+
12+
detox test --configuration ci.sim --app-launch-args="--sentry-disable-native-start"

samples/react-native/scripts/test-ios.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@ thisFilePath=$(dirname "$0")
77

88
cd "${thisFilePath}/.."
99

10-
if [ -z "$IOS_DEVICE" ]; then
11-
# Get the first booted simulator device type and version
12-
BOOTED_DEVICE=$(xcrun simctl list devices | grep "Booted" | head -n 1)
13-
14-
if [ -z "$BOOTED_DEVICE" ]; then
15-
echo "No booted iOS simulator found"
16-
exit 1
17-
fi
18-
19-
# Extract device type from booted device
20-
export IOS_DEVICE=$(echo "$BOOTED_DEVICE" | cut -d "(" -f1 | xargs)
21-
echo "Using booted iOS simulator: $IOS_DEVICE"
22-
fi
10+
"${thisFilePath}/detect-ios-sim.sh"
2311

2412
detox test --configuration ci.sim

0 commit comments

Comments
 (0)