@@ -27,28 +27,40 @@ 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
+ await playExpect ( this . runtimeInput ) . toBeVisible ( ) ;
54
+ await this . runtimeInput . click ( ) ;
55
+
56
+ // Select the runtime
57
+ await this . runtimeInput . fill ( runtime ) ;
58
+ await this . webview . keyboard . press ( 'Enter' ) ;
59
+
49
60
await playExpect ( this . createPlaygroundButton ) . toBeEnabled ( ) ;
50
61
await this . createPlaygroundButton . click ( ) ;
51
62
await playExpect ( this . createPlaygroundButton ) . not . toBeVisible ( { timeout } ) ;
63
+
52
64
return this ;
53
65
}
54
66
0 commit comments