Skip to content

Commit 7c891aa

Browse files
committed
Merged new emulator configurations
2 parents 46ce4a9 + 476243b commit 7c891aa

8 files changed

Lines changed: 270 additions & 129 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
}
7676
},
7777
"dependencies": {
78+
"hoist-non-react-statics": "3.x.x",
7879
"lodash": "4.17.x",
7980
"prop-types": "15.x.x",
8081
"react-lifecycles-compat": "^3.0.4",
81-
"hoist-non-react-statics": "3.x.x",
8282
"tslib": "1.9.3"
8383
},
8484
"devDependencies": {
@@ -108,7 +108,7 @@
108108
"@typescript-eslint/eslint-plugin": "8.21.0",
109109
"@typescript-eslint/parser": "8.21.0",
110110
"clang-format": "^1.4.0",
111-
"detox": "20.34.4",
111+
"detox": "20.46.0",
112112
"detox-testing-library-rnn-adapter": "^2.0.3",
113113
"eslint": "^8.19.0",
114114
"eslint-config-prettier": "6.11.0",

playground/android/app/src/main/res/values/styles.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
<resources>
33
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
44
<item name="android:windowBackground">@color/backgroundColor</item>
5+
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
56
</style>
67
</resources>

playground/e2e/AndroidUtils.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,6 @@ const utils = {
1616
// TODO Change to use Detox's ADB (see keyboard driver)
1717
exec.execSync(`adb -s ${device.id} shell ${command}`);
1818
},
19-
setDemoMode: () => {
20-
// enter demo mode
21-
utils.executeShellCommand('settings put global sysui_demo_allowed 1');
22-
// display time 12:00
23-
utils.executeShellCommand(
24-
'am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200'
25-
);
26-
// Display full mobile data with 4g type and no wifi
27-
utils.executeShellCommand(
28-
'am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype 4g -e wifi false'
29-
);
30-
// Hide notifications
31-
utils.executeShellCommand(
32-
'am broadcast -a com.android.systemui.demo -e command notifications -e visible false'
33-
);
34-
// Disable pointer location
35-
utils.executeShellCommand('settings put system pointer_location 0');
36-
// Show full battery but not in charging state
37-
utils.executeShellCommand(
38-
'am broadcast -a com.android.systemui.demo -e command battery -e plugged false -e level 100'
39-
);
40-
},
4119
};
4220

4321
export default utils;

