|
|
@@ -33,7 +33,7 @@ test.describe('LSS管理 CRUD 测试', () => {
|
|
|
|
|
|
test('LSS管理页面正确显示', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 验证页面标题 (Bug #4537: 页面标题从 "LSS 管理" 改为 "LSS 列表")
|
|
|
await expect(page.locator('text=LSS 列表')).toBeVisible()
|
|
|
@@ -54,7 +54,7 @@ test.describe('LSS管理 CRUD 测试', () => {
|
|
|
|
|
|
test('编辑LSS节点 - 修改Name和Address', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -100,7 +100,7 @@ test.describe('LSS管理 CRUD 测试', () => {
|
|
|
|
|
|
test('查询LSS节点', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -128,7 +128,7 @@ test.describe('LSS管理 CRUD 测试', () => {
|
|
|
|
|
|
test('重置搜索条件', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 填入搜索条件
|
|
|
await page.getByPlaceholder('LSS ID').fill('test-id')
|
|
|
@@ -145,7 +145,7 @@ test.describe('LSS管理 CRUD 测试', () => {
|
|
|
|
|
|
test('查看LSS节点设备列表', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -175,7 +175,7 @@ test.describe('LSS管理 CRUD 测试', () => {
|
|
|
await page.getByText('LSS 列表').first().click()
|
|
|
|
|
|
// 验证跳转到 LSS 管理页面
|
|
|
- await expect(page).toHaveURL(/\/lss/)
|
|
|
+ await expect(page).toHaveURL(/\/lss-manage\/list/)
|
|
|
await expect(page.locator('text=LSS 列表')).toBeVisible()
|
|
|
})
|
|
|
})
|
|
|
@@ -203,7 +203,7 @@ test.describe('LSS管理 - CodeEditor 组件测试 (JSON模式)', () => {
|
|
|
*/
|
|
|
test('CodeEditor JSON模式 - 验证头部显示JSON标签和按钮', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -244,7 +244,7 @@ test.describe('LSS管理 - CodeEditor 组件测试 (JSON模式)', () => {
|
|
|
*/
|
|
|
test('CodeEditor JSON模式 - 复制按钮功能', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -280,7 +280,7 @@ test.describe('LSS管理 - CodeEditor 组件测试 (JSON模式)', () => {
|
|
|
*/
|
|
|
test('CodeEditor JSON模式 - 格式化按钮功能', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -319,7 +319,7 @@ test.describe('LSS管理 - CodeEditor 组件测试 (JSON模式)', () => {
|
|
|
*/
|
|
|
test('CodeEditor JSON模式 - 无效JSON显示错误提示', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -363,7 +363,7 @@ test.describe('LSS管理 - CodeEditor 组件测试 (JSON模式)', () => {
|
|
|
*/
|
|
|
test('CodeEditor JSON模式 - 更新参数配置并验证保存成功', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -426,7 +426,7 @@ test.describe('LSS管理 - CodeEditor 组件测试 (JSON模式)', () => {
|
|
|
*/
|
|
|
test('CodeEditor JSON模式 - 更新运行参数并验证保存成功', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -506,7 +506,7 @@ test.describe('LSS管理 - 摄像头列表搜索测试', () => {
|
|
|
|
|
|
// 打开摄像头列表辅助函数
|
|
|
async function openCameraList(page: Page) {
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
await page.waitForTimeout(1000)
|
|
|
|
|
|
// 点击 Device List 按钮打开设备列表 - 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
@@ -832,7 +832,7 @@ test.describe('LSS管理 - 摄像头未创建 Live Stream 对话框测试', () =
|
|
|
|
|
|
// 打开摄像头列表辅助函数
|
|
|
async function openCameraList(page: Page) {
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
await page.waitForTimeout(1000)
|
|
|
|
|
|
// 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
@@ -956,7 +956,7 @@ test.describe('LSS管理 - 摄像头未创建 Live Stream 对话框测试', () =
|
|
|
await expect(messageBox).not.toBeVisible({ timeout: 3000 })
|
|
|
|
|
|
// 验证仍在 LSS 页面
|
|
|
- await expect(page).toHaveURL(/\/lss/)
|
|
|
+ await expect(page).toHaveURL(/\/lss-manage\/list/)
|
|
|
})
|
|
|
|
|
|
/**
|
|
|
@@ -1047,7 +1047,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
*/
|
|
|
test('Bug #4535 - 重置按钮清除所有搜索条件包括排序状态', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -1087,7 +1087,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
*/
|
|
|
test('Bug #4536 - 心跳状态显示为英文格式', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -1108,7 +1108,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
*/
|
|
|
test('Bug #4537 - 页面标题显示为"LSS 列表"', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待页面加载
|
|
|
await page.waitForTimeout(500)
|
|
|
@@ -1127,7 +1127,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
*/
|
|
|
test('Bug #4538 - 分页默认显示15条/页', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -1147,7 +1147,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
*/
|
|
|
test('Bug #4538 - 分页选项包含15条/页选项', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -1178,7 +1178,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
*/
|
|
|
test('Bug #4540 - 查询按钮使用蓝底白字', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待页面加载
|
|
|
await page.waitForTimeout(500)
|
|
|
@@ -1203,7 +1203,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
*/
|
|
|
test('Bug #4541 - 重置按钮使用灰底白字', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待页面加载
|
|
|
await page.waitForTimeout(500)
|
|
|
@@ -1228,7 +1228,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
*/
|
|
|
test('Bug #4542 - 分页当前页使用蓝底白字', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -1250,7 +1250,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
*/
|
|
|
test('Bug #4557 - 摄像头列表状态下拉框显示英文选项', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
|
|
|
// 等待表格加载
|
|
|
await page.waitForTimeout(1000)
|
|
|
@@ -1310,7 +1310,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
await page.waitForTimeout(1000)
|
|
|
|
|
|
// 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
@@ -1367,7 +1367,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
await page.waitForTimeout(1000)
|
|
|
|
|
|
// 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
@@ -1417,7 +1417,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
*/
|
|
|
test('Bug #4569 - 编辑摄像头抽屉标题显示"摄像头详情"', async ({ page }) => {
|
|
|
await login(page)
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
await page.waitForTimeout(1000)
|
|
|
|
|
|
// 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
@@ -1475,7 +1475,7 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- await page.goto('/lss')
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
await page.waitForTimeout(1000)
|
|
|
|
|
|
// 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
@@ -1510,4 +1510,259 @@ test.describe('LSS管理 - Bug修复验证测试', () => {
|
|
|
expect(timeText).toMatch(/\d{4}-\d{2}-\d{2}|\-/)
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Bug #4545: 按钮大小统一,圆角框
|
|
|
+ */
|
|
|
+ test('Bug #4545 - 按钮有统一的圆角', async ({ page }) => {
|
|
|
+ await login(page)
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
+
|
|
|
+ // 等待页面加载
|
|
|
+ await page.waitForTimeout(500)
|
|
|
+
|
|
|
+ // 获取查询按钮
|
|
|
+ const searchButton = page.locator('[data-id="btn-search"]')
|
|
|
+ await expect(searchButton).toBeVisible()
|
|
|
+
|
|
|
+ // 验证按钮有圆角
|
|
|
+ const borderRadius = await searchButton.evaluate((el) => {
|
|
|
+ return window.getComputedStyle(el).borderRadius
|
|
|
+ })
|
|
|
+ // 验证圆角值不为0
|
|
|
+ expect(borderRadius).not.toBe('0px')
|
|
|
+ expect(parseInt(borderRadius)).toBeGreaterThanOrEqual(4)
|
|
|
+ })
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Bug #4549: LSS列表作为「LSS 管理」的子菜单
|
|
|
+ */
|
|
|
+ test('Bug #4549 - LSS列表作为LSS管理的子菜单', async ({ page }) => {
|
|
|
+ await login(page)
|
|
|
+
|
|
|
+ // 等待侧边栏加载
|
|
|
+ await page.waitForTimeout(500)
|
|
|
+
|
|
|
+ // 验证"LSS 管理"父菜单存在
|
|
|
+ const lssManageMenu = page.locator('.layout__nav-item--parent').filter({ hasText: 'LSS 管理' })
|
|
|
+ await expect(lssManageMenu).toBeVisible()
|
|
|
+
|
|
|
+ // 点击展开子菜单
|
|
|
+ await lssManageMenu.click()
|
|
|
+ await page.waitForTimeout(300)
|
|
|
+
|
|
|
+ // 验证"LSS 列表"子菜单存在
|
|
|
+ const lssListMenu = page.locator('.layout__nav-item--child').filter({ hasText: 'LSS 列表' })
|
|
|
+ await expect(lssListMenu).toBeVisible()
|
|
|
+
|
|
|
+ // 点击子菜单导航到页面
|
|
|
+ await lssListMenu.click()
|
|
|
+ await expect(page).toHaveURL(/\/lss-manage\/list/)
|
|
|
+ })
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Bug #4554 & #4555: 摄像头列表搜索字段
|
|
|
+ */
|
|
|
+ test('Bug #4554/#4555 - 摄像头列表有设备ID和设备名称搜索字段', async ({ page }) => {
|
|
|
+ await login(page)
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
+ await page.waitForTimeout(1000)
|
|
|
+
|
|
|
+ // 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
+ const editButton = page.locator('tbody tr').first().locator('button').nth(1)
|
|
|
+ await expect(editButton).toBeVisible({ timeout: 10000 })
|
|
|
+ await editButton.click()
|
|
|
+
|
|
|
+ // 等待 LSS 编辑抽屉打开
|
|
|
+ const drawer = page.locator('.el-drawer').filter({ hasText: 'LSS详情' })
|
|
|
+ await expect(drawer).toBeVisible({ timeout: 5000 })
|
|
|
+
|
|
|
+ // 点击"摄像头列表" Tab
|
|
|
+ await drawer.locator('.el-tabs__item').filter({ hasText: '摄像头列表' }).click()
|
|
|
+ await page.waitForTimeout(500)
|
|
|
+
|
|
|
+ // 验证有"设备ID"搜索框
|
|
|
+ await expect(drawer.getByPlaceholder('设备ID')).toBeVisible()
|
|
|
+
|
|
|
+ // 验证有"名称"搜索框
|
|
|
+ await expect(drawer.getByPlaceholder('名称')).toBeVisible()
|
|
|
+
|
|
|
+ // 验证没有"IP / 设备ID / 名称"混合搜索框
|
|
|
+ const mixedSearch = drawer.getByPlaceholder('IP / 设备ID / 名称')
|
|
|
+ await expect(mixedSearch).not.toBeVisible()
|
|
|
+ })
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Bug #4562: 摄像头列表有分页功能
|
|
|
+ */
|
|
|
+ test('Bug #4562 - 摄像头列表有分页功能', async ({ page }) => {
|
|
|
+ await login(page)
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
+ await page.waitForTimeout(1000)
|
|
|
+
|
|
|
+ // 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
+ const editButton = page.locator('tbody tr').first().locator('button').nth(1)
|
|
|
+ await expect(editButton).toBeVisible({ timeout: 10000 })
|
|
|
+ await editButton.click()
|
|
|
+
|
|
|
+ // 等待 LSS 编辑抽屉打开
|
|
|
+ const drawer = page.locator('.el-drawer').filter({ hasText: 'LSS详情' })
|
|
|
+ await expect(drawer).toBeVisible({ timeout: 5000 })
|
|
|
+
|
|
|
+ // 点击"摄像头列表" Tab
|
|
|
+ await drawer.locator('.el-tabs__item').filter({ hasText: '摄像头列表' }).click()
|
|
|
+ await page.waitForTimeout(500)
|
|
|
+
|
|
|
+ // 验证分页组件存在
|
|
|
+ await expect(drawer.locator('.el-pagination')).toBeVisible()
|
|
|
+ })
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Bug #4567: List厂商显示和详情页一样
|
|
|
+ */
|
|
|
+ test('Bug #4567 - 厂商列使用vendorName字段', async ({ page }) => {
|
|
|
+ await login(page)
|
|
|
+
|
|
|
+ // Mock 摄像头列表 API 返回带有 vendorName 的数据
|
|
|
+ await page.route('**/admin/camera/list*', async (route) => {
|
|
|
+ await route.fulfill({
|
|
|
+ status: 200,
|
|
|
+ contentType: 'application/json',
|
|
|
+ body: JSON.stringify({
|
|
|
+ success: true,
|
|
|
+ errCode: 0,
|
|
|
+ data: {
|
|
|
+ list: [
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ cameraId: 'CAM_001',
|
|
|
+ cameraName: '测试摄像头',
|
|
|
+ lssId: 'LSS_001',
|
|
|
+ status: 'active',
|
|
|
+ vendorName: 'hikvision',
|
|
|
+ model: 'DS-2CD2T45'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ total: 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
+ await page.waitForTimeout(1000)
|
|
|
+
|
|
|
+ // 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
+ const editButton = page.locator('tbody tr').first().locator('button').nth(1)
|
|
|
+ await expect(editButton).toBeVisible({ timeout: 10000 })
|
|
|
+ await editButton.click()
|
|
|
+
|
|
|
+ // 等待 LSS 编辑抽屉打开
|
|
|
+ const drawer = page.locator('.el-drawer').filter({ hasText: 'LSS详情' })
|
|
|
+ await expect(drawer).toBeVisible({ timeout: 5000 })
|
|
|
+
|
|
|
+ // 点击"摄像头列表" Tab
|
|
|
+ await drawer.locator('.el-tabs__item').filter({ hasText: '摄像头列表' }).click()
|
|
|
+ await page.waitForTimeout(500)
|
|
|
+
|
|
|
+ // 验证厂商列显示正确的格式化名称
|
|
|
+ const vendorCell = drawer.locator('tbody tr').first().locator('td').nth(5)
|
|
|
+ const vendorText = await vendorCell.textContent()
|
|
|
+ expect(vendorText).toContain('HIKVISION')
|
|
|
+ })
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Bug #4588: 参数配置更新按钮蓝底白字
|
|
|
+ */
|
|
|
+ test('Bug #4588 - 参数配置更新按钮使用蓝底白字', async ({ page }) => {
|
|
|
+ await login(page)
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
+ await page.waitForTimeout(1000)
|
|
|
+
|
|
|
+ // 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
+ const editButton = page.locator('tbody tr').first().locator('button').nth(1)
|
|
|
+ await expect(editButton).toBeVisible({ timeout: 10000 })
|
|
|
+ await editButton.click()
|
|
|
+
|
|
|
+ // 等待 LSS 编辑抽屉打开
|
|
|
+ const drawer = page.locator('.el-drawer').filter({ hasText: 'LSS详情' })
|
|
|
+ await expect(drawer).toBeVisible({ timeout: 5000 })
|
|
|
+
|
|
|
+ // 点击"摄像头列表" Tab
|
|
|
+ await drawer.locator('.el-tabs__item').filter({ hasText: '摄像头列表' }).click()
|
|
|
+ await page.waitForTimeout(500)
|
|
|
+
|
|
|
+ // 点击参数配置"查看"按钮
|
|
|
+ const viewButton = drawer.locator('tbody tr').first().locator('button:has-text("查看")').first()
|
|
|
+ if ((await viewButton.count()) > 0) {
|
|
|
+ await viewButton.click()
|
|
|
+
|
|
|
+ // 等待参数配置抽屉打开
|
|
|
+ const paramsDrawer = page.locator('.el-drawer').filter({ hasText: '参数配置' })
|
|
|
+ await expect(paramsDrawer).toBeVisible({ timeout: 5000 })
|
|
|
+
|
|
|
+ // 验证更新按钮是蓝色
|
|
|
+ const updateButton = paramsDrawer.locator('button:has-text("更新")')
|
|
|
+ await expect(updateButton).toHaveClass(/el-button--primary/)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Bug #4594: 删除确认对话框确定按钮蓝底白字
|
|
|
+ */
|
|
|
+ test('Bug #4594 - 删除确认对话框确定按钮蓝底白字', async ({ page }) => {
|
|
|
+ await login(page)
|
|
|
+
|
|
|
+ // Mock 摄像头列表 API
|
|
|
+ await page.route('**/admin/camera/list*', async (route) => {
|
|
|
+ await route.fulfill({
|
|
|
+ status: 200,
|
|
|
+ contentType: 'application/json',
|
|
|
+ body: JSON.stringify({
|
|
|
+ success: true,
|
|
|
+ errCode: 0,
|
|
|
+ data: {
|
|
|
+ list: [{ id: 1, cameraId: 'CAM_001', cameraName: '测试', status: 'active' }],
|
|
|
+ total: 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ await page.goto('/lss-manage/list')
|
|
|
+ await page.waitForTimeout(1000)
|
|
|
+
|
|
|
+ // 点击编辑按钮进入 LSS 编辑抽屉
|
|
|
+ const editButton = page.locator('tbody tr').first().locator('button').nth(1)
|
|
|
+ await expect(editButton).toBeVisible({ timeout: 10000 })
|
|
|
+ await editButton.click()
|
|
|
+
|
|
|
+ // 等待 LSS 编辑抽屉打开
|
|
|
+ const drawer = page.locator('.el-drawer').filter({ hasText: 'LSS详情' })
|
|
|
+ await expect(drawer).toBeVisible({ timeout: 5000 })
|
|
|
+
|
|
|
+ // 点击"摄像头列表" Tab
|
|
|
+ await drawer.locator('.el-tabs__item').filter({ hasText: '摄像头列表' }).click()
|
|
|
+ await page.waitForTimeout(500)
|
|
|
+
|
|
|
+ // 点击删除按钮
|
|
|
+ await drawer.locator('tbody tr').first().locator('button').last().click()
|
|
|
+
|
|
|
+ // 等待确认对话框
|
|
|
+ const messageBox = page.locator('.el-message-box')
|
|
|
+ await expect(messageBox).toBeVisible({ timeout: 5000 })
|
|
|
+
|
|
|
+ // 验证确定按钮是蓝色
|
|
|
+ const confirmButton = messageBox.locator('button.el-button--primary')
|
|
|
+ await expect(confirmButton).toBeVisible()
|
|
|
+
|
|
|
+ const bgColor = await confirmButton.evaluate((el) => {
|
|
|
+ return window.getComputedStyle(el).backgroundColor
|
|
|
+ })
|
|
|
+ // #409EFF 的 RGB 值为 rgb(64, 158, 255)
|
|
|
+ expect(bgColor).toMatch(/rgb\(64,\s*158,\s*255\)|rgba\(64,\s*158,\s*255/)
|
|
|
+
|
|
|
+ // 关闭对话框
|
|
|
+ await messageBox.locator('button:has-text("取消")').click()
|
|
|
+ })
|
|
|
})
|