This commit is contained in:
2025-12-12 21:39:48 +01:00
parent ddbd99b747
commit cae81b1088
49 changed files with 777 additions and 269 deletions

View File

@@ -22,19 +22,21 @@ export class ElectronTestHarness {
async launch(): Promise<void> {
// Path to the built Electron app entry point
const electronEntryPath = path.join(__dirname, '../../../apps/companion/dist/main/main.cjs');
// Launch Electron app with the compiled entry file
// Note: Playwright may have compatibility issues with certain Electron versions
// regarding --remote-debugging-port flag
this.app = await electron.launch({
const launchOptions: any = {
args: [electronEntryPath],
env: {
...process.env,
...Object.fromEntries(Object.entries(process.env).filter(([_, v]) => v !== undefined)),
NODE_ENV: 'test',
},
// Try to disable Chrome DevTools Protocol features that might conflict
executablePath: process.env.ELECTRON_EXECUTABLE_PATH,
});
};
if (process.env.ELECTRON_EXECUTABLE_PATH) {
launchOptions.executablePath = process.env.ELECTRON_EXECUTABLE_PATH;
}
this.app = await electron.launch(launchOptions);
// Wait for first window (renderer process)
this.mainWindow = await this.app.firstWindow({