Files
ssw-mvp/docs/e2e/cases/TC-IDENTITY_API-003.mjs
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

54 lines
1.9 KiB
JavaScript
Raw Permalink 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_API-003 · 查看身份注册的办理结果(接口级)
* REQ-047 [FL-1.2] 反向/错误推测 P1
*
* 前置:已完成一次身份注册操作 / 用户有查看记录的权限
* 步骤:调用"身份注册"接口 → 查询刚办理的记录 → 查看详情和相关记录
* 预期:能查到正确的身份注册结果,列表、详情和相关记录一致。
*/
export const meta = {
tc: 'TC-IDENTITY_API-003',
req: 'REQ-047',
title: '查看身份注册的办理结果',
type: '反向/错误推测',
priority: 'P1',
route: '',
needs: ['be']
}
export async function run(t) {
let account = ''
let userId = ''
await t.step('前置:注册一个新用户,作为查看对象', async () => {
await t.login()
account = `e2e_view_${t.uid('API').slice(-8).toLowerCase()}`
const r = await t.api('POST', '/api/permission/Users', {
account,
realName: '查看身份注册_API',
password: '123456',
gender: '3',
email: `${account}@example.com`
})
t.assert(r && r.code === 200, `新建成功(code=${r?.code} msg=${r?.msg})`)
userId = r?.data ?? ''
})
await t.step('核对 1:列表可查', async () => {
const list = await t.apiList('/api/permission/Users', { keyword: account })
const hit = list.find((u) => u.account === account)
t.assert(!!hit, `列表命中 ${account}`)
})
await t.step('核对 2:详情可查', async () => {
if (!userId) {
// 当 data 不可直接用作 id 时再用列表兜底找
const list = await t.apiList('/api/permission/Users', { keyword: account })
userId = list.find((u) => u.account === account)?.id
}
t.assert(!!userId, `拿到用户 id=${userId}`)
const detail = await t.api('GET', `/api/permission/Users/${userId}`)
t.assert(detail && detail.account === account, `详情接口 account 一致(${detail?.account})`)
})
}