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

74 lines
3.3 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-009 · 正常办理身份注销
* REQ-004 [FL-1.4] 正向/场景法 P0
*
* 前置:已登录且具备该功能权限的用户 / 服务平台的【身份管理】可打开 / 已准备好测试数据
* 步骤:打开服务平台的【身份管理】→ 按页面提示填写或选择正确的数据 → 点击提交,查看办理结果
* 预期:身份注销办理成功,系统按要求完成处理,状态和记录正确。
*
* 身份注销:
* ① JNPF LoginController.logoutCurrentUser 清当前登录态;
* ② SSW 自研 /api/ssw/tdc/Member/{id}/Cancel 把会员置 CANCELLED 并脱敏。
* 本用例覆盖 SSW 自研部分(更业务、可断言)。
*/
export const meta = {
tc: 'TC-IDENTITY-009',
req: 'REQ-004',
title: '正常办理身份注销',
type: '正向/场景法',
priority: 'P0',
route: '',
needs: ['be']
}
export async function run(t) {
// 先建一条专用注销会员,避免注销后状态不可逆影响共用基线
let memberId = null
let beforeMasked = null
let beforeName = null
let beforePhone = null
await t.step('前置:登录并新建一条用于注销的会员', async () => {
await t.login()
const r = await t.api('POST', '/api/ssw/tdc/Member', {
name: `测评注销${t.uid('IDENT')}`,
contactPhone: '139' + String(Date.now()).slice(-8),
memberType: 'PERSONAL',
status: 'NORMAL'
})
t.assert(r && r.code === 200, `新建会员成功(id=${r?.data})`)
memberId = r.data
})
await t.step('核对前置:注销前的姓名/手机号仍可见', async () => {
const before = await t.api('GET', `/api/ssw/tdc/Member/${memberId}`)
beforeName = before.name
beforePhone = before.contactPhone
beforeMasked = before.phoneMasked
t.assert(before.status !== 'CANCELLED', `注销前 status=${before.status}`)
t.assert(before.name === beforeName, '注销前姓名仍明文')
})
await t.step('正向:调用 Cancel 注销该会员(带原因)', async () => {
const r = await t.api('PUT', `/api/ssw/tdc/Member/${memberId}/Cancel`, {
reason: 'TC-IDENTITY-009 自动化注销'
})
t.assert(r && r.code === 200, `注销接口成功(code=${r?.code} msg=${r?.msg})`)
})
await t.step('核对 1:详情回看,状态变 CANCELLED 且姓名/手机号已脱敏', async () => {
const after = await t.api('GET', `/api/ssw/tdc/Member/${memberId}`)
t.assert(after.status === 'CANCELLED', `状态置为 CANCELLED(实际 ${after.status})`)
t.assert(after.displayName && after.displayName !== beforeName, `展示名脱敏(${beforeName} → ${after.displayName})`)
t.assert(after.phoneMasked && after.phoneMasked !== beforePhone, `手机号脱敏(${beforePhone} → ${after.phoneMasked})`)
})
await t.step('核对 2:注销后再次 UpdateProfile 应被业务拒绝,原数据不被串改', async () => {
const r = await t.api('PUT', `/api/ssw/tdc/Member/${memberId}/UpdateProfile`, { email: '[email protected]' })
t.assert(r && String(r.code) !== '200', `注销后改资料被拒(code=${r?.code})`)
const after = await t.api('GET', `/api/ssw/tdc/Member/${memberId}`)
t.assert(after.status === 'CANCELLED', '状态依旧为 CANCELLED')
t.assert(after.email !== '[email protected]', '邮箱未被脏改')
})
}