// sootsim-compatible replacement for kitchen-sink's e2e/utils/navigation.ts // instead of navigating through the UI, we load the test case via URL query param import { by, device, element, waitFor } from './index' const BASE_URL = process.env.RNX_URL || 'http://localhost:5173' /** * navigate to a kitchen-sink test case in sootsim * loads via URL query param instead of tapping through the UI */ export async function navigateToTestCase( testCaseName: string, waitForElementId?: string, ) { const page = device.getPage() // navigate to the test case directly via URL, preserving any params // already on BASE_URL (device=, colorScheme=, etc.) — the conformance // runner sets these via RNX_URL and dropping them silently rendered // pro max at iphone 16 dimensions. const target = new URL(BASE_URL) target.searchParams.set('test', testCaseName) if (target.pathname === '' || target.pathname === '/') target.pathname = '/' const url = target.toString() await page.goto(url, { waitUntil: 'load', timeout: 30000 }) // wait for sootsim engine to initialize await page.waitForFunction( 'window.__sootsimTest && window.__sootsimRoot && window.__sootsimRoot.children.length > 0', { timeout: 30000 }, ) // let rendering settle await page.waitForTimeout(500) // wait for the target element if specified if (waitForElementId) { await waitFor(element(by.id(waitForElementId))) .toExist() .withTimeout(10000) } }