从收藏跳转并定位私聊和群聊原消息
This commit is contained in:
1 parent
f923b0ca7b
commit
7717120bac
11 files changed
+150
-22
No files matched your search
@@ -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()))
|
||||
|
||||
Reference in new issue
Block a user