@@ -56,6 +56,7 @@ import * as fs from 'node:fs';
56
56
import * as path from 'node:path' ;
57
57
import { fileURLToPath } from 'node:url' ;
58
58
import type { AILabTryInstructLabPage } from './model/ai-lab-try-instructlab-page' ;
59
+ import type { AiLlamaStackPage } from './model/ai-lab-model-llamastack-page' ;
59
60
60
61
const AI_LAB_EXTENSION_OCI_IMAGE =
61
62
process . env . EXTENSION_OCI_IMAGE ?? 'ghcr.io/containers/podman-desktop-extension-ai-lab:nightly' ;
@@ -188,6 +189,79 @@ test.describe.serial(`AI Lab extension installation and verification`, () => {
188
189
) ;
189
190
} ) ;
190
191
192
+ test . describe . serial ( `Start Llama Stack from sidebar and verify containers` , { tag : '@smoke' } , ( ) => {
193
+ let llamaStackPage : AiLlamaStackPage ;
194
+ const llamaStackContainerNames : string [ ] = [ ] ;
195
+
196
+ test . beforeAll ( `Open Llama Stack` , async ( { runner, page, navigationBar } ) => {
197
+ aiLabPage = await reopenAILabDashboard ( runner , page , navigationBar ) ;
198
+ await aiLabPage . navigationBar . waitForLoad ( ) ;
199
+ llamaStackPage = await aiLabPage . navigationBar . openLlamaStack ( ) ;
200
+ await llamaStackPage . waitForLoad ( ) ;
201
+ } ) ;
202
+
203
+ test ( `Start Llama Stack containers` , async ( ) => {
204
+ test . setTimeout ( 300_000 ) ;
205
+ await llamaStackPage . waitForLoad ( ) ;
206
+ await llamaStackPage . runLlamaStackContainer ( ) ;
207
+ await playExpect ( llamaStackPage . openLlamaStackContainerButton ) . toBeVisible ( { timeout : 120_000 } ) ;
208
+ await playExpect ( llamaStackPage . exploreLlamaStackEnvironmentButton ) . toBeVisible ( { timeout : 120_000 } ) ;
209
+ await playExpect ( llamaStackPage . openLlamaStackContainerButton ) . toBeEnabled ( { timeout : 30_000 } ) ;
210
+ await playExpect ( llamaStackPage . exploreLlamaStackEnvironmentButton ) . toBeEnabled ( { timeout : 30_000 } ) ;
211
+ } ) ;
212
+
213
+ test ( `Verify Llama Stack containers are running` , async ( { navigationBar } ) => {
214
+ let containersPage = await navigationBar . openContainers ( ) ;
215
+ await playExpect ( containersPage . heading ) . toBeVisible ( ) ;
216
+
217
+ await playExpect
218
+ . poll (
219
+ async ( ) => {
220
+ const allRows = await containersPage . getAllTableRows ( ) ;
221
+ llamaStackContainerNames . length = 0 ;
222
+ for ( const row of allRows ) {
223
+ const text = await row . textContent ( ) ;
224
+ if ( text ?. includes ( 'llama-stack' ) ) {
225
+ const containerNameMatch = RegExp ( / \b ( l l a m a - s t a c k [ ^ \s ] * ) / ) . exec ( text ) ;
226
+ if ( containerNameMatch ) {
227
+ llamaStackContainerNames . push ( containerNameMatch [ 1 ] ) ;
228
+ }
229
+ }
230
+ }
231
+ return llamaStackContainerNames . length ;
232
+ } ,
233
+ {
234
+ timeout : 30_000 ,
235
+ intervals : [ 5_000 ] ,
236
+ } ,
237
+ )
238
+ . toBe ( 2 ) ;
239
+
240
+ console . log ( `Found containers: ${ llamaStackContainerNames . join ( ', ' ) } ` ) ;
241
+
242
+ for ( const container of llamaStackContainerNames ) {
243
+ containersPage = await navigationBar . openContainers ( ) ;
244
+ await playExpect ( containersPage . heading ) . toBeVisible ( ) ;
245
+ const containersDetailsPage = await containersPage . openContainersDetails ( container ) ;
246
+ await playExpect ( containersDetailsPage . heading ) . toBeVisible ( ) ;
247
+ await playExpect
248
+ . poll ( async ( ) => containersDetailsPage . getState ( ) , { timeout : 30_000 } )
249
+ . toContain ( ContainerState . Running ) ;
250
+ }
251
+ } ) ;
252
+
253
+ test . afterAll ( `Stop Llama Stack containers` , async ( { navigationBar } ) => {
254
+ for ( const container of llamaStackContainerNames ) {
255
+ const containersPage = await navigationBar . openContainers ( ) ;
256
+ await playExpect ( containersPage . heading ) . toBeVisible ( ) ;
257
+ await containersPage . deleteContainer ( container ) ;
258
+ await playExpect
259
+ . poll ( async ( ) => await containersPage . containerExists ( container ) , { timeout : 30_000 } )
260
+ . toBeFalsy ( ) ;
261
+ }
262
+ } ) ;
263
+ } ) ;
264
+
191
265
test . describe . serial ( 'AI Lab API endpoint e2e test' , { tag : '@smoke' } , ( ) => {
192
266
let localServerPort : string ;
193
267
let extensionVersion : string | undefined ;
0 commit comments