| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import { expect, test } from "@playwright/test"
- test("applications use the shared shell and preserve chat and code drafts", async ({ page }) => {
- await page.goto("/e2e/paas/index.html?unified&agent-groups")
- await expect(page.getByLabel("λ-Agent", { exact: true })).toBeVisible()
- await page.getByRole("button", { name: "代码工作区", exact: true }).click()
- await expect(page.getByLabel("代码草稿")).toBeVisible()
- await page.getByLabel("代码草稿").fill("unsaved code")
- await page.getByRole("button", { name: "应用与插件", exact: true }).click()
- await page.getByRole("button", { name: "连接后使用", exact: true }).click()
- await page.getByLabel("API Key", { exact: true }).fill("unified-test")
- await page.getByRole("button", { name: "连接平台", exact: true }).click()
- await page.getByRole("textbox", { name: "消息", exact: true }).fill("保留当前草稿")
- await page.getByRole("button", { name: "代码工作区", exact: true }).click()
- await expect(page.getByLabel("代码草稿")).toHaveValue("unsaved code")
- await expect(page.getByRole("button", { name: "代码工作区", exact: true })).toHaveAttribute("aria-current", "page")
- await expect(page.getByRole("button", { name: "会话", exact: true })).not.toHaveAttribute("aria-current", "page")
- await page.getByRole("button", { name: "会话", exact: true }).click()
- await expect(page.getByRole("textbox", { name: "消息", exact: true })).toHaveValue("保留当前草稿")
- await page.getByRole("button", { name: "应用与插件", exact: true }).click()
- await expect(page.getByRole("heading", { name: "λ-Scientist", exact: true })).toBeVisible()
- await page.getByRole("button", { name: "开始分析", exact: true }).click()
- await expect(page.getByRole("button", { name: "选择执行角色", exact: true })).toContainText("data67")
- await page.getByRole("textbox", { name: "消息", exact: true }).fill("分析数据")
- await page.getByRole("textbox", { name: "消息", exact: true }).press("Enter")
- await expect
- .poll(() =>
- page.evaluate(
- () =>
- (window as unknown as { paasTestCalls: { action: string; agentID?: string }[] }).paasTestCalls.find(
- (call) => call.action === "execute",
- )?.agentID,
- ),
- )
- .toBe("data67")
- })
- test("code entry receives the selected project's directory", async ({ page }) => {
- await page.goto("/e2e/paas/index.html?unified&workspace")
- await page.getByLabel("API Key", { exact: true }).fill("project-code")
- await page.getByRole("button", { name: "连接平台", exact: true }).click()
- await page.getByRole("button", { name: "项目设置", exact: true }).click()
- await page.getByRole("button", { name: "添加工作文件夹", exact: true }).click()
- await page.getByRole("button", { name: "完成", exact: true }).click()
- await page.getByRole("button", { name: "代码工作区", exact: true }).click()
- await expect(page.getByRole("region", { name: "代码测试区" })).toContainText("D:/Research/optics")
- await expect(page.getByLabel("λ-Agent 工作台导航")).toBeVisible()
- await page.getByRole("button", { name: "应用与插件", exact: true }).click()
- await page.getByRole("button", { name: "进入科研应用", exact: true }).click()
- await expect(page.getByRole("button", { name: "选择执行角色", exact: true })).toContainText("科研助手")
- })
|