feat: 修改发送消息流程

This commit is contained in:
Wxw-Gu
2026-08-26 11:23:45 +08:00
parent d26af6462f
commit 1e25ae4065
16 changed files with 1746 additions and 823 deletions
+4 -5
View File
@@ -190,11 +190,10 @@ test('CHAT-02 personal WeChat send dialog is keyboard-safe and fits the viewport
await fixture.page.getByText('产品测试群', { exact: true }).click()
const trigger = fixture.page.getByRole('button', { name: '发送消息' })
await trigger.click()
const dialog = fixture.page.getByRole('dialog', { name: '个人微信测试发送' })
const dialog = fixture.page.getByRole('dialog', { name: '产品测试群' })
await expect(dialog).toBeVisible()
await expect(
dialog.locator('.personal-wechat-send-status strong').filter({ hasText: '个人微信已绑定' })
).toBeVisible()
const startSending = dialog.getByRole('button', { name: '开始发送' })
if (await startSending.isVisible()) await startSending.click()
expect(
await fixture.page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)
).toBe(true)
@@ -208,7 +207,7 @@ test('CHAT-02 personal WeChat send dialog is keyboard-safe and fits the viewport
expect(pageErrors).toEqual([])
const imageMode = dialog.getByRole('radio', { name: '图片' })
const voiceMode = dialog.getByRole('radio', { name: '语音' })
const voiceMode = dialog.getByRole('radio', { name: '语音', exact: true })
await imageMode.focus()
await fixture.page.keyboard.press('ArrowRight')
await expect(voiceMode).toBeFocused()
+5 -3
View File
@@ -387,7 +387,7 @@ for (const appearanceTheme of ['light', 'dark'] as const) {
await fixture.setWindowContentSize(visualViewport)
await fixture.page.getByText('产品测试群', { exact: true }).click()
await fixture.page.getByRole('button', { name: '发送消息' }).click()
const dialog = fixture.page.getByRole('dialog', { name: '个人微信测试发送' })
const dialog = fixture.page.getByRole('dialog', { name: '产品测试群' })
await expect(dialog).toBeVisible()
await expect(fixture.page.locator('html')).toHaveAttribute('data-theme', appearanceTheme)
expect(
@@ -406,9 +406,11 @@ for (const appearanceTheme of ['light', 'dark'] as const) {
caret: 'hide'
})
const startSending = dialog.getByRole('button', { name: '开始发送' })
if (await startSending.isVisible()) await startSending.click()
await dialog.getByRole('radio', { name: '语音' }).click()
await expect(dialog.getByRole('textbox', { name: '要生成的文字' })).toBeVisible()
await dialog.locator('footer').scrollIntoViewIfNeeded()
await expect(dialog.getByRole('textbox', { name: '语音文字' })).toBeVisible()
await dialog.locator('.personal-wechat-composer').scrollIntoViewIfNeeded()
await clearScreenshotFocus(fixture.page)
await expect(fixture.page).toHaveScreenshot(
`personal-wechat-voice-controls-${appearanceTheme}.png`,