Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Commit 3b9b6b3

Browse files
authored
Merge pull request #90 from synonymdev/fix-ios-tests
fix e2e ios tests
2 parents 0c4803c + f77f881 commit 3b9b6b3

5 files changed

Lines changed: 40 additions & 45 deletions

File tree

.github/scripts/test-ios.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/e2e-ios.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ on:
88
jobs:
99
e2e-test:
1010
name: E2E iOS test
11-
runs-on: macOS-latest
12-
timeout-minutes: 35
11+
runs-on: macos-12
12+
timeout-minutes: 120
1313

1414
steps:
1515
- name: Check out Git repository
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

1818
- name: Set up Node.js
19-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v3
2020
with:
21-
node-version: 14
21+
node-version: 16
2222

2323
- name: Cache lib node modules
2424
uses: actions/cache@v3
@@ -75,4 +75,4 @@ jobs:
7575

7676
- name: Test iOS app
7777
working-directory: example
78-
run: sh ../.github/scripts/test-ios.sh
78+
run: yarn e2e:ios-test

example/App.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,24 @@ const App = (): ReactElement => {
143143
<Text style={styles.text}>{message}</Text>
144144
</View>
145145
<View style={styles.container}>
146+
<Button
147+
title={'E2E test'}
148+
onPress={async (): Promise<void> => {
149+
//TODO add more functionality to test
150+
const ldkVersion = await ldk.version();
151+
if (ldkVersion.isErr()) {
152+
return setMessage(ldkVersion.error.message);
153+
}
154+
155+
const nodeIdRes = await ldk.nodeId();
156+
if (nodeIdRes.isErr()) {
157+
return setMessage(nodeIdRes.error.message);
158+
}
159+
160+
return setMessage('e2e success');
161+
}}
162+
/>
163+
146164
<Button
147165
title={'Rebroadcast Known Transactions'}
148166
onPress={async (): Promise<void> => {
@@ -505,24 +523,6 @@ const App = (): ReactElement => {
505523
}}
506524
/>
507525

508-
<Button
509-
title={'E2E test'}
510-
onPress={async (): Promise<void> => {
511-
//TODO add more functionality to test
512-
const ldkVersion = await ldk.version();
513-
if (ldkVersion.isErr()) {
514-
return setMessage(ldkVersion.error.message);
515-
}
516-
517-
const nodeIdRes = await ldk.nodeId();
518-
if (nodeIdRes.isErr()) {
519-
return setMessage(nodeIdRes.error.message);
520-
}
521-
522-
return setMessage('e2e success');
523-
}}
524-
/>
525-
526526
<Button
527527
title={'Backup Current Account'}
528528
onPress={async (): Promise<void> => {

example/e2e/detoxrc.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
"runnerConfig": "./e2e/config.json",
44
"skipLegacyWorkersInjection": true,
55
"apps": {
6-
"ios": {
6+
"ios.debug": {
77
"type": "ios.app",
8-
"build": "set -o pipefail && xcodebuild -workspace ios/example.xcworkspace -scheme example -sdk iphonesimulator -destination platform=iOS\\ Simulator,OS=15.2,name=iPhone\\ 13 -derivedDataPath ios/build | xcpretty",
8+
"build": "xcodebuild -workspace ios/example.xcworkspace -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
99
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/example.app"
1010
},
11+
"ios.release": {
12+
"type": "ios.app",
13+
"build": "xcodebuild -workspace ios/example.xcworkspace -scheme example -configuration Release -sdk iphonesimulator -derivedDataPath ios/build",
14+
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/example.app"
15+
},
1116
"android.debug": {
1217
"type": "android.apk",
1318
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
@@ -25,7 +30,7 @@
2530
"simulator": {
2631
"type": "ios.simulator",
2732
"device": {
28-
"type": "iPhone 13"
33+
"type": "iPhone 14"
2934
}
3035
},
3136
"emulator": {
@@ -36,9 +41,13 @@
3641
}
3742
},
3843
"configurations": {
39-
"ios": {
44+
"ios.sim.debug": {
45+
"device": "simulator",
46+
"app": "ios.debug"
47+
},
48+
"ios.sim.release": {
4049
"device": "simulator",
41-
"app": "ios"
50+
"app": "ios.release"
4251
},
4352
"android.debug": {
4453
"device": "emulator",

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"ios": "react-native run-ios",
88
"start": "react-native start",
99
"test": "jest",
10-
"e2e:ios-build": "detox build --configuration ios",
11-
"e2e:ios-test": "detox test --configuration ios --cleanup",
10+
"e2e:ios-build": "detox build --configuration ios.sim.release",
11+
"e2e:ios-test": "detox test --configuration ios.sim.release --cleanup",
1212
"lint:check": "eslint . --ext .js,.jsx,.ts,.tsx",
1313
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
1414
"reinstall": "cd ../lib/ && yarn install && yarn build && cd ../example/ && yarn add ../lib && yarn rn-setup",

0 commit comments

Comments
 (0)