Skip to content

Commit 3797cfe

Browse files
author
Krzysztof Wojnar
committed
chore(e2e): review comments applied
1 parent 681b135 commit 3797cfe

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

scripts/e2e/detox-utils.cjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ const apkBulidArchitecture = isRunningCI ? 'x86_64' : 'arm64-v8a';
1212
const testButlerApkPath = isRunningCI ? ['../Example/e2e/apps/test-butler-app-2.2.1.apk'] : undefined;
1313

1414
function detectLocalAndroidEmulator() {
15-
// "DETOX_ADB_NAME" can be set for local developement
16-
const detoxAdbName = process.env.DETOX_ADB_NAME ?? null;
17-
if (detoxAdbName !== null) {
18-
return detoxAdbName
15+
// "DETOX_AVD_NAME" can be set for local developement
16+
const detoxAvdName = process.env.DETOX_AVD_NAME ?? null;
17+
if (detoxAvdName !== null) {
18+
return detoxAvdName
1919
}
2020

2121
// Fallback: try to use Android SDK
@@ -37,14 +37,14 @@ function detectLocalAndroidEmulator() {
3737
// TODO: consider giving user a choice here.
3838
return avdList[0];
3939
} catch (error) {
40-
const errorMessage = `Failed to find Android emulator. Set "DETOX_ADB_NAME" env variable pointing to one. Cause: ${error}`
40+
const errorMessage = `Failed to find Android emulator. Set "DETOX_AVD_NAME" env variable pointing to one. Cause: ${error}`
4141
console.error(errorMessage);
4242
throw new Error(errorMessage);
4343
}
4444
}
4545

4646
function detectAndroidEmulatorName() {
47-
return isRunningCI ? CI_ADB_NAME : detectLocalAndroidEmulator();
47+
return isRunningCI ? CI_ADB_NAME : detectLocalAndroidEmulator(); // ??
4848
}
4949

5050
/**

scripts/e2e/ios-devices.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
const DEFAULT_APPLE_MODEL = 'iPhone 17';
2-
const DEVICE_MODEL = process.env.E2E_APPLE_DEVICE || DEFEAULT_APPLE_MODEL
1+
const DEFAULT_APPLE_DEVICE = 'iPhone 17';
32
const DEFEAULT_IOS_VERSION = 'iOS 26.2';
43

4+
/**
5+
* @return {string}
6+
*/
7+
function getAppleDevice () { return process.env.E2E_APPLE_DEVICE || DEFAULT_APPLE_DEVICE;}
58
/**
69
* @return {`iOS ${string}`} requested version of ios, or default if not specified
710
*/
@@ -27,11 +30,10 @@ function getIOSVersion() {
2730
* @readonly
2831
* */
2932
const iosDevice = {
30-
type: DEVICE_MODEL,
31-
os: getiosVersion(),
33+
type: getAppleDevice(),
34+
os: getIOSVersion(),
3235
};
3336

3437
module.exports = {
3538
iosDevice,
36-
getiosVersion,
3739
};

0 commit comments

Comments
 (0)