Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
// wxPopupWindow Tests - Transient popups like KiCad toolbar palettes
|
|
|
|
|
import { test, expect, tryLoadApp } from './utils/fixtures';
|
2026-06-23 14:32:28 +02:00
|
|
|
import { findByLabel, clickByLabel } from './utils/element-tracker';
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
|
|
|
|
|
test.describe('wxPopupWindow Tests', () => {
|
|
|
|
|
|
|
|
|
|
test('Popup test app loads successfully', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/popup/popup_test.html');
|
|
|
|
|
const loaded = await tryLoadApp(page);
|
|
|
|
|
|
|
|
|
|
await page.screenshot({ path: 'test-results/popup-01-loaded.png', fullPage: true });
|
|
|
|
|
|
|
|
|
|
expect(loaded, 'Popup app should load').toBe(true);
|
|
|
|
|
expect(testLogger.errors.filter(e => !e.includes('favicon'))).toHaveLength(0);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Status popup button exists', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/popup/popup_test.html');
|
|
|
|
|
const loaded = await tryLoadApp(page);
|
2026-01-01 20:18:19 +01:00
|
|
|
expect(loaded, 'App should load').toBe(true);
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
|
|
|
|
|
await page.waitForTimeout(500);
|
|
|
|
|
await page.screenshot({ path: 'test-results/popup-02-status.png', fullPage: true });
|
|
|
|
|
|
|
|
|
|
// App loaded successfully - verify no errors
|
|
|
|
|
expect(testLogger.errors.filter(e => !e.includes('favicon'))).toHaveLength(0);
|
|
|
|
|
});
|
|
|
|
|
|
2026-06-23 14:32:28 +02:00
|
|
|
// Reproduces the DOM-port bug: a wxPopupTransientWindow toolbar palette (like KiCad's
|
|
|
|
|
// ACTION_TOOLBAR_PALETTE) must actually render as a floating overlay and be interactive.
|
|
|
|
|
// FAILS before the popup-overlay fix (palette never renders → its tool buttons aren't
|
|
|
|
|
// visible/clickable), PASSES after.
|
|
|
|
|
test('Tool palette opens and a tool button is clickable', async ({ page, testLogger }) => {
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
await page.goto('/standalone/popup/popup_test.html');
|
2026-06-23 14:32:28 +02:00
|
|
|
expect(await tryLoadApp(page), 'App should load').toBe(true);
|
|
|
|
|
|
|
|
|
|
// Open the transient palette (wxPopupTransientWindow::Popup()).
|
|
|
|
|
expect(await clickByLabel(page, 'Show Tool Palette'),
|
|
|
|
|
'"Show Tool Palette" button should be clickable').toBe(true);
|
|
|
|
|
await page.waitForTimeout(500);
|
|
|
|
|
await page.screenshot({ path: 'test-results/popup-03-palette-open.png', fullPage: true });
|
|
|
|
|
|
|
|
|
|
// The palette must actually render as an overlay: its tool buttons (T1..T9) become visible.
|
|
|
|
|
const t1 = await findByLabel(page, 'T1', { visible: true });
|
|
|
|
|
expect(t1, 'palette tool button T1 should be visible once the palette opens').not.toBeNull();
|
|
|
|
|
|
|
|
|
|
// And clicking a tool must fire its handler (logged via EM_ASM console.log in popup_test.cpp).
|
|
|
|
|
expect(await clickByLabel(page, 'T1', { visible: true }), 'palette tool T1 should be clickable').toBe(true);
|
|
|
|
|
await page.waitForTimeout(300);
|
|
|
|
|
expect(
|
|
|
|
|
testLogger.consoleLogs.some(l => l.includes('[POPUP] Tool 1 clicked')),
|
|
|
|
|
'clicking palette tool T1 should fire its handler'
|
|
|
|
|
).toBe(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// The palette is transient: clicking outside should dismiss it.
|
|
|
|
|
test('Tool palette dismisses on outside click', async ({ page }) => {
|
|
|
|
|
await page.goto('/standalone/popup/popup_test.html');
|
|
|
|
|
expect(await tryLoadApp(page), 'App should load').toBe(true);
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
|
2026-06-23 14:32:28 +02:00
|
|
|
expect(await clickByLabel(page, 'Show Tool Palette')).toBe(true);
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
await page.waitForTimeout(500);
|
2026-06-23 14:32:28 +02:00
|
|
|
expect(await findByLabel(page, 'T1', { visible: true }),
|
|
|
|
|
'palette should open before testing dismiss').not.toBeNull();
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
|
2026-06-23 14:32:28 +02:00
|
|
|
// Click far from the palette to dismiss the transient popup.
|
|
|
|
|
await page.mouse.click(600, 500);
|
|
|
|
|
await page.waitForTimeout(400);
|
|
|
|
|
await page.screenshot({ path: 'test-results/popup-03-palette-dismissed.png', fullPage: true });
|
|
|
|
|
expect(await findByLabel(page, 'T1', { visible: true }),
|
|
|
|
|
'palette should be dismissed (T1 no longer visible) after an outside click').toBeNull();
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Color picker button exists', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/popup/popup_test.html');
|
|
|
|
|
const loaded = await tryLoadApp(page);
|
2026-01-01 20:18:19 +01:00
|
|
|
expect(loaded, 'App should load').toBe(true);
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
|
|
|
|
|
await page.waitForTimeout(500);
|
|
|
|
|
await page.screenshot({ path: 'test-results/popup-04-color.png', fullPage: true });
|
|
|
|
|
|
|
|
|
|
expect(loaded, 'Color picker button should exist').toBe(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Positioning buttons exist', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/popup/popup_test.html');
|
|
|
|
|
const loaded = await tryLoadApp(page);
|
2026-01-01 20:18:19 +01:00
|
|
|
expect(loaded, 'App should load').toBe(true);
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
|
|
|
|
|
await page.waitForTimeout(500);
|
|
|
|
|
await page.screenshot({ path: 'test-results/popup-05-positioning.png', fullPage: true });
|
|
|
|
|
|
|
|
|
|
expect(loaded, 'Positioning buttons should exist').toBe(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Event log panel exists', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/popup/popup_test.html');
|
|
|
|
|
const loaded = await tryLoadApp(page);
|
2026-01-01 20:18:19 +01:00
|
|
|
expect(loaded, 'App should load').toBe(true);
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
|
|
|
|
|
await page.waitForTimeout(500);
|
|
|
|
|
await page.screenshot({ path: 'test-results/popup-06-log.png', fullPage: true });
|
|
|
|
|
|
|
|
|
|
expect(loaded, 'Event log should exist').toBe(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|