Extend element registry and migrate all tests to semantic selectors

Phase 2 of element registry migration - eliminate hardcoded coordinates:

Element tracker additions:
- wxTreeCtrl items (clickTreeItem, findTreeItem)
- wxDataViewCtrl items and column headers
- wxPropertyGrid rows
- wxListBox items
- wxSpinButton arrows
- wxSlider thumb/track
- wxTextCtrl area
- wxSearchCtrl field
- wxAuiManager pane content areas
- wxCalendarCtrl dates

Test migrations:
- 24 test files updated to use element registry helpers
- Replaced coordinate-based clicks with semantic selectors
- Added find-hardcoded-coords.sh script for auditing

Remaining coordinates are legitimate (scroll positioning, drawing, test.fail blocks).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Viktor Vaczi 2025-12-30 14:17:51 +01:00
commit 64142aa8de
27 changed files with 1710 additions and 839 deletions

View file

@ -1,5 +1,6 @@
// wxGrid Custom Cell Renderers Tests - Color cells, icon+text, striped rows
import { test, expect, tryLoadApp } from './utils/fixtures';
import { clickTab, clickGridCell } from './utils/element-tracker';
test.describe('wxGrid Custom Cell Renderers Tests', () => {
@ -37,13 +38,10 @@ test.describe('wxGrid Custom Cell Renderers Tests', () => {
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);
}
// Click Icon+Text tab using element registry
const clicked = await clickTab(page, 'Icon+Text');
expect(clicked, 'Icon+Text tab should be found').toBe(true);
await page.waitForTimeout(200);
await page.screenshot({ path: 'test-results/gridrenderers-03-icon-text.png', fullPage: true });
});
@ -58,13 +56,10 @@ test.describe('wxGrid Custom Cell Renderers Tests', () => {
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);
}
// Click Striped+Checkboxes tab using element registry
const clicked = await clickTab(page, 'Striped+Checkboxes');
expect(clicked, 'Striped+Checkboxes tab should be found').toBe(true);
await page.waitForTimeout(200);
await page.screenshot({ path: 'test-results/gridrenderers-04-striped.png', fullPage: true });
});
@ -79,17 +74,15 @@ test.describe('wxGrid Custom Cell Renderers Tests', () => {
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);
// 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);
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);
}
// 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);
await page.waitForTimeout(200);
await page.screenshot({ path: 'test-results/gridrenderers-05-checkbox-toggle.png', fullPage: true });
});