Skip to content

Commit 43b1f67

Browse files
committed
Enhance Android E2E workflow with new emulator configuration and script updates
1 parent 590568b commit 43b1f67

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

.github/workflows/e2e-android.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ jobs:
6565
sudo udevadm control --reload-rules
6666
sudo udevadm trigger --name-match=kvm
6767
68+
- name: Unregister runners
69+
run: echo "[]" > ~/.local/share/Detox/device.registry.state.lock
70+
6871
- name: Get device name
6972
id: device
7073
run: node -e "console.log('AVD_NAME=' + require('./example/.detoxrc').devices.emulator.device.avdName)" >> $GITHUB_OUTPUT
@@ -89,7 +92,7 @@ jobs:
8992
--record-videos all \
9093
--take-screenshots all \
9194
--capture-view-hierarchy enabled \
92-
--maxWorkers=2 \
95+
--maxWorkers=1 \
9396
--debug-synchronization 500 \
9497
-l trace \
9598
--cleanup

example/.detoxrc.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = {
33
logger: {
44
level: process.env.CI ? 'debug' : undefined,
55
},
6+
skipLegacyWorkersInjection: true,
67
testRunner: {
78
args: {
89
$0: 'jest',
@@ -45,7 +46,8 @@ module.exports = {
4546
'android.release': {
4647
type: 'android.apk',
4748
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
48-
build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',
49+
build:
50+
'cd android ; ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release ; cd -',
4951
},
5052
},
5153
devices: {
@@ -70,6 +72,17 @@ module.exports = {
7072
avdName: 'Pixel_3a_API_34',
7173
},
7274
},
75+
'emulator.ci': {
76+
type: 'android.emulator',
77+
device: {
78+
avdName: 'Pixel_3a_API_34',
79+
},
80+
bootArgs: '-no-boot-anim -noaudio -camera-back none',
81+
headless: true,
82+
gpuMode: 'swiftshader_indirect',
83+
readonly: true,
84+
forceAdbInstall: true,
85+
},
7386
},
7487
configurations: {
7588
'ios.sim.debug': {
@@ -105,7 +118,7 @@ module.exports = {
105118
app: 'android.debug',
106119
},
107120
'android.emu.release': {
108-
device: 'emulator',
121+
device: 'emulator.ci',
109122
app: 'android.release',
110123
},
111124
},

example/e2e/starter.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { ITBL_API_KEY, ITBL_ID } from '@env';
33

44
describe('Example', () => {
55
beforeAll(async () => {
6-
await device.terminateApp();
6+
await detox.init();
7+
// await device.terminateApp();
78
await device.launchApp({
89
/**
910
* Uncomment the following lines to enable verbose logging of

example/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"build:ios": "react-native build-ios --scheme ReactNativeSdkExample --mode Debug --extra-params \"-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO CODE_SIGNING_REQUIRED=NO\"",
1111
"detox": "detox",
1212
"detox:start": "E2E_TESTS='true' react-native start",
13+
"detox:android:debug": "detox --configuration android.emu.debug",
14+
"detox:android:debug:build": "yarn detox:android:debug build",
15+
"detox:android:release": "detox --configuration android.emu.release",
16+
"detox:android:release:build": "yarn detox:android:release build",
1317
"detox:android:build": "detox build --configuration android.emu.debug",
1418
"detox:android:build:ci": "detox build --configuration android.emu.debug",
1519
"detox:ios:build": "detox build --configuration ios.sim.debug",

0 commit comments

Comments
 (0)