- 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
59 lines
2.6 KiB
JavaScript
59 lines
2.6 KiB
JavaScript
/**
|
||
* TC-IDENTITY-007 · 正常办理身份更新
|
||
* REQ-003 [FL-1.3] 正向/场景法 P0
|
||
*
|
||
* 前置:已登录且具备该功能权限的用户 / 服务平台的【身份管理】可打开 / 已准备好测试数据
|
||
* 步骤:打开服务平台的【身份管理】→ 按页面提示填写或选择正确的数据 → 点击提交,查看办理结果
|
||
* 预期:身份更新办理成功,系统按要求完成处理,状态和记录正确。
|
||
*
|
||
* 身份更新由 JNPF UserController.update 提供,SSW 自研 /api/ssw/tdc/Member/{id}/UpdateProfile
|
||
* 走身份维度的资料维护;本用例走 API 正向。
|
||
* 由于 SSW 没有 JNPF「身份管理」UI,走 DSL t.api 直接落库再读回核对。
|
||
*/
|
||
export const meta = {
|
||
tc: 'TC-IDENTITY-007',
|
||
req: 'REQ-003',
|
||
title: '正常办理身份更新',
|
||
type: '正向/场景法',
|
||
priority: 'P0',
|
||
route: '',
|
||
needs: ['be']
|
||
}
|
||
|
||
export async function run(t) {
|
||
let memberId = null
|
||
let newEmail = null
|
||
|
||
await t.step('前置:登录并挑一条可编辑的会员作为更新对象', async () => {
|
||
await t.login()
|
||
const list = await t.apiList('/api/ssw/tdc/Member', { pageSize: 1 })
|
||
if (!list.length) t.skip('库内没有任何 Member,无法测试身份更新')
|
||
const target = list.find((m) => m.status !== 'CANCELLED') || list[0]
|
||
memberId = target.id
|
||
t.assert(true, `目标会员 id=${memberId} status=${target.status}`)
|
||
})
|
||
|
||
await t.step('正向:调用 UpdateProfile 修改联系电话', async () => {
|
||
// Member 实体无 email 字段,身份更新走真实存在的 contactPhone
|
||
newEmail = '139' + String(Date.now()).slice(-8)
|
||
const r = await t.api('PUT', `/api/ssw/tdc/Member/${memberId}/UpdateProfile`, {
|
||
contactPhone: newEmail
|
||
})
|
||
// 接口返回 { code, msg, data };成功是 code=200
|
||
t.assert(r && r.code === 200, `UpdateProfile 成功(code=${r?.code} msg=${r?.msg})`)
|
||
})
|
||
|
||
await t.step('核对 1:详情拉回,联系电话已更新', async () => {
|
||
const detail = await t.api('GET', `/api/ssw/tdc/Member/${memberId}`)
|
||
t.assert(!!detail, `详情接口返回 id=${detail?.id}`)
|
||
t.assert(detail.contactPhone === newEmail, `联系电话已更新为 ${newEmail}(实际 ${detail.contactPhone})`)
|
||
})
|
||
|
||
await t.step('核对 2:列表也能查到这条更新后的联系电话', async () => {
|
||
const list = await t.apiList('/api/ssw/tdc/Member', { pageSize: 50 })
|
||
const hit = list.find((m) => m.id === memberId)
|
||
t.assert(!!hit, `目标会员在列表中(${list.length} 条结果中)`)
|
||
t.assert(hit.contactPhone === newEmail, `列表中联系电话已更新(${hit.contactPhone})`)
|
||
})
|
||
}
|