从收藏跳转并定位私聊和群聊原消息

This commit is contained in:
xhgit committed 2026-11-15 23:02:52 +08:00
1 parent f923b0ca7b
commit 7717120bac
11 files changed
+150 -22

No files matched your search

+8
View File
@@ -435,6 +435,14 @@ test('Web 与 Windows 安全码校验、加密互发、离线接收和状态恢
web.off('request', trackFavorites)
assert.ok(tracked.every(([url, method, body]) => method === 'GET' && !body &&
!url.includes(encodeURIComponent(marker)) && !url.includes(encodeURIComponent('验收资料'))))
const originalLink = webFavorites.getByRole('link', { name: '查看原消息', exact: true })
assert.ok(!(await originalLink.getAttribute('href')).includes('healthz'))
await originalLink.click()
const locatedPrivate = web.getByRole('list', { name: '消息记录' }).locator('li[aria-current="true"]')
await locatedPrivate.getByRole('link', { name: link, exact: true }).waitFor()
await locatedPrivate.evaluate((row) => {
if (document.activeElement !== row) throw new Error('私聊原消息未获得焦点')
})
await windows.getByLabel('内容类型').selectOption('image')
await windowsFavorites.getByRole('button', { name: '预览 加密预览.png', exact: true }).click()
+11
View File
@@ -626,7 +626,9 @@ test('Windows 与 Web 加密群聊支持消息操作、附件、语音和成员
await windows.getByRole('heading', { name: pendingGroup }).waitFor()
await work(windows).getByRole('link', { name: '消息', exact: true }).click()
await windows.getByRole('link', { name: names[0] }).click()
await windows.waitForURL(/#\/chat\/[0-9a-f-]+$/)
await windows.getByRole('button', { name: '启用本机加密聊天' }).click()
await windows.getByText('设备已验证', { exact: true }).waitFor()
const privateFile = '私聊文件-' + id() + '.txt'
const privateAttachments = windows.getByRole('region', { name: '私聊附件发送区' })
await privateAttachments.locator('input:enabled').setInputFiles({ name: privateFile, mimeType: 'text/plain', buffer: contents })
@@ -728,7 +730,16 @@ test('Windows 与 Web 加密群聊支持消息操作、附件、语音和成员
await windows.getByLabel('来源', { exact: true }).selectOption('group')
assert.equal(await downloads.count(), 1)
await collection.getByText(new RegExp(targetGroup)).waitFor()
await collection.getByRole('link', { name: '查看原消息', exact: true }).click()
const locatedGroup = chat(windows).getByRole('list', { name: '群消息记录' }).locator('li[aria-current="true"]')
await locatedGroup.getByRole('button', { name: '下载 ' + privateFile, exact: true }).waitFor()
await locatedGroup.evaluate((row) => {
if (document.activeElement !== row) throw new Error('群聊原消息未获得焦点')
})
await work(windows).getByRole('link', { name: '收藏', exact: true }).click()
await windows.getByRole('searchbox', { name: '搜索本机收藏' }).fill(privateFile)
await windows.getByLabel('来源', { exact: true }).selectOption('private')
await downloads.waitFor()
assert.equal(await downloads.count(), 1)
} catch (error) {
const status = await Promise.all(pages.map((page) => page.locator('[role=alert], .group-chat [role=status]').allTextContents()))