|
@@ -75,6 +75,35 @@ const path = require("node:path")
|
|
|
await expect(window.getByRole("button", { name: "智能体", exact: true })).toBeVisible({ timeout: 30000 })
|
|
await expect(window.getByRole("button", { name: "智能体", exact: true })).toBeVisible({ timeout: 30000 })
|
|
|
await window.getByRole("button", { name: "智能体", exact: true }).click()
|
|
await window.getByRole("button", { name: "智能体", exact: true }).click()
|
|
|
await window.getByRole("button", { name: "与 科研助手 对话", exact: true }).click()
|
|
await window.getByRole("button", { name: "与 科研助手 对话", exact: true }).click()
|
|
|
|
|
+ await window.locator(".paas-suggestions button").first().click()
|
|
|
|
|
+ await expect(window.getByRole("textbox", { name: "消息", exact: true })).toBeFocused()
|
|
|
|
|
+ await window.getByRole("textbox", { name: "消息", exact: true }).fill("中文确认不会自动发送")
|
|
|
|
|
+ await window.getByRole("textbox", { name: "消息", exact: true }).dispatchEvent("keydown", {
|
|
|
|
|
+ key: "Enter",
|
|
|
|
|
+ code: "Enter",
|
|
|
|
|
+ keyCode: 229,
|
|
|
|
|
+ bubbles: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ await expect(window.getByRole("textbox", { name: "消息", exact: true })).toHaveValue("中文确认不会自动发送")
|
|
|
|
|
+ if (calls.some((call) => call.path.endsWith("/run/stream"))) throw new Error("IME confirmation submitted research")
|
|
|
|
|
+ await app.evaluate(({ Menu }) => {
|
|
|
|
|
+ const entry = Menu.getApplicationMenu()
|
|
|
|
|
+ .items.flatMap((item) => item.submenu?.items || [])
|
|
|
|
|
+ .find((item) => item.label === "Settings")
|
|
|
|
|
+ entry.click()
|
|
|
|
|
+ })
|
|
|
|
|
+ await expect(window.getByRole("heading", { name: "平台连接", exact: true })).toBeVisible()
|
|
|
|
|
+ await app.evaluate(({ Menu }) => {
|
|
|
|
|
+ const entry = Menu.getApplicationMenu()
|
|
|
|
|
+ .items.flatMap((item) => item.submenu?.items || [])
|
|
|
|
|
+ .find((item) => item.label === "New Session")
|
|
|
|
|
+ entry.click()
|
|
|
|
|
+ })
|
|
|
|
|
+ await expect(window.getByRole("textbox", { name: "消息", exact: true })).toHaveValue("")
|
|
|
|
|
+ await app.evaluate(({ BrowserWindow }) => BrowserWindow.getAllWindows()[0].setSize(587, 800))
|
|
|
|
|
+ await window.getByRole("button", { name: "打开导航", exact: true }).click()
|
|
|
|
|
+ await app.evaluate(({ BrowserWindow }) => BrowserWindow.getAllWindows()[0].setSize(1280, 800))
|
|
|
|
|
+ await expect(window.locator(".paas-nav-open")).toHaveCount(0)
|
|
|
await app.evaluate(
|
|
await app.evaluate(
|
|
|
({ dialog }, { material, saved, report }) => {
|
|
({ dialog }, { material, saved, report }) => {
|
|
|
dialog.showOpenDialog = async () => ({ canceled: false, filePaths: [material] })
|
|
dialog.showOpenDialog = async () => ({ canceled: false, filePaths: [material] })
|
|
@@ -115,6 +144,15 @@ const path = require("node:path")
|
|
|
await expect(window.locator('[data-component="prompt-input"][contenteditable="true"]')).toBeInViewport()
|
|
await expect(window.locator('[data-component="prompt-input"][contenteditable="true"]')).toBeInViewport()
|
|
|
await expect(window.getByText(path.basename(root), { exact: true }).first()).toBeInViewport()
|
|
await expect(window.getByText(path.basename(root), { exact: true }).first()).toBeInViewport()
|
|
|
await window.screenshot({ path: path.join(root, "developer-handoff.png") })
|
|
await window.screenshot({ path: path.join(root, "developer-handoff.png") })
|
|
|
|
|
+ await app.evaluate(({ Menu }) => {
|
|
|
|
|
+ Menu.getApplicationMenu()
|
|
|
|
|
+ .items.flatMap((item) => item.submenu?.items || [])
|
|
|
|
|
+ .find((item) => item.label === "Settings")
|
|
|
|
|
+ .click()
|
|
|
|
|
+ })
|
|
|
|
|
+ await expect(window.getByRole("dialog")).toBeVisible()
|
|
|
|
|
+ await window.keyboard.press("Escape")
|
|
|
|
|
+ await expect(window.getByRole("dialog")).toBeHidden()
|
|
|
await window.getByRole("button", { name: "← 返回科研工作台", exact: true }).click()
|
|
await window.getByRole("button", { name: "← 返回科研工作台", exact: true }).click()
|
|
|
await expect(window.getByRole("textbox", { name: "消息", exact: true })).toHaveValue("Create a research plan")
|
|
await expect(window.getByRole("textbox", { name: "消息", exact: true })).toHaveValue("Create a research plan")
|
|
|
await window.getByRole("textbox", { name: "消息", exact: true }).press("Enter")
|
|
await window.getByRole("textbox", { name: "消息", exact: true }).press("Enter")
|
|
@@ -170,6 +208,21 @@ const path = require("node:path")
|
|
|
throw new Error("Upload bytes mismatch")
|
|
throw new Error("Upload bytes mismatch")
|
|
|
if (errors.length) throw new Error(errors.join("\n"))
|
|
if (errors.length) throw new Error(errors.join("\n"))
|
|
|
await window.screenshot({ path: path.join(root, "native-success.png"), fullPage: true })
|
|
await window.screenshot({ path: path.join(root, "native-success.png"), fullPage: true })
|
|
|
|
|
+ await app.evaluate(({ Menu }) => {
|
|
|
|
|
+ Menu.getApplicationMenu()
|
|
|
|
|
+ .items.flatMap((item) => item.submenu?.items || [])
|
|
|
|
|
+ .find((item) => item.label === "Settings")
|
|
|
|
|
+ .click()
|
|
|
|
|
+ })
|
|
|
|
|
+ await expect(window.getByRole("heading", { name: "平台连接", exact: true })).toBeVisible()
|
|
|
|
|
+ await expect(window.getByRole("button", { name: "← 返回科研工作台", exact: true })).toBeHidden()
|
|
|
|
|
+ await app.evaluate(({ Menu }) => {
|
|
|
|
|
+ Menu.getApplicationMenu()
|
|
|
|
|
+ .items.flatMap((item) => item.submenu?.items || [])
|
|
|
|
|
+ .find((item) => item.label === "New Session")
|
|
|
|
|
+ .click()
|
|
|
|
|
+ })
|
|
|
|
|
+ await expect(window.getByRole("textbox", { name: "消息", exact: true })).toBeVisible()
|
|
|
console.log(
|
|
console.log(
|
|
|
JSON.stringify({
|
|
JSON.stringify({
|
|
|
status: "passed",
|
|
status: "passed",
|