pcbjam/tests/e2e/gridrenderers.spec.ts
Viktor Vaczi 11f5b81fc0 Add Phase 2 wxWidgets test coverage: grid renderers, print preview, specialized controls
New test apps (4):
- gridrenderers: Custom cell renderers (color swatches, icon+text, striped rows)
- printpreview: wxPrintPreview frame with zoom, page setup dialogs
- bitmapbuttons: Toolbar buttons with custom bitmap icons, disabled states
- specialized: wxTreebook, wxBitmapComboBox, wxCheckListBox

Test coverage increased from 184 to 209 tests across 29 apps (~98% coverage).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 17:58:47 +01:00

96 lines
3.2 KiB
TypeScript

// wxGrid Custom Cell Renderers Tests - Color cells, icon+text, striped rows
import { test, expect, tryLoadApp } from './utils/fixtures';
test.describe('wxGrid Custom Cell Renderers Tests', () => {
test('Grid renderers test app loads successfully', async ({ page, testLogger }) => {
await page.goto('/standalone/gridrenderers/gridrenderers_test.html');
const loaded = await tryLoadApp(page);
await page.screenshot({ path: 'test-results/gridrenderers-01-loaded.png', fullPage: true });
expect(loaded, 'Grid renderers app should load').toBe(true);
expect(testLogger.errors.filter(e => !e.includes('favicon'))).toHaveLength(0);
});
test('Color cells tab displays color swatches', async ({ page, testLogger }) => {
await page.goto('/standalone/gridrenderers/gridrenderers_test.html');
const loaded = await tryLoadApp(page);
if (!loaded) {
test.skip();
return;
}
await page.waitForTimeout(300);
// Color Cells tab should be visible by default
await page.screenshot({ path: 'test-results/gridrenderers-02-color-cells.png', fullPage: true });
});
test('Icon+Text tab displays icons with text', async ({ page, testLogger }) => {
await page.goto('/standalone/gridrenderers/gridrenderers_test.html');
const loaded = await tryLoadApp(page);
if (!loaded) {
test.skip();
return;
}
await page.waitForTimeout(300);
const canvas = page.locator('#canvas');
const box = await canvas.boundingBox();
if (box) {
// Click Icon+Text tab (second tab in notebook)
await page.mouse.click(box.x + 150, box.y + 80);
await page.waitForTimeout(200);
}
await page.screenshot({ path: 'test-results/gridrenderers-03-icon-text.png', fullPage: true });
});
test('Striped rows tab displays alternating colors', async ({ page, testLogger }) => {
await page.goto('/standalone/gridrenderers/gridrenderers_test.html');
const loaded = await tryLoadApp(page);
if (!loaded) {
test.skip();
return;
}
await page.waitForTimeout(300);
const canvas = page.locator('#canvas');
const box = await canvas.boundingBox();
if (box) {
// Click Striped+Checkboxes tab (third tab)
await page.mouse.click(box.x + 280, box.y + 80);
await page.waitForTimeout(200);
}
await page.screenshot({ path: 'test-results/gridrenderers-04-striped.png', fullPage: true });
});
test('Checkbox cells can be toggled in striped grid', async ({ page, testLogger }) => {
await page.goto('/standalone/gridrenderers/gridrenderers_test.html');
const loaded = await tryLoadApp(page);
if (!loaded) {
test.skip();
return;
}
await page.waitForTimeout(300);
const canvas = page.locator('#canvas');
const box = await canvas.boundingBox();
if (box) {
// Go to Striped+Checkboxes tab
await page.mouse.click(box.x + 280, box.y + 80);
await page.waitForTimeout(200);
// Click on a checkbox cell (DNP column)
await page.mouse.click(box.x + 330, box.y + 180);
await page.waitForTimeout(200);
}
await page.screenshot({ path: 'test-results/gridrenderers-05-checkbox-toggle.png', fullPage: true });
});
});