2025-12-03 16:57:02 +01:00
|
|
|
// wxColourPickerCtrl/wxFontPickerCtrl Tests - Color and font pickers for KiCad
|
2026-07-07 10:50:24 +02:00
|
|
|
import { test, expect, waitForWxApp } from './utils/fixtures';
|
|
|
|
|
import { stableShot } from './utils/element-tracker';
|
2025-12-03 16:57:02 +01:00
|
|
|
|
|
|
|
|
test.describe('wxPicker Controls Tests', () => {
|
|
|
|
|
|
|
|
|
|
test('Pickers test app loads successfully', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/pickers/pickers_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'pickers-01-loaded.png', { fullPage: true });
|
2025-12-03 16:57:02 +01:00
|
|
|
|
|
|
|
|
const hasStartup = testLogger.consoleLogs.some(l => l.includes('PICKERS_TEST'));
|
|
|
|
|
|
|
|
|
|
expect(testLogger.errors.filter(e => !e.includes('favicon'))).toHaveLength(0);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Color pickers are visible', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/pickers/pickers_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
// Check startup logged (deterministic: poll the SAME console event the spec asserted)
|
|
|
|
|
await expect
|
|
|
|
|
.poll(
|
|
|
|
|
() => testLogger.consoleLogs.some(l => l.includes('Picker controls test app started')),
|
|
|
|
|
{ message: 'Picker controls should initialize' }
|
|
|
|
|
)
|
|
|
|
|
.toBe(true);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'pickers-02-colors.png', { fullPage: true });
|
2025-12-03 16:57:02 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Font picker is visible', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/pickers/pickers_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
|
|
|
|
// Font picker should be part of the UI
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'pickers-03-font.png', { fullPage: true });
|
2025-12-03 16:57:02 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Color preview panel exists', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/pickers/pickers_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
|
|
|
|
// The preview panel should exist and be colored
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'pickers-04-preview.png', { fullPage: true });
|
2025-12-03 16:57:02 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|