Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
aethernet committed Apr 25, 2024
1 parent aff4369 commit 9b6b882
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions wdio.conf.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
/// <reference types="wdio-electron-service" />
import type { Options } from '@wdio/types';
import { join } from 'path';

// For backward compatibility reason, the bundle is called `balena-etcher` on linux, and balenaEtcher on all other platforms.
// As a result, we need to specify the binary path for linux as wdio looks for balenaEtcher.
function serviceOptions() {
const appArgs: string[] = [];
if (process.platform === 'linux') {
return {
// custom application args
appArgs,
// path to the electron binary
binaryPath: join(
__dirname,
'out',
`balenaEtcher-linux-${process.arch}`,
'balena-etcher',
),
};
} else {
return {
appArgs,
};
}
}

export const config: Options.Testrunner = {
//
Expand Down Expand Up @@ -63,10 +87,7 @@ export const config: Options.Testrunner = {
browserName: 'electron',
// Electron service options
// see https://webdriver.io/docs/desktop-testing/electron/configuration/#service-options
'wdio:electronServiceOptions': {
// custom application args
appArgs: [],
},
'wdio:electronServiceOptions': serviceOptions(),
},
],

Expand Down

0 comments on commit 9b6b882

Please sign in to comment.