import { test, expect, _electron as electron } from '@playwright/test'; test.describe('Dashboard', () => { test.describe.configure({ mode: 'serial' }); let electronApp: any; let window: any; test.beforeAll(async () => { electronApp = await electron.launch({ args: ['out/main/index.js'], env: { ...process.env, NODE_ENV: 'test', }, }); let found = false; for (const w of electronApp.windows()) { await w.waitForLoadState('domcontentloaded'); const t = await w.title(); if (t === 'D3RO Voice' || t === 'd3ro-voice') { window = w; found = true; break; } } if (!found) { window = await electronApp.waitForEvent('window', { predicate: async (page: any) => { await page.waitForLoadState('domcontentloaded'); const t = await page.title(); return t === 'D3RO Voice' || t === 'd3ro-voice'; } }); } }); test.afterAll(async () => { if (electronApp) { await electronApp.close(); } }); test('should render quick action cards and recent activity sections', async () => { await window.locator('nav >> text="Dashboard"').click(); // Check if quick actions are rendered await expect(window.locator('text="Quick Actions"').first()).toBeVisible(); // Check if recent activity is rendered await expect(window.locator('text="Recent Activity"').first()).toBeVisible(); }); });