Skip to content

Commit 7c808e3

Browse files
committed
chore: edited e2e test to comply with new runtime selection
Signed-off-by: Brian <[email protected]>
1 parent 05c82b2 commit 7c808e3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/playwright/src/model/ai-lab-playgrounds-page.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,42 @@ export class AILabPlaygroundsPage extends AILabBasePage {
2727
readonly newPlaygroundButton: Locator;
2828
readonly playgroundNameInput: Locator;
2929
readonly createPlaygroundButton: Locator;
30+
readonly runtimeInput: Locator;
3031

3132
constructor(page: Page, webview: Page) {
3233
super(page, webview, 'Playground Environments');
3334
this.additionalActions = this.webview.getByRole('group', { name: 'additionalActions' });
3435
this.newPlaygroundButton = this.additionalActions.getByRole('button', { name: 'New Playground', exact: true });
3536
this.playgroundNameInput = this.webview.getByRole('textbox', { name: 'playgroundName' });
3637
this.createPlaygroundButton = this.webview.getByRole('button', { name: 'Create playground', exact: true });
38+
this.runtimeInput = this.webview.getByLabel('Select Inference Runtime', { exact: true });
3739
}
3840

3941
async waitForLoad(): Promise<void> {
4042
await playExpect(this.heading).toBeVisible();
4143
}
4244

43-
async createNewPlayground(name: string, timeout = 180_000): Promise<this> {
45+
async createNewPlayground(name: string, runtime = 'llama-cpp', timeout = 180_000): Promise<this> {
4446
await playExpect(this.newPlaygroundButton).toBeEnabled();
4547
await this.newPlaygroundButton.click();
48+
4649
await playExpect(this.playgroundNameInput).toBeVisible();
4750
await this.playgroundNameInput.fill(name);
4851
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+
4962
await playExpect(this.createPlaygroundButton).toBeEnabled();
5063
await this.createPlaygroundButton.click();
5164
await playExpect(this.createPlaygroundButton).not.toBeVisible({ timeout });
65+
5266
return this;
5367
}
5468

0 commit comments

Comments
 (0)