init: 2026Technology-Competition initial commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { test, expect } from '@playwright/test'
|
||||
import { uiLogin } from '../utils/auth'
|
||||
import { createIssueViaApi, deleteIssueViaApi } from '../utils/api-helpers'
|
||||
|
||||
test.describe('Agent SSE 流式渲染', () => {
|
||||
let apiToken = ''
|
||||
let issueId = 0
|
||||
|
||||
test.beforeEach(async ({ page, request }) => {
|
||||
const created = await createIssueViaApi(request)
|
||||
issueId = created.issue.id
|
||||
apiToken = created.token
|
||||
await uiLogin(page)
|
||||
})
|
||||
|
||||
test.afterEach(async ({ request }) => {
|
||||
if (issueId) {
|
||||
await deleteIssueViaApi(request, issueId, apiToken).catch(() => {})
|
||||
}
|
||||
})
|
||||
|
||||
test('执行指令后 SSE 事件实时渲染 thought / prompt_info / model_info', async ({ page }) => {
|
||||
test.setTimeout(120000)
|
||||
await page.goto(`/issues/${issueId}`)
|
||||
await expect(page.getByText('IMS Agent 驾驶舱')).toBeVisible()
|
||||
|
||||
await page.getByPlaceholder(/给 Agent 下达指令/).fill('查找知识库相似案例并生成对应方案')
|
||||
await page.getByRole('button', { name: /执行指令/i }).click()
|
||||
|
||||
// thought:初始连接消息经 SSE 渲染为绿色状态框
|
||||
await expect(page.getByText(/已连接执行流/)).toBeVisible({ timeout: 20000 })
|
||||
|
||||
// model_info:引擎来源 Tag
|
||||
await expect(page.getByText(/引擎:/)).toBeVisible({ timeout: 20000 })
|
||||
|
||||
// prompt_info:展开模板信息,模板标识非"未提供"
|
||||
await page.getByText('Prompt 模板信息').click()
|
||||
await expect(page.getByText(/系统角色:\s*\S+/)).toBeVisible()
|
||||
await expect(page.getByText(/规划模板:\s*\S+/)).toBeVisible()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user