File tree Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -24,3 +24,6 @@ Thumbs.db
2424
2525#  Generated files
2626* .d.ts 
27+ 
28+ #  Documents
29+ src /tools /documentation /uploads /documents.json 
Original file line number Diff line number Diff line change @@ -136,6 +136,13 @@ Upload a mobile app to LambdaTest cloud storage for testing.
136136  -  ` appPath ` : Local path to the app file (APK/IPA)
137137  -  ` appName ` : Optional custom name for the app
138138
139+ #### ` activate_app `  
140+ 
141+ Activate the app passed as input
142+ 
143+ -  ** Parameters** :
144+   -  ` id ` : Bundle ID or app-packge
145+ 
139146### Element Interaction  
140147
141148#### ` generate_locators `  
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import setValue from './interactions/setValue.js';
1111import  getText  from  './interactions/getText.js' ; 
1212import  screenshot  from  './interactions/screenshot.js' ; 
1313import  answerAppium  from  './answerAppium.js' ; 
14+ import  activateApp  from  './interactions/activateApp.js' ; 
1415
1516export  default  function  registerTools ( server : FastMCP ) : void { 
1617  selectPlatform ( server ) ; 
@@ -25,6 +26,7 @@ export default function registerTools(server: FastMCP): void {
2526  setValue ( server ) ; 
2627  getText ( server ) ; 
2728  screenshot ( server ) ; 
29+   activateApp ( server ) ; 
2830
2931  generateTest ( server ) ; 
3032  console . log ( 'All tools registered' ) ; 
Original file line number Diff line number Diff line change 1+ import  {  FastMCP  }  from  'fastmcp/dist/FastMCP.js' ; 
2+ import  {  getDriver  }  from  '../sessionStore.js' ; 
3+ import  {  z  }  from  'zod' ; 
4+ 
5+ export  default  function  activateApp ( server : FastMCP ) : void { 
6+   const  activateAppSchema  =  z . object ( { 
7+     id : z . string ( ) . describe ( 'The app id' ) , 
8+   } ) ; 
9+ 
10+   server . addTool ( { 
11+     name : 'activate_app' , 
12+     description : 'Activate app by id' , 
13+     parameters : activateAppSchema , 
14+     annotations : { 
15+       readOnlyHint : false , 
16+       openWorldHint : false , 
17+     } , 
18+     execute : async  ( args : {  id : string  } ,  context : any ) : Promise < any >  =>  { 
19+       const  driver  =  getDriver ( ) ; 
20+       if  ( ! driver )  { 
21+         throw  new  Error ( 'No driver found' ) ; 
22+       } 
23+ 
24+       try  { 
25+         await  driver . activateApp ( args . id ) ; 
26+         return  { 
27+           content : [ 
28+             { 
29+               type : 'text' , 
30+               text : `App ${ args . id }  , 
31+             } , 
32+           ] , 
33+         } ; 
34+       }  catch  ( err : any )  { 
35+         return  { 
36+           content : [ 
37+             { 
38+               type : 'text' , 
39+               text : `Error activating the app ${ args . id } ${ err . toString ( ) }  , 
40+             } , 
41+           ] , 
42+         } ; 
43+       } 
44+     } , 
45+   } ) ; 
46+ } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments