Skip to content

Commit

Permalink
different name in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zviadm committed May 15, 2024
1 parent d427c15 commit 6b57f37
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 4 additions & 0 deletions forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import { rendererConfig } from './webpack.renderer.config';


const config: ForgeConfig = {
// electron-forge packager is only used for building binaries for E2E testing.
// electorn-builder is used for building actual distributables, including code signing
// and auto updating features.
packagerConfig: {
asar: true,
name: "Celo Terminal - E2ETest",
},
rebuildConfig: {},
makers: [],
Expand Down
11 changes: 3 additions & 8 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ import * as remoteMain from "@electron/remote/main"

import celoTerminalIcon from './../../build/icon.png'

if (IS_E2E_TEST) {
app.setName("Celo Terminal - E2ETest")
} else if (!app.isPackaged) {
app.setName("Celo Terminal - DEV")
}
declare const MAIN_WINDOW_WEBPACK_ENTRY: string;
declare const SPLASH_WINDOW_WEBPACK_ENTRY: string;

remoteMain.initialize()

// List of URLs that don't allow CORS requests. Celo Terminal is a native app thus
Expand All @@ -24,9 +22,6 @@ const CORSByPassURLs = [
'https://repo.sourcify.dev/*',
]

declare const MAIN_WINDOW_WEBPACK_ENTRY: string;
declare const SPLASH_WINDOW_WEBPACK_ENTRY: string;

log.transports.console.level = (app.isPackaged && !IS_E2E_TEST) ? false : "debug"
log.transports.file.level = (app.isPackaged && !IS_E2E_TEST) ? "info" : "debug"
log.transports.file.resolvePath = () => path.join(
Expand Down
9 changes: 5 additions & 4 deletions wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import { onPrepare, afterSession, beforeSession} from "./test/setup"
// NOTE(zviad): We can't use webdriverIO-s automatic binaryPath detection because
// we have dependency both on electorn-forge and on electron-builder.
const binaryPath = () => {
const prefix = ["out", `Celo Terminal-${process.platform}-${process.arch}`]
const appName = "Celo Terminal - E2ETest"
const prefix = ["out", `${appName}-${process.platform}-${process.arch}`]
switch (process.platform) {
case "darwin":
return path.join(...prefix, "Celo Terminal.app", "Contents", "MacOS", "Celo Terminal")
return path.join(...prefix, `${appName}.app`, "Contents", "MacOS", appName)
case "win32":
return path.join(...prefix, "Celo Terminal.exe")
return path.join(...prefix, `${appName}.exe`)
case "linux":
return path.join(...prefix, "Celo Terminal")
return path.join(...prefix, `${appName}`)
default:
throw new Error(`Not supported platform: ${process.platform}`)
}
Expand Down

0 comments on commit 6b57f37

Please sign in to comment.