Skip to content

Commit c201052

Browse files
committed
fix(regression-test): scope agent task controls
Signed-off-by: kangfenmao <kangfenmao@qq.com>
1 parent 54e577d commit c201052

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/e2e/cherry-regression/agents.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ export async function selectAgent(page: Page, name: string): Promise<void> {
2020
export async function startNewAgentTask(page: Page, name: string): Promise<void> {
2121
await selectAgent(page, name)
2222
const agentView = page.locator('[data-ui="agent.view"]:visible').first()
23-
await agentView.getByText(name, { exact: true }).first().hover()
24-
const newTask = agentView.getByRole('button', { name: 'New task', exact: true }).first()
23+
const agentHeader = agentView.getByRole('button', { name, exact: true }).first()
24+
await agentHeader.hover()
25+
const newTask = agentHeader.locator('..').getByRole('button', { name: 'New task', exact: true })
2526
await expect(newTask).toBeVisible()
26-
await newTask.press('Enter')
27+
await newTask.click()
2728
await expect(page.locator('[data-ui~="chat.message"]:visible')).toHaveCount(0, { timeout: 30_000 })
2829
}
2930

0 commit comments

Comments
 (0)