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>
This commit is contained in:
parent
2ecb79996d
commit
251056e506
42 changed files with 241 additions and 1138 deletions
|
|
@ -363,6 +363,48 @@ export async function findRenderedByType(
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find rendered element by tooltip
|
||||
*/
|
||||
export async function findByTooltip(
|
||||
page: Page,
|
||||
tooltip: string,
|
||||
options: RenderedFindOptions = {}
|
||||
): Promise<WxRenderedElement | null> {
|
||||
const elements = await page.evaluate(
|
||||
([tooltip, opts]: [string, RenderedFindOptions]) => {
|
||||
const registry = window.wxElementRegistry;
|
||||
if (!registry || !registry.findAllRendered) return [];
|
||||
// Find all rendered elements and filter by tooltip
|
||||
const all = registry.findAllRendered(opts);
|
||||
return all.filter(e => e.tooltip && e.tooltip.includes(tooltip));
|
||||
},
|
||||
[tooltip, options] as [string, RenderedFindOptions]
|
||||
);
|
||||
return elements.length > 0 ? elements[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Click on a rendered element by tooltip
|
||||
*/
|
||||
export async function clickByTooltip(
|
||||
page: Page,
|
||||
tooltip: string,
|
||||
options: RenderedFindOptions = {}
|
||||
): Promise<boolean> {
|
||||
const element = await findByTooltip(page, tooltip, options);
|
||||
if (!element) {
|
||||
console.warn(`Element with tooltip "${tooltip}" not found`);
|
||||
return false;
|
||||
}
|
||||
if (!element.enabled) {
|
||||
console.warn(`Element with tooltip "${tooltip}" is disabled`);
|
||||
return false;
|
||||
}
|
||||
await page.mouse.click(element.centerX, element.centerY);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Click on a toolbar tool by label or tooltip
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue