Files
ssw-mvp/docs/e2e/cases/TC-IDENTITY-003.mjs
T
admin 3247e9fd15 init: ssw-mvp initial commit
- boot/ (Java/Maven, JNPF 7.0) — 移除旧的 boot/.git,源码直接纳入仓库
- web/ (Vue 3 + Vite + Ant Design Vue, pnpm)
- docs/, scard/, nax/
- refs/INDEX.md + refs/国标/(其余 refs/* 开源子仓库不纳入)
- 已忽略: connector_data/, jweb/, log/, web/{dist,node_modules,.pnpm}, boot/*/target/, .DS_Store, .idea, .vscode
2026-08-05 18:29:12 +08:00

55 lines
2.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* TC-IDENTITY-003 · 查看身份注册的办理结果
* REQ-001 [FL-1.1] 反向/错误推测 P1
*
* 前置:已完成一次身份注册操作 / 用户有查看记录的权限
* 步骤:打开【身份管理】→ 查询刚办理的记录 → 查看详情和相关记录
* 预期:能查到正确的身份注册结果,列表、详情和相关记录一致。
*
* 身份注册由 JNPF 默认能力提供(功能清单『特别说明 8』),SSW 自研不重复造。
* 通过 /api/permission/Users 拉列表 + /api/permission/Users/{id} 取详情核对。
*/
export const meta = {
tc: 'TC-IDENTITY-003',
req: 'REQ-001',
title: '查看身份注册的办理结果',
type: '反向/错误推测',
priority: 'P1',
route: '',
needs: ['be']
}
export async function run(t) {
let beforeAccount = null
let beforeCount = 0
await t.step('前置:取当前列表作为基线', async () => {
await t.login()
const list = await t.apiList('/api/permission/Users', { pageSize: 1 })
if (!list.length) t.skip('库内没有任何用户,无法查看身份注册结果')
beforeCount = list.length
beforeAccount = list[0].account
t.assert(true, `基线账户 ${beforeAccount}(共 ${beforeCount})`)
})
await t.step('核对 1:关键字搜索可在列表中命中刚注册账户', async () => {
const r = await t.apiList('/api/permission/Users', { account: beforeAccount, pageSize: 5 })
t.assert(r.length > 0, `关键字「${beforeAccount}」搜索到 ${r.length} 条`)
const hit = r.find((x) => x.account === beforeAccount)
t.assert(!!hit, `列表命中基线账户 id=${hit?.id}`)
})
await t.step('核对 2:通过 id 拉详情,account/realName 与列表一致', async () => {
const list = await t.apiList('/api/permission/Users', { account: beforeAccount, pageSize: 5 })
const hit = list.find((x) => x.account === beforeAccount)
const detail = await t.api('GET', `/api/permission/Users/${hit.id}`)
t.assert(detail && detail.id === hit.id, `详情接口返回 id=${detail?.id}`)
t.assert(detail.account === beforeAccount, `详情 account 与列表一致(${detail.account})`)
})
await t.step('核对 3:分页排序稳定,旧记录仍在', async () => {
const list = await t.apiList('/api/permission/Users', { pageSize: 1 })
t.assert(list.length > 0, '列表仍能稳定分页读取')
})
}