test(e2e): 监测槽时长与指标 UI 生产冒烟
Playwright 验证默认 30 分 chip、内存/硬盘/负载与进度条;附部署验证报告。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# 生产验证 — 监测槽分钟时长 + 指标进度条 + 负载
|
||||
|
||||
**日期**:2026-06-12
|
||||
**Commit**:`647ebcb` — feat(watch): 监测槽分钟时长档、指标进度条与负载显示
|
||||
**环境**:https://api.synaglobal.vip
|
||||
|
||||
## 部署
|
||||
|
||||
| 项 | 结果 |
|
||||
|----|------|
|
||||
| push | `4c38bc0..647ebcb main → main` |
|
||||
| deploy-production | ✓ Docker 重建 + `ServersPage-CfEy_-BY.js` 同步 |
|
||||
| `/health` | ok |
|
||||
| `/app/` | 200 |
|
||||
|
||||
## API 终验(生产 JWT)
|
||||
|
||||
| 场景 | 结果 |
|
||||
|------|------|
|
||||
| GET `/api/watch/pins` | `ttl_minutes: 30` 字段存在 |
|
||||
| PATCH ttl 60 | `ttl_minutes: 60` |
|
||||
| PATCH ttl 30 | `ttl_minutes: 30` |
|
||||
| PATCH ttl 99 | 422 校验拒绝 |
|
||||
|
||||
## 前端 bundle
|
||||
|
||||
`ServersPage-CfEy_-BY.js` 含:`30分` `1时` `2时` `8时` `24时` `默认 30 分` `内存` `硬盘` `负载` `watch-ttl` `WatchMetricBar`
|
||||
|
||||
## 浏览器 E2E(Playwright)
|
||||
|
||||
`e2e/pages/watch-slot-ttl.spec.mjs` — **1 passed (7.3s)**
|
||||
|
||||
- 服务器页可见「默认 30 分」与五档时长 chip
|
||||
- 开启监测后可见「内存」「硬盘」「负载」与进度条 `.watch-metric-bar`
|
||||
|
||||
## 负载说明
|
||||
|
||||
展示 `load_1`(1 分钟平均负载),与宝塔面板「负载」同源;悬停 tooltip 说明非 CPU 百分比。
|
||||
|
||||
## 结论
|
||||
|
||||
**部署成功**;时长默认 30 分钟、进度条与中文指标、负载 chip 均已上线。
|
||||
@@ -0,0 +1,25 @@
|
||||
/** Production smoke — watch slot TTL chips + metric bars */
|
||||
import { test, expect } from '../fixtures.mjs'
|
||||
import { loginWithAccessToken, nav } from '../helpers.mjs'
|
||||
|
||||
test('watch slot TTL chips and metric labels', async ({ page }) => {
|
||||
const token = process.env.NEXUS_E2E_ACCESS_TOKEN || ''
|
||||
test.skip(!token, 'NEXUS_E2E_ACCESS_TOKEN required')
|
||||
await loginWithAccessToken(page, token)
|
||||
await nav(page, '/servers')
|
||||
await expect(page.getByText('默认 30 分')).toBeVisible({ timeout: 20000 })
|
||||
await expect(page.getByText('30分').first()).toBeVisible()
|
||||
await expect(page.getByText('1时').first()).toBeVisible()
|
||||
const card = page.locator('.watch-slot-card--filled').first()
|
||||
await expect(card).toBeVisible()
|
||||
await expect(card.getByText('时长')).toBeVisible()
|
||||
const switchEl = card.locator('.watch-slot-switch input[type="checkbox"]')
|
||||
if (!(await switchEl.isChecked())) {
|
||||
await card.locator('.watch-slot-switch').click()
|
||||
await page.waitForTimeout(1500)
|
||||
}
|
||||
await expect(card.getByText('内存').first()).toBeVisible({ timeout: 15000 })
|
||||
await expect(card.getByText('硬盘').first()).toBeVisible()
|
||||
await expect(card.getByText('负载').first()).toBeVisible()
|
||||
await expect(card.locator('.watch-metric-bar').first()).toBeVisible()
|
||||
})
|
||||
Reference in New Issue
Block a user