@@ -99,13 +99,23 @@ export class TestControllerManager {
99
99
) {
100
100
this . testController = vscode . tests . createTestController ( "robotCode.RobotFramework" , "RobotFramework" ) ;
101
101
102
+ this . testController . resolveHandler = async ( item ) => {
103
+ await this . refresh ( item ) ;
104
+ } ;
105
+
106
+ this . testController . refreshHandler = async ( token ) => {
107
+ await this . refreshWorkspace ( undefined , undefined , token ) ;
108
+ } ;
109
+
102
110
this . runProfile = this . testController . createRunProfile (
103
111
"Run" ,
104
112
vscode . TestRunProfileKind . Run ,
105
113
async ( request , token ) => this . runTests ( request , token ) ,
106
114
true
107
115
) ;
108
116
117
+ this . runProfile . configureHandler = ( ) => this . configureRunProfile ( ) ;
118
+
109
119
this . dryRunProfile = this . testController . createRunProfile (
110
120
"Dry Run" ,
111
121
vscode . TestRunProfileKind . Run ,
@@ -120,17 +130,15 @@ export class TestControllerManager {
120
130
true
121
131
) ;
122
132
133
+ this . debugProfile . configureHandler = ( ) => this . configureRunProfile ( ) ;
134
+
123
135
this . dryRunDebugProfile = this . testController . createRunProfile (
124
136
"Dry Debug" ,
125
137
vscode . TestRunProfileKind . Debug ,
126
138
async ( request , token ) => this . runTests ( request , token , true ) ,
127
139
false
128
140
) ;
129
141
130
- this . testController . resolveHandler = async ( item ) => {
131
- await this . refresh ( item ) ;
132
- } ;
133
-
134
142
const fileWatcher = vscode . workspace . createFileSystemWatcher ( "**/*.{robot,resource}" ) ;
135
143
fileWatcher . onDidCreate ( ( uri ) => this . refreshUri ( uri , "create" ) ) ;
136
144
fileWatcher . onDidDelete ( ( uri ) => this . refreshUri ( uri , "delete" ) ) ;
@@ -221,6 +229,33 @@ export class TestControllerManager {
221
229
) ;
222
230
}
223
231
232
+ // eslint-disable-next-line class-methods-use-this
233
+ private configureRunProfile ( ) {
234
+ vscode . window
235
+ . showQuickPick (
236
+ [
237
+ { label : "Chrome" , picked : true , description : "Run Tests with Chrome browser" } ,
238
+ { label : "Firefox" , picked : false , description : "Run Tests with Firefox browser" } ,
239
+ { label : "TestDB" , picked : false , description : "Run Tests on Test Database" } ,
240
+ { label : "ProdDB" , picked : false , description : "Run Tests on Production Database" } ,
241
+ { label : "NoHeadless" , picked : false , description : "Do not run in headless mode" } ,
242
+ ] ,
243
+ {
244
+ title : "Select Execution Profile (Teaser: comming soon...)" ,
245
+ canPickMany : true ,
246
+ }
247
+ )
248
+ . then (
249
+ ( result ) => {
250
+ vscode . window . showInformationMessage ( `Selected: ${ result ?. map ( ( v ) => v . label ) . join ( ", " ) || "<None>" } ` ) . then (
251
+ ( ) => undefined ,
252
+ ( ) => undefined
253
+ ) ;
254
+ } ,
255
+ ( ) => undefined
256
+ ) ;
257
+ }
258
+
224
259
private removeWorkspaceFolderItems ( folder : vscode . WorkspaceFolder ) {
225
260
if ( this . robotTestItems . has ( folder ) ) {
226
261
const robotItems = this . robotTestItems . get ( folder ) ?. items ;
0 commit comments