Files
paseo/packages/app/e2e/fixtures.ts
Mohamed Boudra 420f25f1e9 feat: add download toast, e2e permission tests, and update favicons
- Add download toast component with progress indicator and auto-dismiss
- Add download store for managing file download state
- Add e2e tests for permission prompts (allow/deny flows)
- Add global setup for e2e tests with isolated daemon instance
- Update favicon assets with new design
- Refactor agent-stream-view to use shared tool-call-details component
- Simplify file-explorer-pane component
- Clean up unused screenshots and PRODUCTION.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-01-16 20:23:07 +07:00

50 lines
1.3 KiB
TypeScript

import { test, expect, type Page } from '@playwright/test';
const consoleEntries = new WeakMap<Page, string[]>();
test.beforeEach(async ({ page }) => {
const entries: string[] = [];
consoleEntries.set(page, entries);
page.on('console', (message) => {
entries.push(`[console:${message.type()}] ${message.text()}`);
});
page.on('pageerror', (error) => {
entries.push(`[pageerror] ${error.message}`);
});
// Set up test daemon connection if available
const daemonPort = process.env.E2E_DAEMON_PORT;
if (daemonPort) {
const testDaemon = {
id: 'e2e-test-daemon',
label: 'localhost',
wsUrl: `ws://localhost:${daemonPort}/ws`,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
};
await page.addInitScript((daemon) => {
localStorage.setItem('@paseo:daemon-registry', JSON.stringify([daemon]));
}, testDaemon);
}
});
test.afterEach(async ({ page }, testInfo) => {
const entries = consoleEntries.get(page);
if (!entries || entries.length === 0) {
return;
}
if (testInfo.status === testInfo.expectedStatus) {
return;
}
await testInfo.attach('browser-console', {
body: entries.join('\n'),
contentType: 'text/plain',
});
});
export { test, expect };