Commit graph pcbjam/tests/e2e/utils/element-tracker.ts
Author SHA1 Message Date
Viktor Vaczi
251056e506 Clean up test infrastructure and fix test assertions
- Replace test.skip() with proper expect() assertions when app fails to load
- Remove button-finder utility (no longer needed with element registry)
- Remove kicad tests (tested separately)
- Add findByName/clickByName helpers for bitmap buttons
- Fix element lookups: use clickByName for bitmap buttons, clickTreeItem
  for treebook pages, selectComboItem for wxChoice items
- Add SetName() to shape buttons in bitmapbuttons_test.cpp
- Remove verbose logging from print and threadpool tests
- Update README to reflect current test infrastructure

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 20:18:19 +01:00
Viktor Vaczi
64142aa8de 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>
2025-12-30 14:17:51 +01:00
Viktor Vaczi
04eebab024 Migrate tests to use rendered element registry for toolbar, menu, layout, and AUI tests
Update tests to use semantic identifiers instead of hardcoded pixel positions:
- toolbar.spec.ts: Use clickToolbarTool('New') instead of click(box.x + 30, box.y + 45)
- menu.spec.ts: Use clickMenuBarItem('File') instead of click(box.x + 30, box.y + 15)
- layout.spec.ts: Use getSplitterSash() to get actual sash position for drag operations
- aui.spec.ts: Use clickAuiButton('close', 'Properties') for panel button clicks

Also extends element-tracker.ts with:
- WxRenderedElement interface for toolbar tools, menu items, sashes, AUI parts
- findRenderedByLabel(), findRenderedByType() query functions
- clickToolbarTool(), clickMenuBarItem(), getSplitterSash(), clickAuiButton() helpers

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 13:06:54 +01:00
Viktor Vaczi
0a093b918e Add element registry for semantic E2E test automation
Replace hardcoded pixel coordinates with semantic element lookups in tests.
The element registry (added to wxWidgets) tracks all wxWindow instances,
enabling tests to find buttons by label text instead of pixel positions.

Changes:
- Add element-tracker.ts with clickByLabel, findByLabel, findByType, etc.
- Migrate clipboard, dialog, timer, filedialog, logerror tests to use registry
- Update fixtures.ts to export element-tracker utilities
- Update README with element registry documentation
- Update wxwidgets submodule with registry implementation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 12:11:33 +01:00