- 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
76 lines
3.0 KiB
JavaScript
76 lines
3.0 KiB
JavaScript
/**
|
||
* TC-SPACE-003 · 正常办理成员管理
|
||
* REQ-015 [FL-2.3] 正向/场景法 P0
|
||
*
|
||
* 前置:具备权限的运营方 / 【可信数据空间管理】可打开 / 测试数据已备
|
||
* 步骤:打开【空间成员】→ 提交新成员 → 通过 → 启用/退出
|
||
* 预期:成员管理各动作成功,状态与记录正确
|
||
*
|
||
* 说明:空间成员申请+审批+启用/退出三步联动;通过 API 落库 + 接口审批+启用保证可重复跑通。
|
||
*/
|
||
export const meta = {
|
||
tc: 'TC-SPACE-003',
|
||
req: 'REQ-015',
|
||
title: '正常办理成员管理',
|
||
type: '正向/场景法',
|
||
priority: 'P0',
|
||
route: '/tds/space-members',
|
||
needs: ['fe', 'be']
|
||
}
|
||
|
||
export async function run(t) {
|
||
await t.login()
|
||
const spaceList = await t.apiList('/api/ssw/tds/Space', { pageSize: 5 })
|
||
if (!spaceList.length) t.skip('库中没有空间,无法添加空间成员')
|
||
const spaceId = spaceList[0].id
|
||
const orgName = `测评成员组织-${t.runId}`
|
||
|
||
let memberId = null
|
||
|
||
await t.step('前置:打开【空间成员】页', async () => {
|
||
await t.goto('/tds/space-members')
|
||
await t.expectVisible('.ant-table', '空间成员列表已渲染')
|
||
})
|
||
|
||
await t.step('通过 API 新增一条 PENDING 成员记录(页面新建需先选空间,先落库更稳)', async () => {
|
||
const r = await t.api('POST', '/api/ssw/tds/SpaceMember', {
|
||
spaceId,
|
||
orgId: t.uid('ORG'),
|
||
orgName,
|
||
memberRole: 'CONSUMER',
|
||
memberType: 'ENTERPRISE',
|
||
applyReason: `自动化测评 ${t.runId}`
|
||
})
|
||
t.assert(r.code === 200, `新增成员成功(实际 code=${r.code})`)
|
||
// TdsCrudController.create 返回 data = 新 id 字符串
|
||
memberId = r.data
|
||
t.assert(!!memberId, `返回 id(${memberId})`)
|
||
})
|
||
|
||
await t.step('审批通过:POST /Approve', async () => {
|
||
const r = await t.api('POST', `/api/ssw/tds/SpaceMember/${memberId}/Approve`, {
|
||
auditOpinion: `通过-${t.runId}`
|
||
})
|
||
t.assert(r.code === 200, `审批通过成功(实际 code=${r.code})`)
|
||
const info = await t.api('GET', `/api/ssw/tds/SpaceMember/${memberId}`)
|
||
t.assert(info.data.auditStatus === 'APPROVED', `auditStatus=APPROVED(实际 ${info.data.auditStatus})`)
|
||
t.assert(info.data.status === 'ENABLE', `审批通过自动置 status=ENABLE(实际 ${info.data.status})`)
|
||
t.assert(!!info.data.joinTime, `joinTime 已写入`)
|
||
})
|
||
|
||
await t.step('退出:POST /Quit → status=DISABLE,记录保留', async () => {
|
||
const r = await t.api('POST', `/api/ssw/tds/SpaceMember/${memberId}/Quit`)
|
||
t.assert(r.code === 200, `退出成功(实际 code=${r.code})`)
|
||
const info = await t.api('GET', `/api/ssw/tds/SpaceMember/${memberId}`)
|
||
t.assert(info.data.status === 'DISABLE', `quit 后 status=DISABLE(实际 ${info.data.status})`)
|
||
t.assert(!!info.data.quitTime, `quitTime 已写入`)
|
||
})
|
||
|
||
await t.step('界面核对:列表能查到刚处理的成员', async () => {
|
||
await t.goto('/tds/space-members')
|
||
await t.search(orgName)
|
||
await t.expectRow(orgName)
|
||
})
|
||
|
||
t.expectConsoleClean()
|
||
} |