|
@@ -223,12 +223,12 @@ test('created roles and editable teams share a durable chat list without plugin
|
|
|
await expect(rail.locator('.sidebar-account-switcher__main')).toContainText('fixture')
|
|
await expect(rail.locator('.sidebar-account-switcher__main')).toContainText('fixture')
|
|
|
await expect(rail.locator('.sidebar-account-switcher__main .account-initial-avatar')).toHaveText('F')
|
|
await expect(rail.locator('.sidebar-account-switcher__main .account-initial-avatar')).toHaveText('F')
|
|
|
await rail.locator('.sidebar-account-switcher__main').click()
|
|
await rail.locator('.sidebar-account-switcher__main').click()
|
|
|
- await expect(page.getByRole('menu', { name: '账号菜单' }).getByRole('menuitem')).toHaveText(['设置', '关于', '检测更新', '帮助', '进入聊天模式'])
|
|
|
|
|
|
|
+ await expect(page.getByRole('menu', { name: '账号菜单' }).getByRole('menuitem')).toHaveText(['我的设置', '关于', '检测更新', '帮助', '进入聊天模式'])
|
|
|
await page.getByRole('menuitem', { name: '关于', exact: true }).click()
|
|
await page.getByRole('menuitem', { name: '关于', exact: true }).click()
|
|
|
const about = page.getByRole('dialog', { name: '关于夭夭 AI', exact: true })
|
|
const about = page.getByRole('dialog', { name: '关于夭夭 AI', exact: true })
|
|
|
await expect(about).toBeVisible()
|
|
await expect(about).toBeVisible()
|
|
|
await expect(about.locator('.about-version')).toHaveText(/^版本 \d+\.\d+\.\d+$/)
|
|
await expect(about.locator('.about-version')).toHaveText(/^版本 \d+\.\d+\.\d+$/)
|
|
|
- await expect(page.getByRole('dialog', { name: '设置中心', exact: true })).toHaveCount(0)
|
|
|
|
|
|
|
+ await expect(page.getByRole('dialog', { name: '我的设置', exact: true })).toHaveCount(0)
|
|
|
await page.screenshot({ path: testInfo.outputPath('independent-about.png') })
|
|
await page.screenshot({ path: testInfo.outputPath('independent-about.png') })
|
|
|
await page.keyboard.press('Escape')
|
|
await page.keyboard.press('Escape')
|
|
|
await expect(about).toHaveCount(0)
|
|
await expect(about).toHaveCount(0)
|
|
@@ -250,29 +250,30 @@ test('created roles and editable teams share a durable chat list without plugin
|
|
|
await page.getByRole('button', { name: '返回聊天', exact: true }).click()
|
|
await page.getByRole('button', { name: '返回聊天', exact: true }).click()
|
|
|
await expect(page).toHaveURL(/\/conversations$/)
|
|
await expect(page).toHaveURL(/\/conversations$/)
|
|
|
await rail.locator('.sidebar-account-switcher__main').click()
|
|
await rail.locator('.sidebar-account-switcher__main').click()
|
|
|
- await page.getByRole('menuitem', { name: '设置', exact: true }).click()
|
|
|
|
|
- const settings = page.getByRole('dialog', { name: '设置中心', exact: true })
|
|
|
|
|
- await expect(settings.locator('.settings-account-summary')).toContainText('fixture')
|
|
|
|
|
- await expect(settings.locator('.settings-account-summary .account-initial-avatar')).toHaveText('F')
|
|
|
|
|
|
|
+ await page.getByRole('menuitem', { name: '我的设置', exact: true }).click()
|
|
|
|
|
+ const settings = page.getByRole('dialog', { name: '我的设置', exact: true })
|
|
|
|
|
+ await settings.getByRole('button', {name:'账号资料',exact:true}).click()
|
|
|
|
|
+ await expect(settings.locator('.account-avatar-card')).toContainText('fixture')
|
|
|
|
|
+ await expect(settings.locator('.account-avatar-card .account-initial-avatar')).toHaveText('F')
|
|
|
await settings.locator('.account-avatar-card input[type=file]').setInputFiles({name:'account.png',mimeType:'image/png',buffer:Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=','base64')})
|
|
await settings.locator('.account-avatar-card input[type=file]').setInputFiles({name:'account.png',mimeType:'image/png',buffer:Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=','base64')})
|
|
|
- await expect(settings.locator('.settings-account-summary .account-initial-avatar img')).toBeVisible()
|
|
|
|
|
|
|
+ await expect(settings.locator('.account-avatar-card .account-initial-avatar img')).toBeVisible()
|
|
|
expect((await (await page.request.get('/api/app/bootstrap')).json()).user.avatar).toMatch(/^data:image\/png;base64,/)
|
|
expect((await (await page.request.get('/api/app/bootstrap')).json()).user.avatar).toMatch(/^data:image\/png;base64,/)
|
|
|
await settings.getByRole('button', {name:'使用首字母',exact:true}).click()
|
|
await settings.getByRole('button', {name:'使用首字母',exact:true}).click()
|
|
|
- await expect(settings.locator('.settings-account-summary .account-initial-avatar')).toHaveText('F')
|
|
|
|
|
|
|
+ await expect(settings.locator('.account-avatar-card .account-initial-avatar')).toHaveText('F')
|
|
|
await settings.getByRole('button', { name: '身份与头像', exact: true }).click()
|
|
await settings.getByRole('button', { name: '身份与头像', exact: true }).click()
|
|
|
await settings.getByRole('button', { name: '造型:星星', exact: true }).click()
|
|
await settings.getByRole('button', { name: '造型:星星', exact: true }).click()
|
|
|
await settings.getByRole('button', { name: '使用颜色 #1488ff', exact: true }).click()
|
|
await settings.getByRole('button', { name: '使用颜色 #1488ff', exact: true }).click()
|
|
|
await settings.locator('.mascot-grid--expression button').filter({ hasText: '开心' }).click()
|
|
await settings.locator('.mascot-grid--expression button').filter({ hasText: '开心' }).click()
|
|
|
await settings.getByRole('button', { name: '保存更改', exact: true }).click()
|
|
await settings.getByRole('button', { name: '保存更改', exact: true }).click()
|
|
|
await expect(settings.getByRole('button', { name: '保存更改', exact: true })).toBeDisabled()
|
|
await expect(settings.getByRole('button', { name: '保存更改', exact: true })).toBeDisabled()
|
|
|
- await settings.getByRole('button', { name: '关闭设置中心', exact: true }).click()
|
|
|
|
|
|
|
+ await settings.getByRole('button', { name: '关闭我的设置', exact: true }).click()
|
|
|
await rail.locator('.sidebar-account-switcher__main').click()
|
|
await rail.locator('.sidebar-account-switcher__main').click()
|
|
|
- await page.getByRole('menuitem', {name:'设置',exact:true}).click()
|
|
|
|
|
|
|
+ await page.getByRole('menuitem', {name:'我的设置',exact:true}).click()
|
|
|
await settings.getByRole('button', { name: '身份与头像', exact: true }).click()
|
|
await settings.getByRole('button', { name: '身份与头像', exact: true }).click()
|
|
|
await expect(settings.getByRole('button', { name: '造型:星星', exact: true })).toHaveAttribute('aria-pressed', 'true')
|
|
await expect(settings.getByRole('button', { name: '造型:星星', exact: true })).toHaveAttribute('aria-pressed', 'true')
|
|
|
await expect(settings.getByRole('button', { name: '使用颜色 #1488ff', exact: true })).toHaveAttribute('aria-pressed', 'true')
|
|
await expect(settings.getByRole('button', { name: '使用颜色 #1488ff', exact: true })).toHaveAttribute('aria-pressed', 'true')
|
|
|
await expect(settings.locator('.mascot-grid--expression button').filter({ hasText: '开心' })).toHaveAttribute('aria-pressed', 'true')
|
|
await expect(settings.locator('.mascot-grid--expression button').filter({ hasText: '开心' })).toHaveAttribute('aria-pressed', 'true')
|
|
|
- await settings.getByRole('button', { name: '关闭设置中心', exact: true }).click()
|
|
|
|
|
|
|
+ await settings.getByRole('button', { name: '关闭我的设置', exact: true }).click()
|
|
|
await expect(rail.getByRole('checkbox', { name: '显示已归档' })).toHaveCount(0)
|
|
await expect(rail.getByRole('checkbox', { name: '显示已归档' })).toHaveCount(0)
|
|
|
const plus = rail.getByRole('button', { name: '新建', exact: true })
|
|
const plus = rail.getByRole('button', { name: '新建', exact: true })
|
|
|
await expect(rail.locator('.sidebar-collapse')).toHaveCount(0)
|
|
await expect(rail.locator('.sidebar-collapse')).toHaveCount(0)
|
|
@@ -287,11 +288,11 @@ test('created roles and editable teams share a durable chat list without plugin
|
|
|
await expect(rail.getByRole('button', { name: '聊天', exact: true })).toHaveCount(0)
|
|
await expect(rail.getByRole('button', { name: '聊天', exact: true })).toHaveCount(0)
|
|
|
await rail.getByRole('button', { name: '设置与模式', exact: true }).click()
|
|
await rail.getByRole('button', { name: '设置与模式', exact: true }).click()
|
|
|
const settingsMenu = page.getByRole('menu', { name: '账号菜单', exact: true })
|
|
const settingsMenu = page.getByRole('menu', { name: '账号菜单', exact: true })
|
|
|
- await expect(settingsMenu.getByRole('menuitem')).toHaveText(['设置', '关于', '检测更新', '帮助', '进入 Bot 模式'])
|
|
|
|
|
|
|
+ await expect(settingsMenu.getByRole('menuitem')).toHaveText(['我的设置', '关于', '检测更新', '帮助', '进入 Bot 模式'])
|
|
|
await page.screenshot({ path: testInfo.outputPath('chat-settings-mode-menu.png') })
|
|
await page.screenshot({ path: testInfo.outputPath('chat-settings-mode-menu.png') })
|
|
|
- await settingsMenu.getByRole('menuitem', { name: '设置', exact: true }).click()
|
|
|
|
|
- await expect(page.getByRole('dialog', { name: '设置中心', exact: true })).toBeVisible()
|
|
|
|
|
- await page.getByRole('button', { name: '关闭设置中心', exact: true }).click()
|
|
|
|
|
|
|
+ await settingsMenu.getByRole('menuitem', { name: '我的设置', exact: true }).click()
|
|
|
|
|
+ await expect(page.getByRole('dialog', { name: '我的设置', exact: true })).toBeVisible()
|
|
|
|
|
+ await page.getByRole('button', { name: '关闭我的设置', exact: true }).click()
|
|
|
await expect(rail.getByRole('button', { name: '设置与模式', exact: true })).toBeFocused()
|
|
await expect(rail.getByRole('button', { name: '设置与模式', exact: true })).toBeFocused()
|
|
|
await rail.getByRole('button', { name: '设置与模式', exact: true }).click()
|
|
await rail.getByRole('button', { name: '设置与模式', exact: true }).click()
|
|
|
await settingsMenu.getByRole('menuitem', { name: '进入 Bot 模式', exact: true }).click()
|
|
await settingsMenu.getByRole('menuitem', { name: '进入 Bot 模式', exact: true }).click()
|
|
@@ -553,8 +554,8 @@ test('created roles and editable teams share a durable chat list without plugin
|
|
|
test('subaccount allocation and Bot-only navigation work through the browser', async ({ page, browser }, testInfo) => {
|
|
test('subaccount allocation and Bot-only navigation work through the browser', async ({ page, browser }, testInfo) => {
|
|
|
await login(page)
|
|
await login(page)
|
|
|
await page.locator('.desktop-sidebar .sidebar-account-switcher__main').click()
|
|
await page.locator('.desktop-sidebar .sidebar-account-switcher__main').click()
|
|
|
- await page.getByRole('menuitem', { name: '设置', exact: true }).click()
|
|
|
|
|
- const settings = page.getByRole('dialog', { name: '设置中心', exact: true })
|
|
|
|
|
|
|
+ await page.getByRole('menuitem', { name: '我的设置', exact: true }).click()
|
|
|
|
|
+ const settings = page.getByRole('dialog', { name: '我的设置', exact: true })
|
|
|
await settings.getByRole('button', { name: '用户与权限', exact: true }).click()
|
|
await settings.getByRole('button', { name: '用户与权限', exact: true }).click()
|
|
|
const username = `child-${Date.now()}`
|
|
const username = `child-${Date.now()}`
|
|
|
await settings.locator('input[name=managed-username]').fill(username)
|
|
await settings.locator('input[name=managed-username]').fill(username)
|
|
@@ -577,7 +578,7 @@ test('subaccount allocation and Bot-only navigation work through the browser', a
|
|
|
await expect(child).toHaveURL(/\/conversations$/)
|
|
await expect(child).toHaveURL(/\/conversations$/)
|
|
|
await expect(child.getByRole('heading', { name: '还没有聊天' })).toBeVisible()
|
|
await expect(child.getByRole('heading', { name: '还没有聊天' })).toBeVisible()
|
|
|
await child.locator('.desktop-sidebar .sidebar-account-switcher__main').click()
|
|
await child.locator('.desktop-sidebar .sidebar-account-switcher__main').click()
|
|
|
- await expect(child.getByRole('menu', { name: '账号菜单' }).getByRole('menuitem')).toHaveText(['设置', '关于', '帮助'])
|
|
|
|
|
|
|
+ await expect(child.getByRole('menu', { name: '账号菜单' }).getByRole('menuitem')).toHaveText(['我的设置', '关于', '帮助'])
|
|
|
await child.keyboard.press('Escape')
|
|
await child.keyboard.press('Escape')
|
|
|
await openCreate(child, '新建 Bot')
|
|
await openCreate(child, '新建 Bot')
|
|
|
const dialog = child.getByRole('dialog')
|
|
const dialog = child.getByRole('dialog')
|