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,41 @@
|
||||
import { test, expect, AI_REPLY } from '@e2e'
|
||||
|
||||
test.describe('widget chat', () => {
|
||||
test('a customer gets the agent\'s answer @smoke @widget', async ({ agent, widget, llm }) => {
|
||||
await llm.script(agent, (s) => s
|
||||
.when(/opening hours/i).reply('We are open 9am to 5pm, Monday to Friday.')
|
||||
.otherwise().reply('Happy to help!'))
|
||||
|
||||
await widget.embed()
|
||||
await widget.open()
|
||||
await widget.send('What are your opening hours?')
|
||||
|
||||
await expect(widget.lastAgentMessage()).toHaveText('We are open 9am to 5pm, Monday to Friday.', AI_REPLY)
|
||||
})
|
||||
|
||||
test('the conversation is still there after the customer reloads the page @widget', async ({ agent, widget, llm }) => {
|
||||
await llm.script(agent, (s) => s.otherwise().reply('Your order ships tomorrow.'))
|
||||
|
||||
await widget.embed()
|
||||
await widget.open()
|
||||
await widget.send('Where is my order?')
|
||||
await expect(widget.lastAgentMessage()).toHaveText('Your order ships tomorrow.', AI_REPLY)
|
||||
|
||||
await widget.page.reload()
|
||||
await widget.open()
|
||||
await expect(widget.customerMessages.last()).toHaveText('Where is my order?')
|
||||
await expect(widget.lastAgentMessage()).toHaveText('Your order ships tomorrow.', AI_REPLY)
|
||||
})
|
||||
|
||||
test('a visitor whose first authorization went missing can still chat @widget', async ({ agent, widget, llm }) => {
|
||||
await llm.script(agent, (s) => s.otherwise().reply('Happy to help!'))
|
||||
|
||||
// The socket refuses the anonymous token; the widget authorizes again and connects.
|
||||
await widget.loseFirstAuthorization()
|
||||
await widget.embed()
|
||||
await widget.open()
|
||||
await widget.send('Hello?')
|
||||
|
||||
await expect(widget.lastAgentMessage()).toHaveText('Happy to help!', AI_REPLY)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user