fix test flow
This commit is contained in:
@@ -25,6 +25,11 @@ export default defineConfig({
|
||||
url: "http://localhost:52415/node_id",
|
||||
reuseExistingServer: !process.env.CI,
|
||||
timeout: 300000, // 5 minutes - CI needs time to install dependencies
|
||||
env: {
|
||||
...process.env,
|
||||
// Ensure macmon and system tools are accessible
|
||||
PATH: `/usr/sbin:/usr/bin:/opt/homebrew/bin:${process.env.PATH}`,
|
||||
},
|
||||
},
|
||||
expect: {
|
||||
toHaveScreenshot: {
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
waitForChatReady,
|
||||
waitForAssistantMessage,
|
||||
sendChatMessage,
|
||||
selectModelFromLaunchDropdown,
|
||||
} from "../helpers/wait-for-ready";
|
||||
|
||||
test.describe("Chat Message", () => {
|
||||
@@ -14,13 +15,15 @@ test.describe("Chat Message", () => {
|
||||
|
||||
await page.goto("/");
|
||||
await waitForTopologyLoaded(page);
|
||||
|
||||
// First select the model from the dropdown (model cards appear after selection)
|
||||
await selectModelFromLaunchDropdown(page, /qwen.*0\.6b/i);
|
||||
|
||||
// Now wait for model cards to appear
|
||||
await waitForModelCards(page);
|
||||
|
||||
// Find and click on Qwen3-0.6B-4bit model card to launch it
|
||||
const modelCard = page
|
||||
.locator('[data-testid="model-card"]')
|
||||
.filter({ hasText: /qwen.*0\.6b.*4bit/i })
|
||||
.first();
|
||||
// Find and click on the model card (should already be filtered to Qwen)
|
||||
const modelCard = page.locator('[data-testid="model-card"]').first();
|
||||
await expect(modelCard).toBeVisible({ timeout: 10000 });
|
||||
|
||||
// Click the launch button
|
||||
|
||||
@@ -2,19 +2,22 @@ import { test, expect } from "@playwright/test";
|
||||
import {
|
||||
waitForTopologyLoaded,
|
||||
waitForModelCards,
|
||||
selectModelFromLaunchDropdown,
|
||||
} from "../helpers/wait-for-ready";
|
||||
|
||||
test.describe("Launch Instance", () => {
|
||||
test("should launch Qwen3-0.6B-4bit model", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await waitForTopologyLoaded(page);
|
||||
|
||||
// First select the model from the dropdown (model cards appear after selection)
|
||||
await selectModelFromLaunchDropdown(page, /qwen.*0\.6b/i);
|
||||
|
||||
// Now wait for model cards to appear
|
||||
await waitForModelCards(page);
|
||||
|
||||
// Find and click on Qwen3-0.6B-4bit model card
|
||||
const modelCard = page
|
||||
.locator('[data-testid="model-card"]')
|
||||
.filter({ hasText: /qwen.*0\.6b.*4bit/i })
|
||||
.first();
|
||||
// Find and click on the model card (should already be filtered to Qwen)
|
||||
const modelCard = page.locator('[data-testid="model-card"]').first();
|
||||
await expect(modelCard).toBeVisible({ timeout: 10000 });
|
||||
|
||||
// Click the launch button
|
||||
|
||||
@@ -33,6 +33,21 @@ export async function waitForModelCards(page: Page): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function selectModelFromLaunchDropdown(
|
||||
page: Page,
|
||||
modelPattern: RegExp | string,
|
||||
): Promise<void> {
|
||||
// Click the model dropdown in the Launch Instance panel
|
||||
const dropdown = page.locator('button:has-text("SELECT MODEL")');
|
||||
await expect(dropdown).toBeVisible({ timeout: 30000 });
|
||||
await dropdown.click();
|
||||
|
||||
// Wait for dropdown menu to appear and select the model
|
||||
const modelOption = page.locator("button").filter({ hasText: modelPattern });
|
||||
await expect(modelOption.first()).toBeVisible({ timeout: 10000 });
|
||||
await modelOption.first().click();
|
||||
}
|
||||
|
||||
export async function waitForChatReady(page: Page): Promise<void> {
|
||||
await expect(page.locator('[data-testid="chat-input"]')).toBeVisible({
|
||||
timeout: 10000,
|
||||
|
||||
Reference in New Issue
Block a user