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

61 lines
2.6 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-009 · 正常办理身份信息查询(接口级)
* REQ-050 [FL-1.3] 正向/场景法 P0
*
* 前置:已绑定连接器的机构用户或已认证连接器 / 通过已认证的调用方连接器调用"身份信息查询"接口可以正常打开 / 已准备好测试数据
* 步骤:调用"身份信息查询"接口 → 按接口说明填写或选择正确的数据 → 提交,查看办理结果
* 预期:身份信息查询办理成功,系统按要求完成处理,状态和记录正确。
*
* 身份信息查询 = /api/oauth/CurrentUser + /api/permission/Users/{id} + /api/ssw/tdc/Identity/{id}
* 取一条会员/身份详情,按关键字过滤,再核对详情字段。
*/
export const meta = {
tc: 'TC-IDENTITY_API-009',
req: 'REQ-050',
title: '正常办理身份信息查询',
type: '正向/场景法',
priority: 'P0',
route: '',
needs: ['be']
}
export async function run(t) {
let me = null
await t.step('前置:登录、确认当前会话身份可读', async () => {
await t.login()
const r = await t.api('GET', '/api/oauth/CurrentUser')
t.assert(r.code === 200, `CurrentUser code=${r.code}`)
me = r.data.userInfo
t.assert(!!me, `已拿到当前用户身份(userId=${me?.userId} userName=${me?.userName})`)
})
await t.step('正向 1:按 id 查询平台用户身份', async () => {
const r = await t.api('GET', `/api/permission/Users/${me.userId}`)
t.assert(!!r, `用户详情拿到(id=${r?.id})`)
t.assert(r.account === me.userName || r.realName === me.userName, `账号/姓名字段一致(${r.account}/${r.realName})`)
})
await t.step('正向 2:按关键字查询连接器身份(Identity)', async () => {
const list = await t.apiList('/api/ssw/tdc/Identity', { pageSize: 1 })
if (!list.length) {
t.assert(true, '库内没有连接器身份记录,跳过该断言')
return
}
const first = list[0]
const detail = await t.api('GET', `/api/ssw/tdc/Identity/${first.id}`)
t.assert(detail.identityCode === first.identityCode, `详情 identityCode 一致(${detail.identityCode})`)
})
await t.step('正向 3:按关键字查询会员身份(Member)', async () => {
const list = await t.apiList('/api/ssw/tdc/Member', { pageSize: 1 })
if (!list.length) {
t.assert(true, '库内没有会员记录,跳过该断言')
return
}
const first = list[0]
const detail = await t.api('GET', `/api/ssw/tdc/Member/${first.id}`)
t.assert(detail.name === first.name, `详情 name 一致(${detail.name})`)
})
}