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:
parent
04eebab024
commit
64142aa8de
27 changed files with 1710 additions and 839 deletions
|
|
@ -1,5 +1,6 @@
|
|||
// wxListCtrl Virtual Mode Tests - Large list handling for KiCad
|
||||
import { test, expect, tryLoadApp } from './utils/fixtures';
|
||||
import { clickByLabel, clickListItemByIndex } from './utils/element-tracker';
|
||||
|
||||
test.describe('wxListCtrl Virtual Mode Tests', () => {
|
||||
|
||||
|
|
@ -55,15 +56,11 @@ test.describe('wxListCtrl Virtual Mode Tests', () => {
|
|||
return;
|
||||
}
|
||||
|
||||
const canvas = page.locator('#canvas');
|
||||
const box = await canvas.boundingBox();
|
||||
if (!box) {
|
||||
test.skip();
|
||||
return;
|
||||
}
|
||||
await page.waitForTimeout(300);
|
||||
|
||||
// Click on a list item
|
||||
await page.mouse.click(box.x + 300, box.y + 300);
|
||||
// Click on a list item using element registry (item at index 5)
|
||||
const clicked = await clickListItemByIndex(page, 5);
|
||||
expect(clicked, 'List item should be found and clicked').toBe(true);
|
||||
await page.waitForTimeout(200);
|
||||
|
||||
await page.screenshot({ path: 'test-results/listctrl-04-selected.png', fullPage: true });
|
||||
|
|
@ -82,15 +79,11 @@ test.describe('wxListCtrl Virtual Mode Tests', () => {
|
|||
return;
|
||||
}
|
||||
|
||||
const canvas = page.locator('#canvas');
|
||||
const box = await canvas.boundingBox();
|
||||
if (!box) {
|
||||
test.skip();
|
||||
return;
|
||||
}
|
||||
await page.waitForTimeout(300);
|
||||
|
||||
// Click the "Bottom" button (approximate position)
|
||||
await page.mouse.click(box.x + 550, box.y + 90);
|
||||
// Click the "Bottom" button using element registry
|
||||
const clicked = await clickByLabel(page, 'Bottom');
|
||||
expect(clicked, 'Bottom button should be found').toBe(true);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.screenshot({ path: 'test-results/listctrl-05-scrolled.png', fullPage: true });
|
||||
|
|
|
|||
Loading…
Reference in a new issue