MCPcopy Index your code
hub / github.com/TanStack/ai / clickGenerate

Function clickGenerate

testing/e2e/tests/helpers.ts:188–203  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

186}
187
188export async function clickGenerate(page: Page) {
189 // Wait for full page load (including hydration scripts)
190 await page.waitForLoadState('networkidle')
191 const btn = page.getByTestId('generate-button')
192 await btn.click()
193 // Verify the click actually triggered React — status should leave 'idle'
194 // If still idle after a short wait, the click missed hydration; retry
195 try {
196 await expect(page.getByTestId('generation-status')).not.toHaveText('idle', {
197 timeout: 3_000,
198 })
199 } catch {
200 // Retry click — hydration likely wasn't complete on first attempt
201 await btn.click()
202 }
203}
204
205export async function waitForGenerationComplete(page: Page, timeout = 30_000) {
206 await expect(page.getByTestId('generation-status')).toHaveText('complete', {

Callers 8

video-gen.spec.tsFile · 0.90
image-gen.spec.tsFile · 0.90
tts.spec.tsFile · 0.90
audio-gen.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected