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

51 lines
2.2 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_API-001 · 正常办理身份注册(接口级)
* REQ-047 [FL-1.2] 正向/场景法 P0
*
* 前置:待注册且具备实名信息的用户 / 通过已认证的调用方连接器调用"身份注册"接口可以正常打开 / 已准备好测试数据
* 步骤:调用"身份注册"接口 → 按接口说明填写或选择正确的数据 → 提交,查看办理结果
* 预期:身份注册办理成功,系统按要求完成处理,状态和记录正确。
*
* 通过已认证连接器调用「身份注册」接口:等价于 JNPF /api/permission/Users 创建用户。
* 因平台底座一致性,这条接口等价于 jnpf 的 Users.create 接口;由 admin token 完成创建。
*/
export const meta = {
tc: 'TC-IDENTITY_API-001',
req: 'REQ-047',
title: '正常办理身份注册',
type: '正向/场景法',
priority: 'P0',
route: '',
needs: ['be']
}
export async function run(t) {
const account = `e2e_ident_${t.uid('API').slice(-10).toLowerCase().replace(/-/g, '_')}`
const realName = `身份注册API-${t.uid('API')}`
await t.step('前置:以 admin token 接入', async () => {
await t.login()
t.assert(!!t.token, 'admin token 已注入')
})
await t.step('正向:调用 /api/permission/Users(与文档等价)创建用户', async () => {
// SSW 没有独立的「身份注册」开放接口,测评要求「通过已认证的调用方连接器调用『身份注册』接口」,
// 该接口在 JNPF 平台层由 /api/permission/Users 提供(功能清单『特别说明 8』)。
const r = await t.api('POST', '/api/permission/Users', {
account,
realName,
gender: '男',
enabledMark: 1,
isAdministrator: 0
})
t.assert(r && (r.code === 200 || typeof r === 'string'), `创建成功(code=${r?.code} data=${r?.data ?? r})`)
})
await t.step('核对:列表能查到该 account,状态正确', async () => {
const list = await t.apiList('/api/permission/Users', { keyword: account })
const hit = list.find((u) => u.account === account)
t.assert(!!hit, `接口注册的账号 ${account} 已落库(id=${hit?.id})`)
t.assert(hit.enabledMark === 1, `账号可用(enabledMark=${hit.enabledMark})`)
})
}