docs: 交付文档、维护指引与端到端回归
补齐 README、开发计划、维护交接与 E2E 用例,执行最终验收。
This commit is contained in:
1 parent
18732801b5
commit
6cd904d460
216 files changed
+37038
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { test, expect, expectUnchanged, AI_REPLY } from '@e2e'
|
||||
|
||||
test.describe('human handover', () => {
|
||||
test.use({ agentSettings: { transferToHuman: true } })
|
||||
|
||||
test('a customer asks for a person, the teammate\'s reply reaches them, and the AI stays out of it @smoke @handover', async ({ agent, widget, inbox, llm }) => {
|
||||
await llm.script(agent, (s) => s
|
||||
.when(/human|person/i).handOver('Let me connect you with a teammate.')
|
||||
.otherwise().reply('Happy to help!'))
|
||||
|
||||
await widget.embed()
|
||||
await widget.open()
|
||||
await widget.send('I want to talk to a human')
|
||||
await widget.shareContactDetails()
|
||||
|
||||
await inbox.goto()
|
||||
await inbox.openConversationWith(widget.customer.name)
|
||||
await inbox.takeOver()
|
||||
await inbox.reply('Hi, this is Sam. How can I help?')
|
||||
await expect(widget.lastAgentMessage()).toHaveText('Hi, this is Sam. How can I help?', AI_REPLY)
|
||||
|
||||
const modelCalls = (await llm.requests(agent)).length
|
||||
await widget.send('My parcel never arrived')
|
||||
await expect(inbox.lastCustomerMessage()).toContainText('My parcel never arrived')
|
||||
// A person owns the chat now: the model is not asked, and no bot answer appears.
|
||||
await expectUnchanged('model calls after takeover', async () => (await llm.requests(agent)).length)
|
||||
expect((await llm.requests(agent))).toHaveLength(modelCalls)
|
||||
await expect(widget.lastAgentMessage()).toHaveText('Hi, this is Sam. How can I help?')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user