docs: 交付文档、维护指引与端到端回归
补齐 README、开发计划、维护交接与 E2E 用例,执行最终验收。
This commit is contained in:
1 parent
5be5ca3376
commit
308332eb94
216 files changed
+37038
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { test, expect, env, unique, AI_REPLY } from '@e2e'
|
||||
|
||||
test.describe('attachments', () => {
|
||||
test.use({ agentSettings: { transferToHuman: true, allowAttachments: true } })
|
||||
|
||||
test('a customer sends a file to the teammate, who can open it — and only through a signed link @handover', async ({ agent, widget, inbox, llm, request }) => {
|
||||
await llm.script(agent, (s) => s.otherwise().handOver('Let me connect you with a teammate.'))
|
||||
await widget.embed()
|
||||
await widget.open()
|
||||
await widget.send('I need a person')
|
||||
await widget.shareContactDetails()
|
||||
await inbox.goto()
|
||||
await inbox.openConversationWith(widget.customer.name)
|
||||
await inbox.takeOver()
|
||||
await inbox.reply('Please send me the receipt.')
|
||||
await expect(widget.lastAgentMessage()).toHaveText('Please send me the receipt.', AI_REPLY)
|
||||
|
||||
const content = `Receipt ${unique('R')} — total 42.00`
|
||||
await widget.sendFile({ name: 'receipt.txt', mimeType: 'text/plain', content }, 'Here it is')
|
||||
|
||||
const link = inbox.attachment('receipt.txt')
|
||||
await expect(link).toBeVisible(AI_REPLY)
|
||||
const href = await link.getAttribute('href')
|
||||
expect((await (await inbox.page.request.get(href!)).text())).toBe(content)
|
||||
|
||||
// The stored file is not reachable without the signature.
|
||||
const unsigned = new URL(href!, 'http://x').pathname
|
||||
expect((await request.get(`${env.backendUrl}${unsigned}`)).status()).toBe(403)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user