2025-12-03 17:58:47 +01:00
|
|
|
// wxGrid Custom Cell Renderers Tests - Color cells, icon+text, striped rows
|
2026-07-07 10:50:24 +02:00
|
|
|
import { test, expect } from './utils/fixtures';
|
|
|
|
|
import { clickTab, clickGridCell, waitForWxApp, stableShot } from './utils/element-tracker';
|
2025-12-03 17:58:47 +01:00
|
|
|
|
|
|
|
|
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');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 17:58:47 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'gridrenderers-01-loaded.png', { fullPage: true });
|
2025-12-03 17:58:47 +01:00
|
|
|
|
|
|
|
|
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');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 17:58:47 +01:00
|
|
|
|
|
|
|
|
// Color Cells tab should be visible by default
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'gridrenderers-02-color-cells.png', { fullPage: true });
|
2025-12-03 17:58:47 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Icon+Text tab displays icons with text', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/gridrenderers/gridrenderers_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 17:58:47 +01:00
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
// Click Icon+Text tab using element registry
|
|
|
|
|
const clicked = await clickTab(page, 'Icon+Text');
|
|
|
|
|
expect(clicked, 'Icon+Text tab should be found').toBe(true);
|
2025-12-03 17:58:47 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'gridrenderers-03-icon-text.png', { fullPage: true });
|
2025-12-03 17:58:47 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Striped rows tab displays alternating colors', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/gridrenderers/gridrenderers_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 17:58:47 +01:00
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
// Click Striped+Checkboxes tab using element registry
|
|
|
|
|
const clicked = await clickTab(page, 'Striped+Checkboxes');
|
|
|
|
|
expect(clicked, 'Striped+Checkboxes tab should be found').toBe(true);
|
2025-12-03 17:58:47 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'gridrenderers-04-striped.png', { fullPage: true });
|
2025-12-03 17:58:47 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Checkbox cells can be toggled in striped grid', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/gridrenderers/gridrenderers_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 17:58:47 +01:00
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
// Go to Striped+Checkboxes tab using element registry
|
|
|
|
|
const tabClicked = await clickTab(page, 'Striped+Checkboxes');
|
|
|
|
|
expect(tabClicked, 'Striped+Checkboxes tab should be found').toBe(true);
|
2025-12-03 17:58:47 +01:00
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
// Click on a checkbox cell (DNP column - row 2, col 2 based on typical grid structure)
|
|
|
|
|
const cellClicked = await clickGridCell(page, 2, 2);
|
|
|
|
|
expect(cellClicked, 'Checkbox cell should be found').toBe(true);
|
2025-12-03 17:58:47 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'gridrenderers-05-checkbox-toggle.png', { fullPage: true });
|
2025-12-03 17:58:47 +01:00
|
|
|
});
|
|
|
|
|
});
|