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

@@ -52,12 +52,15 @@ export class ConsoleMonitor {
// Monitor uncaught exceptions
page.on('pageerror', (error: Error) => {
this.errors.push({
const errorObj: ConsoleError = {
type: 'pageerror',
message: error.message,
location: error.stack,
timestamp: new Date(),
});
};
if (error.stack) {
errorObj.location = error.stack;
}
this.errors.push(errorObj);
});
this.isMonitoring = true;

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({

View File

@@ -61,12 +61,15 @@ export class IPCVerifier {
const typed: IpcHandlerResult = result as IpcHandlerResult;
return {
const resultObj: IPCTestResult = {
channel,
success: !typed.error,
error: typed.error,
duration: Date.now() - start,
};
if (typed.error) {
resultObj.error = typed.error;
}
return resultObj;
} catch (error) {
return {
channel,
@@ -114,12 +117,15 @@ export class IPCVerifier {
const typed: IpcHandlerResult = result as IpcHandlerResult;
return {
const resultObj: IPCTestResult = {
channel,
success: !typed.error,
error: typed.error,
duration: Date.now() - start,
};
if (typed.error) {
resultObj.error = typed.error;
}
return resultObj;
} catch (error) {
return {
channel,
@@ -173,12 +179,15 @@ export class IPCVerifier {
const typed: IpcHandlerResult = result as IpcHandlerResult;
return {
const resultObj: IPCTestResult = {
channel,
success: !typed.error,
error: typed.error,
duration: Date.now() - start,
};
if (typed.error) {
resultObj.error = typed.error;
}
return resultObj;
} catch (error) {
return {
channel,