30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
||
|
||
import {
|
||
THREAD_FOR_WELCOME,
|
||
newChatEntry,
|
||
openChat,
|
||
reuseThreadChatEntry,
|
||
skipIfMissingThread,
|
||
waitForMessageListReady,
|
||
} from "./support/chat-helpers";
|
||
|
||
test.describe("线程路由(无 isnew)", () => {
|
||
test("/new 始终走欢迎态,发送后进入具体 thread 路由", async ({ page }, testInfo) => {
|
||
skipIfMissingThread(testInfo, THREAD_FOR_WELCOME, "FRONTEND_E2E_THREAD_ID");
|
||
|
||
await openChat(page, newChatEntry(THREAD_FOR_WELCOME!));
|
||
await expect(page.getByTestId("welcome-suggestions")).toBeVisible();
|
||
});
|
||
|
||
test("/chats/:thread_id 直接复用并渲染历史", async ({ page }, testInfo) => {
|
||
skipIfMissingThread(testInfo, THREAD_FOR_WELCOME, "FRONTEND_E2E_THREAD_ID");
|
||
|
||
await openChat(page, reuseThreadChatEntry(THREAD_FOR_WELCOME!));
|
||
await waitForMessageListReady(page, { requireMessages: true });
|
||
|
||
await expect(page).toHaveURL(new RegExp(`/workspace/chats/${THREAD_FOR_WELCOME!}`));
|
||
await expect(page.locator(".is-user, .is-assistant").first()).toBeVisible();
|
||
});
|
||
});
|