调整部分前端布局和后端增删改逻辑

This commit is contained in:
焦龙言
2026-09-26 23:11:05 +08:00
parent 977e7f996e
commit 17d991a74a
117 changed files with 311994 additions and 3192 deletions
@@ -3,6 +3,7 @@ from playwright.async_api import async_playwright
from common.base_page_test import BasePageTest
from common.config import Config
from common.login_helper import get_test_password
class OnlineUserTest(BasePageTest):
@@ -16,21 +17,11 @@ class OnlineUserTest(BasePageTest):
niangao_page = await niangao_context.new_page()
# 登录 niangao
try:
await niangao_page.goto(Config.frontend_url + '/login')
await niangao_page.locator('div.el-form-item', has_text='账号').locator('input').fill('niangao')
await niangao_page.locator('div.el-form-item', has_text='密码').locator('input').fill('admin123')
await niangao_page.get_by_role('button', name='登 录').click()
# 等待登录成功
await niangao_page.wait_for_url('**/index')
except Exception as e:
print(f'Niangao login failed: {e}. Trying admin123')
try:
await niangao_page.locator('div.el-form-item', has_text='密码').locator('input').fill('123456')
await niangao_page.get_by_role('button', name='登 录').click()
await niangao_page.wait_for_url('**/index')
except Exception as e2:
print(f'Niangao login failed again: {e2}')
await niangao_page.goto(Config.frontend_url + '/login')
await niangao_page.locator('div.el-form-item', has_text='账号').locator('input').fill('niangao')
await niangao_page.locator('div.el-form-item', has_text='密码').locator('input').fill(get_test_password('niangao'))
await niangao_page.get_by_role('button', name='登 录').click()
await niangao_page.wait_for_url('**/index')
# 2. 切换回 admin (self.page) 进行操作
await self.page.goto(Config.frontend_url + '/monitor/online')