test(cua): use executor batches in permission flow
This commit is contained in:
1 parent
23357e500d
commit
2cc5d541fb
1 file changed
+4
-4
@@ -56,9 +56,9 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr
|
||||
await scaffold.ctx.settings.mutate('cua', [{ op: 'set', path: ['allowedApps'], value: [] }])
|
||||
// Application consent remains independent of the session's tool-approval policy.
|
||||
const grant = scaffold.ctx.tools.execute({ agent, signal: new AbortController().signal,
|
||||
callId: ToolCallId('cua-app-approval'), name: 'run_code',
|
||||
arguments: { code: 'return await tools.cua({ method: "getApp", params: { selector: "Fixture" } })',
|
||||
description: 'Request application access' } })
|
||||
calls: [{ type: 'tool-call', id: ToolCallId('cua-app-approval'), name: 'run_code',
|
||||
arguments: JSON.stringify({ code: 'return await tools.cua({ method: "getApp", params: { selector: "Fixture" } })',
|
||||
description: 'Request application access' }) }] })
|
||||
const approval = page.locator('[data-question-key]')
|
||||
await Promise.race([approval.waitFor(), grant.then((result) => {
|
||||
throw new Error(`Application selection completed before consent: ${JSON.stringify(result)}`)
|
||||
@@ -66,7 +66,7 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr
|
||||
expect(await approval.textContent()).toContain('Fixture')
|
||||
await approval.getByRole('radio', { name: 'Always allow', exact: true }).click()
|
||||
await approval.getByRole('button', { name: 'Submit', exact: true }).click()
|
||||
expect((await grant).isError).toBe(false)
|
||||
expect((await grant).results).toMatchObject([{ result: { isError: false } }])
|
||||
await approval.waitFor({ state: 'hidden' })
|
||||
await page.getByRole('button', { name: 'Plugins', exact: true }).click()
|
||||
const card = page.locator('[data-plugin-package="@deepseek-ai/dsh-cua-bundle"]')
|
||||
|
||||
Reference in new issue
Block a user