remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/apps/remixdesktop/test/nighwatch.app.ts

102 lines
2.9 KiB

6 months ago
import os from 'os';
import fs from 'fs';
3 months ago
const useIsoGit = process.argv.includes('--use-isogit');
const useOffline = process.argv.includes('--use-offline');
8 months ago
// Function to read JSON file synchronously
function readJSONFileSync(filename: string): any {
try {
const data = fs.readFileSync(filename, 'utf8');
return JSON.parse(data);
} catch (err) {
throw err;
}
6 months ago
}
const packageData: any = readJSONFileSync('package.json');
6 months ago
const version = packageData.version;
let channel: string = ''
if (version.includes('beta')) {
6 months ago
channel = 'Beta';
6 months ago
} else if (version.includes('alpha')) {
6 months ago
channel = 'Alpha';
6 months ago
} else if (version.includes('insiders')) {
6 months ago
channel = 'Insiders';
6 months ago
}
11 months ago
module.exports = {
src_folders: ['build-e2e/remixdesktop/test/tests/app'],
output_folder: './reports/tests',
9 months ago
custom_commands_path: ['build-e2e/remix-ide-e2e/src/commands'],
11 months ago
page_objects_path: '',
globals_path: '',
test_settings: {
default: {
8 months ago
enable_fail_fast: true,
11 months ago
selenium_port: 4444,
selenium_host: 'localhost',
globals: {
waitForConditionTimeout: 10000,
4 weeks ago
asyncHookTimeout: 30000
11 months ago
},
screenshots: {
enabled: true,
path: './reports/screenshots',
on_failure: true,
on_error: true
},
webdriver: {
start_process: true,
timeout_options: {
timeout: 60000,
retry_attempts: 3
}
},
11 months ago
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
'goog:chromeOptions': (() => {
const type = os.type();
const arch = os.arch();
let binaryPath = "";
// Check if running on CircleCI or locally
let args = process.env.CIRCLECI ? ["--e2e"] : ["--e2e-local"];
3 months ago
if(useIsoGit) args = [...args, '--use-isogit'];
if(useOffline) args = [...args, '--use-offline'];
8 months ago
// Set display size
3 months ago
const windowSize = "--window-size=1000,1000";
args = [...args];
switch (type) {
case 'Windows_NT':
6 months ago
binaryPath = `./release/win-unpacked/Remix-Desktop-${channel}.exe`;
break;
case 'Darwin':
binaryPath = arch === 'x64' ?
6 months ago
`release/mac/Remix-Desktop-${channel}.app/Contents/MacOS/Remix-Desktop-${channel}` :
`release/mac-arm64/Remix-Desktop-${channel}.app/Contents/MacOS/Remix-Desktop-${channel}`;
break;
case 'Linux':
binaryPath = "release/linux-unpacked/remixdesktop";
break;
}
2 months ago
console.log('binaryPath', binaryPath);
return {
binary: binaryPath,
args: args
};
})()
8 months ago
}
}
11 months ago
}
};