@@ -12,6 +12,7 @@ import {
1212 assertWaitText ,
1313 capturePng ,
1414 requireAndroidResourceId ,
15+ scrollToVisibleSelector ,
1516} from './live-assertions.ts' ;
1617import { type LiveContext , runStep , verifyBehavior , verifyCommand } from './live-harness.ts' ;
1718
@@ -126,19 +127,24 @@ export async function assertAutomationSystem(context: LiveContext): Promise<void
126127 'fixture automation-window value changed to landscape and back to portrait' ,
127128 ) ;
128129
129- await runStep ( context , 'reveal input canaries' , [ 'scroll' , 'down' , '0.7' ] ) ;
130+ await runStep ( context , 'restore automation route top after rotation' , [ 'scroll' , 'top' ] ) ;
131+ await scrollToVisibleSelector ( context , 'id="automation-press"' ) ;
130132 await runStep ( context , 'press semantic canary' , [ 'press' , 'id="automation-press"' ] ) ;
133+ await scrollToVisibleSelector ( context , 'id="automation-last-input"' ) ;
131134 await assertWaitText ( context , 'Last input: press' ) ;
132135 verifyCommand ( context , C . press , 'semantic press updates durable fixture input state' ) ;
133136
137+ await scrollToVisibleSelector ( context , 'id="automation-longpress"' ) ;
134138 await runStep ( context , 'long press semantic canary' , [
135139 'longpress' ,
136140 'id="automation-longpress"' ,
137141 '800' ,
138142 ] ) ;
143+ await scrollToVisibleSelector ( context , 'id="automation-longpress-count"' ) ;
139144 await assertWaitText ( context , 'Long presses: 1' ) ;
140145 verifyCommand ( context , C . longPress , '800ms hold increments durable fixture long-press counter' ) ;
141146
147+ await scrollToVisibleSelector ( context , 'id="automation-open-alert"' ) ;
142148 await runStep ( context , 'open Android native alert' , [ 'click' , 'id="automation-open-alert"' ] ) ;
143149 await assertWaitText ( context , 'Automation confirmation' ) ;
144150 const alertSnapshot = await runStep ( context , 'capture native alert through persistent helper' , [
@@ -164,6 +170,7 @@ export async function assertAutomationSystem(context: LiveContext): Promise<void
164170 const alert = await runStep ( context , 'inspect Android native alert' , [ 'alert' , 'get' ] ) ;
165171 assertJsonContains ( alert , 'Automation confirmation' , 'alert get should expose fixture dialog' ) ;
166172 await runStep ( context , 'dismiss Android native alert' , [ 'alert' , 'dismiss' ] ) ;
173+ await scrollToVisibleSelector ( context , 'id="automation-alert-result"' ) ;
167174 // The dismissal is confirmed, but the fixture's re-render after the button callback is the
168175 // app's own timing: wait for the outcome, then pin it to the canary element.
169176 await assertWaitText ( context , 'Alert result: cancelled' ) ;
@@ -175,7 +182,7 @@ export async function assertAutomationSystem(context: LiveContext): Promise<void
175182 verifyCommand ( context , C . alert , 'alert wait/get/dismiss/accept produce fixture-visible results' ) ;
176183
177184 await assertHomeAndRecentsRestoration ( context ) ;
178- await runStep ( context , 'reveal Android alert canary for diff baseline' , [ 'scroll' , 'down' , '1' ] ) ;
185+ await scrollToVisibleSelector ( context , 'id="automation-open- alert"' ) ;
179186 await runStep ( context , 'establish automation diff baseline' , [ 'snapshot' , '-i' ] ) ;
180187 await runStep ( context , 'return from automation route with Back' , [ 'back' ] ) ;
181188 const diff = await runStep ( context , 'observe automation-to-settings diff' , [
0 commit comments