@@ -33,6 +33,7 @@ export interface IDriver {
3333 getTitle ( windowId : number ) : TPromise < string > ;
3434 isActiveElement ( windowId : number , selector : string ) : TPromise < boolean > ;
3535 getElements ( windowId : number , selector : string , recursive : boolean ) : TPromise < IElement [ ] > ;
36+ typeInEditor ( windowId : number , selector : string , text : string ) : TPromise < void > ;
3637 selectorExecute < P > ( windowId : number , selector : string , script : ( elements : HTMLElement [ ] , ...args : any [ ] ) => P , ...args : any [ ] ) : TPromise < P > ;
3738}
3839//*END
@@ -47,6 +48,7 @@ export interface IDriverChannel extends IChannel {
4748 call ( command : 'getTitle' , arg : [ number ] ) : TPromise < string > ;
4849 call ( command : 'isActiveElement' , arg : [ number , string ] ) : TPromise < boolean > ;
4950 call ( command : 'getElements' , arg : [ number , string , boolean ] ) : TPromise < IElement [ ] > ;
51+ call ( command : 'typeInEditor' , arg : [ number , string , string ] ) : TPromise < void > ;
5052 call ( command : 'selectorExecute' , arg : [ number , string , string , any [ ] ] ) : TPromise < any > ;
5153 call ( command : string , arg : any ) : TPromise < any > ;
5254}
@@ -66,6 +68,7 @@ export class DriverChannel implements IDriverChannel {
6668 case 'getTitle' : return this . driver . getTitle ( arg [ 0 ] ) ;
6769 case 'isActiveElement' : return this . driver . isActiveElement ( arg [ 0 ] , arg [ 1 ] ) ;
6870 case 'getElements' : return this . driver . getElements ( arg [ 0 ] , arg [ 1 ] , arg [ 2 ] ) ;
71+ case 'typeInEditor' : return this . driver . typeInEditor ( arg [ 0 ] , arg [ 1 ] , arg [ 2 ] ) ;
6972
7073 // TODO@joao
7174 case 'selectorExecute' : return this . driver . selectorExecute ( arg [ 0 ] , arg [ 1 ] , arg [ 1 ] , ...arg [ 2 ] ) ;
@@ -117,6 +120,10 @@ export class DriverChannelClient implements IDriver {
117120 return this . channel . call ( 'getElements' , [ windowId , selector , recursive ] ) ;
118121 }
119122
123+ typeInEditor ( windowId : number , selector : string , text : string ) : TPromise < void > {
124+ return this . channel . call ( 'typeInEditor' , [ windowId , selector , text ] ) ;
125+ }
126+
120127 selectorExecute < P > ( windowId : number , selector : string , script : ( elements : HTMLElement [ ] , ...args : any [ ] ) => P , ...args : any [ ] ) : TPromise < P > {
121128 // TODO@joao
122129 return this . channel . call ( 'selectorExecute' , [ windowId , selector , script . toString ( ) , args ] ) ;
@@ -164,6 +171,7 @@ export interface IWindowDriver {
164171 getTitle ( ) : TPromise < string > ;
165172 isActiveElement ( selector : string ) : TPromise < boolean > ;
166173 getElements ( selector : string , recursive : boolean ) : TPromise < IElement [ ] > ;
174+ typeInEditor ( selector : string , text : string ) : TPromise < void > ;
167175 selectorExecute < P > ( selector : string , script : ( elements : HTMLElement [ ] , ...args : any [ ] ) => P , ...args : any [ ] ) : TPromise < P > ;
168176}
169177
@@ -175,6 +183,7 @@ export interface IWindowDriverChannel extends IChannel {
175183 call ( command : 'getTitle' ) : TPromise < string > ;
176184 call ( command : 'isActiveElement' , arg : string ) : TPromise < boolean > ;
177185 call ( command : 'getElements' , arg : [ string , boolean ] ) : TPromise < IElement [ ] > ;
186+ call ( command : 'typeInEditor' , arg : [ string , string ] ) : TPromise < void > ;
178187 call ( command : 'selectorExecute' , arg : [ string , string , any [ ] ] ) : TPromise < any > ;
179188 call ( command : string , arg : any ) : TPromise < any > ;
180189}
@@ -192,6 +201,7 @@ export class WindowDriverChannel implements IWindowDriverChannel {
192201 case 'getTitle' : return this . driver . getTitle ( ) ;
193202 case 'isActiveElement' : return this . driver . isActiveElement ( arg ) ;
194203 case 'getElements' : return this . driver . getElements ( arg [ 0 ] , arg [ 1 ] ) ;
204+ case 'typeInEditor' : return this . driver . typeInEditor ( arg [ 0 ] , arg [ 1 ] ) ;
195205 // TODO@joao
196206 case 'selectorExecute' : return this . driver . selectorExecute ( arg [ 0 ] , arg [ 1 ] , ...arg [ 2 ] ) ;
197207 }
@@ -234,6 +244,10 @@ export class WindowDriverChannelClient implements IWindowDriver {
234244 return this . channel . call ( 'getElements' , [ selector , recursive ] ) ;
235245 }
236246
247+ typeInEditor ( selector : string , text : string ) : TPromise < void > {
248+ return this . channel . call ( 'typeInEditor' , [ selector , text ] ) ;
249+ }
250+
237251 selectorExecute < P > ( selector : string , script : ( elements : HTMLElement [ ] , ...args : any [ ] ) => P , ...args : any [ ] ) : TPromise < P > {
238252 // TODO@joao
239253 return this . channel . call ( 'selectorExecute' , [ selector , script . toString ( ) , args ] ) ;
0 commit comments