Files
YG_FT/frontend/scripts/regression-fine-tune-create-ui.mjs
caoxiaozhu e2eabe3525 test: 添加回归测试脚本
基于 Playwright 的 UI 回归脚本,覆盖返回导航、数据处理向导、调优创建、模型管理、页面表层级、训练日志布局六个场景。
2026-07-10 16:46:23 +08:00

28 lines
1.7 KiB
JavaScript

import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
const root = resolve(fileURLToPath(new URL('..', import.meta.url)))
const source = readFileSync(resolve(root, 'src/views/fine-tune/FineTuneCreateView.vue'), 'utf8')
function assert(condition, message) {
if (!condition) {
throw new Error(message)
}
}
assert(source.includes(':rows="4"'), '任务描述 textarea should be taller than the original 2 rows')
assert(source.includes('gpu-index'), 'GPU cards should use a restrained index label')
assert(source.includes('GPU-{{ idx }}'), 'GPU cards should show the GPU number in a compact format')
assert(source.includes('gpu-usage-bar'), 'GPU cards should visualize usage with an enterprise-style progress bar')
assert(source.includes('is-busy'), 'GPU cards should have a distinct busy state for usage over 80%')
assert(source.includes('gpu.gpu_percent > 80'), 'GPU busy state should be driven by usage over 80%')
assert(source.includes('modelDialogVisible'), 'Model selection should open a dialog instead of a plain select')
assert(!source.includes('width="78vw"'), 'Model dialog should not use the previous oversized 78vw width')
assert(source.includes('width="860px"'), 'Model dialog should use a compact enterprise modal width')
assert(source.includes('model-series-list'), 'Model dialog should include a model series list column')
assert(source.includes('model-version-list'), 'Model dialog should include a snapshot/version list column')
assert(source.includes('confirmModelSelection'), 'Model dialog should confirm the selected model before updating the form')
console.log('fine-tune create UI regression checks passed')