@@ -27,28 +27,42 @@ export class AILabPlaygroundsPage extends AILabBasePage {
27
27
readonly newPlaygroundButton : Locator ;
28
28
readonly playgroundNameInput : Locator ;
29
29
readonly createPlaygroundButton : Locator ;
30
+ readonly runtimeInput : Locator ;
30
31
31
32
constructor ( page : Page , webview : Page ) {
32
33
super ( page , webview , 'Playground Environments' ) ;
33
34
this . additionalActions = this . webview . getByRole ( 'group' , { name : 'additionalActions' } ) ;
34
35
this . newPlaygroundButton = this . additionalActions . getByRole ( 'button' , { name : 'New Playground' , exact : true } ) ;
35
36
this . playgroundNameInput = this . webview . getByRole ( 'textbox' , { name : 'playgroundName' } ) ;
36
37
this . createPlaygroundButton = this . webview . getByRole ( 'button' , { name : 'Create playground' , exact : true } ) ;
38
+ this . runtimeInput = this . webview . getByLabel ( 'Select Inference Runtime' , { exact : true } ) ;
37
39
}
38
40
39
41
async waitForLoad ( ) : Promise < void > {
40
42
await playExpect ( this . heading ) . toBeVisible ( ) ;
41
43
}
42
44
43
- async createNewPlayground ( name : string , timeout = 180_000 ) : Promise < this> {
45
+ async createNewPlayground ( name : string , runtime = 'llama-cpp' , timeout = 180_000 ) : Promise < this> {
44
46
await playExpect ( this . newPlaygroundButton ) . toBeEnabled ( ) ;
45
47
await this . newPlaygroundButton . click ( ) ;
48
+
46
49
await playExpect ( this . playgroundNameInput ) . toBeVisible ( ) ;
47
50
await this . playgroundNameInput . fill ( name ) ;
48
51
await playExpect ( this . playgroundNameInput ) . toHaveValue ( name ) ;
52
+
53
+ // 🔽 Select inference runtime
54
+ await playExpect ( this . runtimeInput ) . toBeVisible ( ) ;
55
+ await this . runtimeInput . click ( ) ;
56
+
57
+ // Select the runtime option by visible name
58
+ const runtimeOption = this . webview . getByRole ( 'option' , { name : runtime , exact : true } ) ;
59
+ await playExpect ( runtimeOption ) . toBeVisible ( ) ;
60
+ await runtimeOption . click ( ) ;
61
+
49
62
await playExpect ( this . createPlaygroundButton ) . toBeEnabled ( ) ;
50
63
await this . createPlaygroundButton . click ( ) ;
51
64
await playExpect ( this . createPlaygroundButton ) . not . toBeVisible ( { timeout } ) ;
65
+
52
66
return this ;
53
67
}
54
68
0 commit comments