import { Page } from '@playwright/test'; export class GalaxyHelper { constructor(private page: Page) {} async waitForGalaxyLoad() { // Wait for canvas to be visible await this.page.waitForSelector('canvas', { timeout: 10000 }); // Give R3F time to render await this.page.waitForTimeout(2000); } async clickNode(nodeId: string) { // Simulate node click via JavaScript event await this.page.evaluate((id) => { const event = new CustomEvent('node-click', { detail: { nodeId: id } }); window.dispatchEvent(event); }, nodeId); } async getNodeCount() { return await this.page.evaluate(() => { // Access window globals set by galaxy component return (window as any).__galaxyNodes?.length || 0; }); } }