mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Signed-off-by: Roman <ixrock@gmail.com> Co-authored-by: Sebastian Malton <sebastian@malton.name> Co-authored-by: Sebastian Malton <smalton@mirantis.com> Co-authored-by: Lauri Nevala <lauri.nevala@gmail.com> Co-authored-by: Alex Andreev <alex.andreev.email@gmail.com>
39 lines
745 B
TypeScript
39 lines
745 B
TypeScript
import { Application } from "spectron";
|
|
|
|
let appPath = ""
|
|
switch(process.platform) {
|
|
case "win32":
|
|
appPath = "./dist/win-unpacked/Lens.exe"
|
|
break
|
|
case "linux":
|
|
appPath = "./dist/linux-unpacked/kontena-lens"
|
|
break
|
|
case "darwin":
|
|
appPath = "./dist/mac/Lens.app/Contents/MacOS/Lens"
|
|
break
|
|
}
|
|
|
|
export function setup(): Application {
|
|
return new Application({
|
|
// path to electron app
|
|
args: [],
|
|
path: appPath,
|
|
startTimeout: 30000,
|
|
waitTimeout: 30000,
|
|
chromeDriverArgs: ['remote-debugging-port=9222'],
|
|
env: {
|
|
CICD: "true"
|
|
}
|
|
})
|
|
}
|
|
|
|
export async function tearDown(app: Application) {
|
|
const pid = app.mainProcess.pid
|
|
await app.stop()
|
|
try {
|
|
process.kill(pid, 0);
|
|
} catch(e) {
|
|
return
|
|
}
|
|
}
|