Skip to content

Commit

Permalink
chore: cherry-pick #test/revert-8305 (#9022)
Browse files Browse the repository at this point in the history
This PR cherry-picks #test/revert-8305

Co-authored-by: CW <chris.wilcox@consensys.net>
  • Loading branch information
github-actions[bot] and chrisleewilcox authored Mar 21, 2024
1 parent 5ea640f commit 6725a14
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
45 changes: 21 additions & 24 deletions .detoxrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
const { execSync } = require('child_process');

const getAvailableAVDs = (() => {
try {
// Run the command to list available AVDs
const outputList = execSync("emulator -list-avds").toString();

// Parse the output and return an array of AVD names
const avdNames = outputList.trim().split("\n");

// return avdNames
return avdNames;
} catch (error) {
console.error(
"Revisit the command to get the error list. It seems incorrect:",
error.message,
);
return [];
}
})();

/** @type {Detox.DetoxConfig} */
module.exports = {
testRunner: {
args: {
Expand Down Expand Up @@ -53,16 +33,22 @@ module.exports = {
device: 'ios.simulator',
app: 'ios.release',
},
// because e2e run on debug mode in bitrise
'android.emu.bitrise.debug': {
device: 'android.bitrise.emulator',
app: 'android.bitrise.debug',
},

'android.emu.debug': {
device: 'android.emulator',
app: 'android.debug',
},
'android.emu.release': {
device: 'android.emulator',
device: 'android.bitrise.emulator',
app: 'android.release',
},
'android.emu.release.qa': {
device: 'android.emulator',
device: 'android.bitrise.emulator',
app: 'android.qa',
},
},
Expand All @@ -73,10 +59,16 @@ module.exports = {
type: 'iPhone 13 Pro',
},
},
'android.bitrise.emulator': {
type: 'android.emulator',
device: {
avdName: 'emulator',
},
},
'android.emulator': {
type: 'android.emulator',
device: {
avdName: getAvailableAVDs[0],
avdName: 'Pixel_5_API_30',
},
},
},
Expand All @@ -92,6 +84,11 @@ module.exports = {
'ios/build/Build/Products/Release-iphonesimulator/MetaMask.app',
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='production' yarn build:ios:release:e2e",
},
'android.bitrise.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk',
build: 'yarn start:android:e2e',
},
'android.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"test:e2e:ios:bitrise:run": "IS_TEST='true' detox test -c ios.sim.debug",
"test:e2e:ios:debug:single": "detox test -c ios.sim.debug",
"test:e2e:android:debug": "IS_TEST='true' detox build -c android.emu.debug && detox test -c android.emu.debug",
"test:e2e:android:bitrise:build": "IS_TEST='true' detox build -c android.emu.debug",
"test:e2e:android:bitrise:run": "IS_TEST='true' detox test -c android.emu.debug --headless",
"test:e2e:android:bitrise:build": "IS_TEST='true' detox build -c android.emu.bitrise.debug",
"test:e2e:android:bitrise:run": "IS_TEST='true' detox test -c android.emu.bitrise.debug --headless",
"test:e2e:android:debug:single": "detox test -c android.emu.debug",
"test:e2e:android": "detox build -c android.emu.release && detox test -c android.emu.release --record-videos failing",
"test:e2e:android:qa": "detox build -c android.emu.release.qa && detox test -c android.emu.release.qa --record-videos failing",
Expand Down

0 comments on commit 6725a14

Please sign in to comment.