@@ -58,11 +58,11 @@ export const click = definePageTool({
5858 dblClick : dblClickSchema ,
5959 includeSnapshot : includeSnapshotSchema ,
6060 } ,
61- handler : async ( request , response , context ) => {
61+ handler : async ( request , response , _context ) => {
6262 const uid = request . params . uid ;
6363 const handle = await request . page . getElementByUid ( uid ) ;
6464 try {
65- await context . waitForEventsAfterAction ( async ( ) => {
65+ await request . page . waitForEventsAfterAction ( async ( ) => {
6666 await handle . asLocator ( ) . click ( {
6767 count : request . params . dblClick ? 2 : 1 ,
6868 } ) ;
@@ -97,9 +97,9 @@ export const clickAt = definePageTool({
9797 dblClick : dblClickSchema ,
9898 includeSnapshot : includeSnapshotSchema ,
9999 } ,
100- handler : async ( request , response , context ) => {
100+ handler : async ( request , response ) => {
101101 const page = request . page ;
102- await context . waitForEventsAfterAction ( async ( ) => {
102+ await page . waitForEventsAfterAction ( async ( ) => {
103103 await page . pptrPage . mouse . click ( request . params . x , request . params . y , {
104104 clickCount : request . params . dblClick ? 2 : 1 ,
105105 } ) ;
@@ -130,11 +130,11 @@ export const hover = definePageTool({
130130 ) ,
131131 includeSnapshot : includeSnapshotSchema ,
132132 } ,
133- handler : async ( request , response , context ) => {
133+ handler : async ( request , response , _context ) => {
134134 const uid = request . params . uid ;
135135 const handle = await request . page . getElementByUid ( uid ) ;
136136 try {
137- await context . waitForEventsAfterAction ( async ( ) => {
137+ await request . page . waitForEventsAfterAction ( async ( ) => {
138138 await handle . asLocator ( ) . hover ( ) ;
139139 } ) ;
140140 response . appendResponseLine ( `Successfully hovered over the element` ) ;
@@ -235,7 +235,7 @@ export const fill = definePageTool({
235235 } ,
236236 handler : async ( request , response , context ) => {
237237 const page = request . page ;
238- await context . waitForEventsAfterAction ( async ( ) => {
238+ await page . waitForEventsAfterAction ( async ( ) => {
239239 await fillFormElement (
240240 request . params . uid ,
241241 request . params . value ,
@@ -261,9 +261,9 @@ export const typeText = definePageTool({
261261 text : zod . string ( ) . describe ( 'The text to type' ) ,
262262 submitKey : submitKeySchema ,
263263 } ,
264- handler : async ( request , response , context ) => {
264+ handler : async ( request , response ) => {
265265 const page = request . page ;
266- await context . waitForEventsAfterAction ( async ( ) => {
266+ await page . waitForEventsAfterAction ( async ( ) => {
267267 await page . pptrPage . keyboard . type ( request . params . text ) ;
268268 if ( request . params . submitKey ) {
269269 await page . pptrPage . keyboard . press (
@@ -289,13 +289,13 @@ export const drag = definePageTool({
289289 to_uid : zod . string ( ) . describe ( 'The uid of the element to drop into' ) ,
290290 includeSnapshot : includeSnapshotSchema ,
291291 } ,
292- handler : async ( request , response , context ) => {
292+ handler : async ( request , response ) => {
293293 const fromHandle = await request . page . getElementByUid (
294294 request . params . from_uid ,
295295 ) ;
296296 const toHandle = await request . page . getElementByUid ( request . params . to_uid ) ;
297297 try {
298- await context . waitForEventsAfterAction ( async ( ) => {
298+ await request . page . waitForEventsAfterAction ( async ( ) => {
299299 await fromHandle . drag ( toHandle ) ;
300300 await new Promise ( resolve => setTimeout ( resolve , 50 ) ) ;
301301 await toHandle . drop ( fromHandle ) ;
@@ -332,7 +332,7 @@ export const fillForm = definePageTool({
332332 handler : async ( request , response , context ) => {
333333 const page = request . page ;
334334 for ( const element of request . params . elements ) {
335- await context . waitForEventsAfterAction ( async ( ) => {
335+ await page . waitForEventsAfterAction ( async ( ) => {
336336 await fillFormElement (
337337 element . uid ,
338338 element . value ,
@@ -413,12 +413,12 @@ export const pressKey = definePageTool({
413413 ) ,
414414 includeSnapshot : includeSnapshotSchema ,
415415 } ,
416- handler : async ( request , response , context ) => {
416+ handler : async ( request , response ) => {
417417 const page = request . page ;
418418 const tokens = parseKey ( request . params . key ) ;
419419 const [ key , ...modifiers ] = tokens ;
420420
421- await context . waitForEventsAfterAction ( async ( ) => {
421+ await page . waitForEventsAfterAction ( async ( ) => {
422422 for ( const modifier of modifiers ) {
423423 await page . pptrPage . keyboard . down ( modifier ) ;
424424 }
0 commit comments