@@ -118,7 +118,6 @@ export type WaitForTextCommandOptions = WaitCommandContext &
118118type SelectorWaitRuntime = {
119119 backend : {
120120 platform : PublicPlatform ;
121- findText ?: ( context : WaitCommandContext , text : string ) => Promise < { found : boolean } > ;
122121 } ;
123122 clock ?: {
124123 now ( ) : number ;
@@ -364,11 +363,9 @@ async function waitForText<Runtime extends SelectorWaitRuntime>(
364363 const polling = createWaitPolling ( runtime , options , timeoutMs , SELECTOR_PIPELINE_POLICIES . wait ) ;
365364 let deadline : WaitPollDeadline | undefined ;
366365 while ( polling . hasTimeRemaining ( ) ) {
367- const poll = await polling . capture ( async ( signal ) =>
368- runtime . backend . findText
369- ? ( await runtime . backend . findText ( backendContext ( runtime , { ...options , signal } ) , text ) )
370- . found
371- : await snapshotContainsText ( operations , runtime , { ...options , signal } , text ) ,
366+ const poll = await polling . capture (
367+ async ( signal ) =>
368+ await snapshotContainsText ( operations , runtime , { ...options , signal } , text ) ,
372369 ) ;
373370 if ( poll . timedOut ) {
374371 deadline = poll . deadline ;
@@ -436,15 +433,3 @@ async function waitForStable<Runtime extends SelectorWaitRuntime>(
436433 : { } ) ,
437434 } ;
438435}
439-
440- function backendContext (
441- runtime : SelectorWaitRuntime ,
442- options : WaitCommandContext ,
443- ) : WaitCommandContext {
444- return {
445- session : options . session ,
446- requestId : options . requestId ,
447- signal : options . signal ?? runtime . signal ,
448- metadata : options . metadata ,
449- } ;
450- }
0 commit comments