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

56 lines
1.8 KiB
JavaScript

/**
* TC-CONNECTOR-002 · 条件不满足时不能办理连接器注册
* REQ-005 [FL-3.1] 反向/等价类 P0
*
* 前置:【接入连接器管理】可打开 / 已准备错误数据
* 步骤:使用错误数据办理注册 → 提交 → 查看提示与数据
* 预期:系统不允许办理并说明原因;原有数据和状态不变
*/
export const meta = {
tc: 'TC-CONNECTOR-002',
req: 'REQ-005',
title: '条件不满足时不能办理连接器注册',
type: '反向/等价类',
priority: 'P0',
route: '/tds/connectors',
needs: ['fe', 'be']
}
export async function run(t) {
let before = 0
await t.step('前置:打开【接入连接器管理】并记录当前数据量', async () => {
await t.login()
await t.goto('/tds/connectors')
before = (await t.apiList('/api/ssw/tds/Connector')).length
t.assert(true, `注册前列表共 ${before} 条`)
})
await t.step('缺必填项提交:不填连接器标识与名称', async () => {
await t.openCreate()
await t.fillForm({ 所属机构: '尚数网测评机构(缺必填项)' })
await t.save()
await t.expectReject('不能为空')
await t.shot('必填校验拦截')
})
await t.step('只补名称仍缺标识,依然应被拦截', async () => {
await t.fillForm({ 连接器名称: `非法数据-${t.runId}` })
await t.save()
await t.expectReject('不能为空')
t.assert(
await t.drawer().isVisible(),
'校验未通过时抽屉保持打开,未误提交'
)
await t.cancelDrawer()
})
await t.step('核对原有数据和状态不变', async () => {
const after = (await t.apiList('/api/ssw/tds/Connector')).length
t.assert(after === before, `列表条数不变(${before} → ${after}),未产生脏数据`)
await t.expectNoRow(`非法数据-${t.runId}`)
})
t.expectConsoleClean()
}