playground/e2e/Overlay.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ describe('Overlay', () => {
5858

5959
it.e2e(':android: should show banner overlay and not block the screen', async () => {
6060
const snapshottedImagePath = './e2e/assets/overlay_banner_padding.png';
61-
Android.setDemoMode();
61+
6262
let expected = await device.takeScreenshot('without_banner');
6363
await elementById(TestIDs.SHOW_BANNER_OVERLAY).tap();
6464
await expect(elementById(TestIDs.BANNER_OVERLAY)).toBeVisible();
6565
const actual = await device.takeScreenshot('with_banner');
6666
expectImagesToBeNotEqual(expected, actual)
67+
6768
await elementById(TestIDs.SET_LAYOUT_BOTTOM_INSETS).tap();
6869
expected = await device.takeScreenshot('with_banner');
6970
expectImagesToBeEqual(expected, snapshottedImagePath)
783 Bytes
Loading

playground/e2e/detox.config.js

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,54 +25,56 @@ const config = {
2525
os: '15.5',
2626
},
2727
},
28-
'genymotion.emulator.name': {
29-
type: 'android.genycloud',
30-
device: {
31-
recipeUUID: '9baf12f9-a645-4ffa-a688-0e92584d6194',
32-
},
33-
},
3428
emulator: {
3529
type: 'android.emulator',
3630
device: {
3731
avdName: 'Pixel_3a_API_35',
3832
},
33+
systemUI: {
34+
pointerLocationBar: 'hide',
35+
touches: 'show',
36+
navigationMode: '3-button',
37+
statusBar: {
38+
notifications: 'hide',
39+
clock: '1200',
40+
wifiSignal: 'none',
41+
mobileSignal: 'none',
42+
battery: 'full',
43+
charging: false,
44+
},
45+
},
3946
},
4047
},
4148
apps: {
4249
'ios.debug': {
4350
type: 'ios.app',
44-
binaryPath:
45-
'ios/DerivedData/playground/Build/Products/Debug-iphonesimulator/playground.app',
46-
start: 'react-native start',
47-
build:
48-
'RCT_NO_LAUNCH_PACKAGER=true xcodebuild build -scheme playground -workspace ios/playground.xcworkspace -sdk iphonesimulator -configuration Debug -derivedDataPath ios/DerivedData/playground ONLY_ACTIVE_ARCH=YES -quiet -UseModernBuildSystem=YES',
51+
binaryPath: 'ios/DerivedData/playground/Build/Products/Debug-iphonesimulator/playground.app',
52+
start: 'npm start -- --e2e',
53+
build: 'RCT_NO_LAUNCH_PACKAGER=true xcodebuild build -scheme playground -workspace ios/playground.xcworkspace -sdk iphonesimulator -configuration Debug -derivedDataPath ios/DerivedData/playground ONLY_ACTIVE_ARCH=YES -quiet -UseModernBuildSystem=YES',
4954
},
5055
'ios.release': {
5156
type: 'ios.app',
52-
binaryPath:
53-
'ios/DerivedData/playground/Build/Products/Release-iphonesimulator/playground.app',
54-
build:
55-
'RCT_NO_LAUNCH_PACKAGER=true xcodebuild build -scheme playground_release -workspace ios/playground.xcworkspace -sdk iphonesimulator -configuration Release -derivedDataPath ios/DerivedData/playground ONLY_ACTIVE_ARCH=YES -quiet -UseModernBuildSystem=YES',
57+
binaryPath: 'ios/DerivedData/playground/Build/Products/Release-iphonesimulator/playground.app',
58+
build: 'RCT_NO_LAUNCH_PACKAGER=true xcodebuild build -scheme playground_release -workspace ios/playground.xcworkspace -sdk iphonesimulator -configuration Release -derivedDataPath ios/DerivedData/playground ONLY_ACTIVE_ARCH=YES -quiet -UseModernBuildSystem=YES',
5659
},
5760
'android.debug': {
5861
type: 'android.apk',
5962
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
60-
start: 'react-native start',
61-
build:
62-
'cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug',
63-
reversePorts: [8081],
63+
start: 'npm start -- --e2e',
64+
build: 'cd playground/android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug',
65+
reversePorts: [
66+
8081,
67+
],
6468
},
6569
'android.release': {
6670
type: 'android.apk',
6771
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
68-
build:
69-
'cd android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release',
72+
build: 'cd android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release',
7073
},
7174
},
7275
configurations: {
7376
'ios.none': {
74-
binaryPath:
75-
'ios/DerivedData/playground/Build/Products/Debug-iphonesimulator/playground.app',
77+
binaryPath: 'ios/DerivedData/playground/Build/Products/Debug-iphonesimulator/playground.app',
7678
type: 'ios.none',
7779
name: 'iPhone 13',
7880
session: {
@@ -115,10 +117,6 @@ const config = {
115117
app: 'android.release',
116118
device: 'emulator',
117119
},
118-
'android.genycloud.release': {
119-
app: 'android.release',
120-
device: 'genymotion.emulator.name',
121-
},
122120
},
123121
};
124122

playground/scripts/test-e2e.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ const CI = includes(process.argv, '--ci');
1212
run();
1313

1414
function run() {
15-
const prefix = android ? (CI ? `android.genycloud` : `android.emu`) : `ios.sim`;
16-
const suffix = release ? `release` : `debug`;
15+
const prefix = android ? 'android.emu' : 'ios.sim';
16+
const suffix = release ? 'release' : 'debug';
1717
const configuration = `${prefix}.${suffix}`;
18-
const headless$ = android ? (headless ? `--headless` : ``) : ``;
18+
const headless$ = android ? (headless ? '--headless' : '') : '';
1919
const workers = multi ? 3 : 1;
2020
const loglevel = verbose ? '--loglevel verbose' : '';
2121

0 commit comments

Comments
 (0)