import { expect, test } from "@playwright/test" test("new research centers the editable composer and suggestions never execute automatically", async ({ page }) => { await page.setViewportSize({ width: 1440, height: 900 }) await page.goto("/e2e/paas/index.html?ux") await page.getByLabel("API Key", { exact: true }).fill("studio-test-only") await page.getByRole("button", { name: "连接平台", exact: true }).click() const input = page.getByRole("textbox", { name: "消息", exact: true }) await expect(input).toBeInViewport() const composer = await page.locator(".paas-composer").boundingBox() const suggestions = await page.getByLabel("任务起点", { exact: true }).boundingBox() expect(composer!.y).toBeLessThan(600) expect(suggestions!.y).toBeGreaterThanOrEqual(composer!.y + composer!.height) await page.getByRole("button", { name: /方案设计.*把研究问题/ }).click() await expect(input).toBeFocused() await expect(input).toHaveValue("围绕我的研究问题,设计可检验的研究方案") expect(await page.evaluate(() => window.paasTestCalls.filter((call) => call.action === "execute").length)).toBe(0) await input.press("Enter") await expect(page.locator(".paas-conversation-empty")).toHaveCount(0) await expect(page.getByLabel("任务起点", { exact: true })).toHaveCount(0) await expect(input).toBeInViewport() }) test("small windows keep writing, agent selection and send reachable", async ({ page }) => { await page.setViewportSize({ width: 520, height: 705 }) await page.goto("/e2e/paas/index.html?ux") await page.getByLabel("API Key", { exact: true }).fill("studio-narrow") await page.getByRole("button", { name: "连接平台", exact: true }).click() await expect(page.getByRole("textbox", { name: "消息", exact: true })).toBeInViewport() await expect(page.getByRole("button", { name: "选择执行角色", exact: true })).toBeInViewport() await expect(page.getByRole("button", { name: "发送消息", exact: true })).toBeInViewport() expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBe(520) })