pcbjam/tests/kicad/pcbnew.spec.ts
Viktor Vaczi eedfe22654 Organize test logs into separate directories by test suite and file
- wxWidgets logs: tests/logs/wxwidgets/<test-file>/
- KiCad logs: tests/logs/kicad/<test-file>/
- Global setup now cleans all log subdirectories recursively
- Added globalSetup to KiCad playwright config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:35:40 +01:00

38 lines
1.4 KiB
TypeScript

import { test, expect } from './fixtures';
/**
* PCBnew WASM E2E Tests
*
* These tests verify that the KiCad PCBnew application runs correctly in the browser.
* The WASM files are served from apps/kicad/ via the web server.
*
* Logs are written to tests/logs/:
* - {test-name}.log - console output
* - {test-name}.errors.log - page errors (if any)
*/
test.describe('PCBnew WASM', () => {
test.beforeEach(async ({ page }) => {
// Navigate to PCBnew via web server (apps/kicad/pcbnew.html)
await page.goto('/kicad/pcbnew.html');
});
test('should load PCBnew WASM module', async ({ page, testLogger }) => {
// Wait for WASM to initialize (look for canvas or status indicator)
// This is a basic smoke test - expand as PCBnew integration matures
await expect(page.locator('canvas')).toBeVisible({ timeout: 60000 });
// testLogger automatically captures all console output and errors
});
test('should render without JavaScript errors', async ({ page, testLogger }) => {
await page.goto('/kicad/pcbnew.html');
await page.waitForTimeout(5000); // Give time for WASM to load
// Check captured errors (excluding known acceptable ones)
const criticalErrors = testLogger.errors.filter(e =>
!e.includes('ResizeObserver') && !e.includes('favicon')
);
expect(criticalErrors).toHaveLength(0);
});
});