Skip to content

Commit

Permalink
frontend: Add multi env testing for playwright
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent T <[email protected]>
  • Loading branch information
vyncent-t committed Sep 20, 2024
1 parent 0c0442a commit 4717294
Show file tree
Hide file tree
Showing 11 changed files with 393 additions and 52 deletions.
9 changes: 8 additions & 1 deletion app/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,19 @@ import windowSize from './windowSize';

dotenv.config({ path: path.join(process.resourcesPath, '.env') });

let electronStartURL = process.env.ELECTRON_START_URL;

const pathInfoDebug = false;
let pathInfo;

const isDev = process.env.ELECTRON_DEV || false;
let frontendPath = '';

const isClusterDev = process.env.CLUSTER_DEV || false;
if (isClusterDev) {
electronStartURL = process.env.HEADLAMP_TEST_URL;
}

if (isDev) {
frontendPath = path.resolve('..', 'frontend', 'build', 'index.html');
} else {
Expand All @@ -43,7 +50,7 @@ if (isDev) {
const backendToken = randomBytes(32).toString('hex');

const startUrl = (
process.env.ELECTRON_START_URL ||
electronStartURL ||
url.format({
pathname: frontendPath,
protocol: 'file:',
Expand Down
74 changes: 74 additions & 0 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"@babel/preset-env": "^7.24.8",
"@babel/preset-typescript": "^7.24.7",
"@electron/notarize": "^2.3.2",
"@playwright/test": "^1.45.3",
"electron": "^31.2.0",
"electron-builder": "^24.13.3",
"i18next-parser": "^9.0.0",
Expand Down
Loading

0 comments on commit 4717294

Please sign in to comment.