diff --git a/features/stepDefinitions/tidgiMiniWindow.ts b/features/stepDefinitions/tidgiMiniWindow.ts index 408521ee..4caf79e2 100644 --- a/features/stepDefinitions/tidgiMiniWindow.ts +++ b/features/stepDefinitions/tidgiMiniWindow.ts @@ -105,8 +105,8 @@ When('I toggle tidgi mini window via IPC', async function(this: ApplicationWorld throw new Error('Application not launched'); } await this.app.evaluate(async ({ BrowserWindow }) => { - // Find the main window and call toggleTidgiMiniWindow via the service proxy - const mainWindow = BrowserWindow.getAllWindows().find(w => !w.isDestroyed() && w.webContents?.getType() === 'window'); + // Find the main window by URL (consistent with other step defs) + const mainWindow = BrowserWindow.getAllWindows().find(w => !w.isDestroyed() && w.webContents?.getURL().includes('index.html')); if (!mainWindow) throw new Error('Main window not found'); await mainWindow.webContents.executeJavaScript('window.service.window.toggleTidgiMiniWindow()'); }); diff --git a/features/stepDefinitions/ui.ts b/features/stepDefinitions/ui.ts index 60ef51fa..dc6fc51b 100644 --- a/features/stepDefinitions/ui.ts +++ b/features/stepDefinitions/ui.ts @@ -45,7 +45,8 @@ When('I wait for the page to load completely', async function(this: ApplicationW } await currentWindow?.waitForLoadState('domcontentloaded', { timeout: PLAYWRIGHT_TIMEOUT }); // Short networkidle gives workspace-creation and other startup IPC time to finish - // without blocking on long-lived connections. 3s is enough for the initial burst. + // without blocking on long-lived connections. 3s is intentionally different from + // PLAYWRIGHT_TIMEOUT — this is just a grace period, not a hard requirement. try { await currentWindow?.waitForLoadState('networkidle', { timeout: 3000 }); } catch {