Simplify Agent settings and start conversations directly

This commit is contained in:
鲨鱼辣椒 committed 2026-10-12 19:38:57 +08:00
1 parent f7b1003c4c
commit 0a43ae901f
9 files changed
+402 -102

No files matched your search

@@ -187,20 +187,21 @@ for (const width of [375, 768, 1024, 1440]) {
await expect(tabs.getByRole('tab', { name: '高级设置', exact: true })).toHaveAttribute('aria-selected', 'true');
await expect(advanced.getByRole('navigation')).toHaveCount(0);
await expect(advanced.getByRole('tablist')).toHaveCount(0);
const headings = ['模型', '工具箱(Tool)', '做事手册(Skill)', 'MCP 服务', '子智能体', '知识库', '费用上限', '运行限制'];
const headings = ['模型', '工具箱(Tool)', '做事手册(Skill)', 'MCP 服务', '子智能体', '知识库'];
for (const name of headings) await expect(advanced.getByRole('heading', { name, exact: true })).toBeVisible();
await expect(advanced.getByRole('heading').first()).toHaveText('模型');
await expect(advanced.getByLabel('模型', { exact: true })).toHaveAttribute('required', '');
await expect(advanced.getByText('选它做事时能用的工具。', { exact: true })).toBeVisible();
await expect(advanced.getByText('给它一本手册,照着方法做。', { exact: true })).toBeVisible();
for (const copy of ['选它做事时能用的工具。', '给它一本手册,照着方法做。', '管理我的云端能力']) {
await expect(advanced.getByText(copy, { exact: true })).toHaveCount(0);
}
for (const name of ['费用上限', '运行限制']) await expect(advanced.getByRole('heading', { name, exact: true })).toHaveCount(0);
await expect(advanced.getByLabel('模型', { exact: true })).toBeInViewport();
await expectConfigurationBounds(page);
if (width === 375 || width === 1440) {
await page.screenshot({ path: test.info().outputPath(`agent-advanced-upper-${width}.png`), animations: 'disabled' });
}
await advanced.getByLabel('单次运行时限(秒)', { exact: true }).scrollIntoViewIfNeeded();
await expect(advanced.getByLabel('单次运行时限(秒)', { exact: true })).toBeInViewport();
await expect(advanced.getByLabel('每日上限(词元点数)', { exact: true })).toBeVisible();
await advanced.getByText('管理我的知识文档', { exact: true }).scrollIntoViewIfNeeded();
await expect(advanced.getByText('管理我的知识文档', { exact: true })).toBeInViewport();
await expectConfigurationBounds(page);
if (width === 375 || width === 1440) {
await page.screenshot({ path: test.info().outputPath(`agent-advanced-lower-${width}.png`), animations: 'disabled' });
@@ -213,7 +214,7 @@ for (const width of [375, 768, 1024, 1440]) {
expect(calls.filter(call => call.method === 'PATCH' || call.path === '/api/cloud-agents/avatars/preset'
|| (call.method === 'POST' && call.path === '/api/cloud-agents/agents'))).toEqual([]);
expect(calls.filter(call => call.path === '/api/cloud-agents/actions')
.every(call => ['catalog', 'resources', 'knowledge', 'budget', 'access'].includes(String(call.input?.operation)))).toBe(true);
.every(call => ['catalog', 'knowledge', 'access'].includes(String(call.input?.operation)))).toBe(true);
});
}
+6 -5
View File
@@ -174,11 +174,12 @@ test('personal cloud Agent identity, configuration and separate published chat i
await expect(page.getByRole('button', { name: '确认开始使用', exact: true })).toHaveCount(0);
expect((await fixtureState()).operations).not.toContain('publish');
await page.getByLabel('模型', { exact: true }).selectOption('reasoning-model');
await expect(page.getByText('选它做事时能用的工具。', { exact: true })).toBeVisible();
await expect(page.getByText('给它一本手册,照着方法做。', { exact: true })).toBeVisible();
await expect(page.getByText('选它做事时能用的工具。', { exact: true })).toHaveCount(0);
await expect(page.getByText('给它一本手册,照着方法做。', { exact: true })).toHaveCount(0);
await expect(page.getByText('管理我的云端能力', { exact: true })).toHaveCount(0);
await expect(page.getByRole('group', { name: /^知识库/ })).toBeVisible();
await expect(page.getByRole('heading', { name: '费用上限', exact: true })).toBeVisible();
await expect(page.getByRole('heading', { name: '运行限制', exact: true })).toBeVisible();
await expect(page.getByRole('heading', { name: '费用上限', exact: true })).toHaveCount(0);
await expect(page.getByRole('heading', { name: '运行限制', exact: true })).toHaveCount(0);
await page.getByRole('button', { name: '选择工具箱', exact: true }).click();
await page.getByRole('checkbox', { name: '资料整理工具', exact: true }).check();
await instructionsTab.click();
@@ -225,7 +226,7 @@ test('personal cloud Agent identity, configuration and separate published chat i
await page.screenshot({ path: testInfo.outputPath('cloud-agent-introduction-prompt.png') });
expect(await messageOperations()).toEqual([]);
await page.getByRole('button', { name: '开始使用', exact: true }).click();
await page.getByRole('button', { name: '确认开始使用', exact: true }).click();
await expect(page.getByRole('button', { name: '确认开始使用', exact: true })).toHaveCount(0);
const formalChat = page.getByRole('region', { name: '智能体对话', exact: true });
await expect(formalChat).toBeVisible();
expect((await fixtureState()).operations.filter((operation: string) => operation === 'publish')).toHaveLength(1);