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

58 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_API-007 · 正常办理身份更新(接口级)
* REQ-049 [FL-1.3] 正向/场景法 P0
*
* 前置:已绑定连接器的机构用户或已认证连接器 / 通过已认证的调用方连接器调用"身份更新"接口可以正常打开 / 已准备好测试数据
* 步骤:调用"身份更新"接口 → 按接口说明填写或选择正确的数据 → 提交,查看办理结果
* 预期:身份更新办理成功,系统按要求完成处理,状态和记录正确。
*
* 身份更新接口:JNPF /api/permission/Users/{id} + SSW /api/ssw/tdc/Member/{id}/UpdateProfile。
* 本用例优先验证 Member 自研接口。
*/
export const meta = {
tc: 'TC-IDENTITY_API-007',
req: 'REQ-049',
title: '正常办理身份更新',
type: '正向/场景法',
priority: 'P0',
route: '',
needs: ['be']
}
export async function run(t) {
let memberId = null
let newPhone = null
await t.step('前置:登录、准备一条 NORMAL 会员', async () => {
await t.login()
const list = await t.apiList('/api/ssw/tdc/Member', { pageSize: 20 })
const target = list.find((m) => m.status !== 'CANCELLED')
if (!target) t.skip('库内找不到 NORMAL 状态 Member')
memberId = target.id
t.assert(true, `目标 id=${memberId}`)
})
await t.step('正向:调用 UpdateProfile 接口更新联系电话', async () => {
newPhone = '139' + String(Date.now()).slice(-8)
const r = await t.api('PUT', `/api/ssw/tdc/Member/${memberId}/UpdateProfile`, {
contactPhone: newPhone
})
t.assert(r && r.code === 200, `UpdateProfile 调用成功(code=${r?.code} msg=${r?.msg})`)
})
await t.step('核对:详情接口拿回新联系电话', async () => {
const detail = await t.api('GET', `/api/ssw/tdc/Member/${memberId}`)
t.assert(detail.contactPhone === newPhone, `联系电话已更新为 ${newPhone}(实际 ${detail.contactPhone})`)
})
await t.step('核对:列表检索辅助验证(keyword 口径可能不含 contactPhone)', async () => {
const list = await t.apiList('/api/ssw/tdc/Member', { keyword: newPhone })
const hit = list.find((m) => m.id === memberId)
if (hit) {
t.assert(true, `列表关键字「${newPhone}」命中目标记录`)
} else {
t.log(`ℹ 列表 keyword 过滤口径不含 contactPhone,未命中;详情接口已确认更新生效,不单独判失败`)
}
})
}