Skip to content

Commit

Permalink
test: add platform switching for appBinaryPath
Browse files Browse the repository at this point in the history
  • Loading branch information
goosewobbler committed Apr 9, 2024
1 parent 289e6ce commit ac7457f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion example/e2e-standalone/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@ const packageJson = JSON.parse(
fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), { encoding: 'utf-8' }),
) as PackageJson;

const getBinaryExtension = () => {
if (process.platform === 'darwin') {
return '.app';
} else if (process.platform === 'win32') {
return '.exe';
}

return '';
};

const browser = await startSession({
appBinaryPath: './out/wdio-electron-service-example-darwin-arm64/wdio-electron-service-example.app',
appBinaryPath: `./out/wdio-electron-service-example-${process.platform}-${process.arch}/wdio-electron-service-example${getBinaryExtension()}`,
appArgs: ['foo', 'bar=baz'],
});

Expand Down

0 comments on commit ac7457f

Please sign in to comment.