fix(api): align alerts/commands contracts and ship full-site test suite.

Restore alert history filters and stats fields, paginate command/session logs for the SPA, show script labels on schedules, and land integration/E2E coverage with rebuilt web assets.
This commit is contained in:
Nexus Agent
2026-06-09 02:13:13 +08:00
parent 091fb97291
commit 0f6f91e61a
7017 changed files with 5553 additions and 79482 deletions
+37
View File
@@ -0,0 +1,37 @@
/** E2E-SET-001 / MCP-SET-001 — settings save control + success toast */
import { test, expect } from '../fixtures.mjs'
import { login, nav } from '../helpers.mjs'
test('E2E-SET-001 settings page save control', async ({ page }) => {
await login(page)
await nav(page, '/settings')
await expect(page.getByText('系统设置')).toBeVisible({ timeout: 20000 })
await expect(page.getByRole('button', { name: '保存设置' })).toBeVisible()
})
test('E2E-SET-002 settings save success toast', async ({ page }) => {
await login(page)
await page.route(/\/api\/settings\//, async (route) => {
if (route.request().method() === 'PUT') {
await route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ key: 'system_name', value: 'Nexus' }),
})
return
}
await route.continue()
})
await nav(page, '/settings')
await expect(page.getByLabel('系统名称')).toBeVisible({ timeout: 20000 })
const title = page.getByLabel('系统标题')
if (!(await title.inputValue()).trim()) {
await title.fill('Nexus Ops E2E')
}
const saveReq = page.waitForRequest(
(req) => req.method() === 'PUT' && req.url().includes('/api/settings/'),
)
await page.getByRole('button', { name: '保存设置' }).click()
await saveReq
await expect(page.getByText('设置已保存')).toBeVisible({ timeout: 10000 })
})