Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NoQA] dev: fix e2e test running in dev mode #32713

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"symbolicate:android": "npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map",
"symbolicate:ios": "npx metro-symbolicate main.jsbundle.map",
"test:e2e": "node tests/e2e/testRunner.js --development --skipCheckout --skipInstallDeps --buildMode none",
"test:e2e:dev": "node tests/e2e/testRunner.js --development --skipCheckout --config ./config.dev.js --buildMode skip --skipInstallDeps",
"gh-actions-unused-styles": "./.github/scripts/findUnusedKeys.sh",
"workflow-test": "./workflow_tests/scripts/runWorkflowTests.sh",
"workflow-test:generate": "node workflow_tests/utils/preGenerateTest.js",
Expand Down
9 changes: 7 additions & 2 deletions tests/e2e/config.dev.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const packageName = 'com.expensify.chat.dev';
const appPath = './android/app/build/outputs/apk/development/debug/app-development-debug.apk';

module.exports = {
APP_PACKAGE: 'com.expensify.chat.dev',
APP_PATH: './android/app/build/outputs/apk/development/debug/app-development-debug.apk',
MAIN_APP_PACKAGE: packageName,
DELTA_APP_PACKAGE: packageName,
MAIN_APP_PATH: appPath,
DELTA_APP_PATH: appPath,
RUNS: 8,
};
19 changes: 13 additions & 6 deletions tests/e2e/testRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,22 @@ const compare = require('./compare/compare');

// VARIABLE CONFIGURATION
const args = process.argv.slice(2);
const getArg = (argName) => {
const argIndex = args.indexOf(argName);
if (argIndex === -1) {
return undefined;
}
return args[argIndex + 1];
};

let branch = 'main';
if (args.includes('--branch')) {
branch = args[args.indexOf('--branch') + 1];
branch = getArg('--branch');
}

let label = branch;
if (args.includes('--label')) {
label = args[args.indexOf('--label') + 1];
label = getArg('--label');
}

let config = defaultConfig;
Expand Down Expand Up @@ -71,17 +78,17 @@ if (isDevMode) {
}

if (args.includes('--buildMode')) {
buildMode = args[args.indexOf('--buildMode') + 1];
buildMode = getArg('--buildMode');
}

if (args.includes('--config')) {
const configPath = args[args.indexOf('--config') + 1];
const configPath = getArg('--config');
setConfigPath(configPath);
}

// Important set app path after correct config file has been set
let mainAppPath = args[args.indexOf('--mainAppPath') + 1] || config.MAIN_APP_PATH;
let deltaAppPath = args[args.indexOf('--deltaAppPath') + 1] || config.DELTA_APP_PATH;
let mainAppPath = getArg('--mainAppPath') || config.MAIN_APP_PATH;
let deltaAppPath = getArg('--deltaAppPath') || config.DELTA_APP_PATH;

// Create some variables after the correct config file has been loaded
const OUTPUT_FILE = `${config.OUTPUT_DIR}/${label}.json`;
Expand Down
Loading