Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ jobs:
# main push:只构 amd64(快)。tag(v*)release 才构 multi-arch 兼容 ARM 服务器。
platforms: ${{ startsWith(github.ref, 'refs/tags/v') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
push: true
# build:fast = 只跑 vite build(typecheck 已由 pr-gate / full-ci-gate 单独门禁过)
# 与 Dockerfile 默认值一致:镜像构建同时执行 typecheck、i18n 检查和 Vite build。
build-args: |
BUILD_MODE=build:fast
BUILD_MODE=build
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ COPY . .

# build:fast = vite build 不跑 vue-tsc(CI 已跑过 typecheck),节省 ~20s 构建时间
# 想严格类型检查的把这里改成 npm run build
ARG BUILD_MODE=build:fast
ARG BUILD_MODE=build
RUN npm run ${BUILD_MODE}

# ── 文档站点(可选):跨仓 srcDir = ../../../../file-batch-system/docs ──
Expand Down
16 changes: 4 additions & 12 deletions e2e/a11y.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,10 @@ import type { Page } from '@playwright/test'

const SEVERITY_TO_FAIL = ['critical', 'serious'] as const

// EP 上游已知问题豁免清单(每条标注理由)
const GLOBAL_DISABLE_RULES = [
// EP el-button plain 模式浅蓝 + 浅灰背景对比度低(WCAG 1.4.3 AA 4.5:1 边界)
// 整套设计语言调色后可移除,issue: element-plus/element-plus#14523
'color-contrast',
]

async function runAxe(
page: Page,
exclude: string[] = [],
extraDisable: string[] = [],
) {
// 全局不豁免规则。第三方 canvas/chart 的局部问题应在具体测试中按选择器排除。
const GLOBAL_DISABLE_RULES: string[] = []

async function runAxe(page: Page, exclude: string[] = [], extraDisable: string[] = []) {
let builder = new AxeBuilder({ page })
.withTags(['wcag2aa', 'best-practice'])
.disableRules([...GLOBAL_DISABLE_RULES, ...extraDisable])
Expand Down
2 changes: 0 additions & 2 deletions e2e/all-pages-zero-error.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ const PAGES: PageCheck[] = [
path: '/files/list',
title: '文件列表',
drillFirstRow: true,
// files/summary 端点旧 jar 返回 500,FE 已 _silent 降级为 0(src/api/file.ts by-design)
allowErrors: [/\/queries\/files\/summary\b/],
},
{ path: '/files/templates', title: '文件模板' },
{ path: '/files/arrival-groups', title: '到达组治理' },
Expand Down
3 changes: 0 additions & 3 deletions e2e/business-flows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,6 @@ test.describe('@business-flows D 档 P6 真实业务流程', () => {
// 8. File — 归档 / 审计
// ───────────────────────────────────────────────────────────────
test('8. File — 归档 + 审计行操作', async ({ page, network }) => {
// files/summary 端点旧 jar 返回 500,FE 已 _silent 降级为 0(src/api/file.ts by-design),
// 不属于本流程要守的错误面
network.ignore(/\/queries\/files\/summary\b/)
await page.goto('/files/list')
await page.waitForLoadState('networkidle', { timeout: 8000 }).catch(() => {})
const row = page.locator('tbody tr.el-table__row').first()
Expand Down
241 changes: 0 additions & 241 deletions e2e/global-setup.js

This file was deleted.

25 changes: 0 additions & 25 deletions e2e/global-setup.ts

This file was deleted.

35 changes: 32 additions & 3 deletions e2e/login-validation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,39 @@ test.describe('login form validation', () => {
test('错误密码触发 error toast', async ({ page, context }) => {
await context.clearCookies()
await page.goto('http://localhost:5173/login', { waitUntil: 'networkidle' })
await page.getByPlaceholder(/用户名|username/i).first().fill('admin')
await page.getByPlaceholder(/密码|password/i).first().fill('wrong-password-xyz')
await page.getByRole('button', { name: /登\s*录|Sign\s*in/i }).first().click()
await page
.getByPlaceholder(/用户名|username/i)
.first()
.fill('admin')
await page
.getByPlaceholder(/密码|password/i)
.first()
.fill('wrong-password-xyz')
await page
.getByRole('button', { name: /登\s*录|Sign\s*in/i })
.first()
.click()
const toast = page.locator('.el-message--error, .el-message--warning').first()
await expect(toast).toBeVisible({ timeout: 8000 })
})

test('登录页语言切换同步更新表单文案', async ({ page, context }) => {
await context.clearCookies()
await page.goto('http://localhost:5173/login', { waitUntil: 'networkidle' })
await page.evaluate(() => localStorage.setItem('batch-console:locale', 'zh-CN'))
await page.reload({ waitUntil: 'networkidle' })

const localeToggle = page.getByRole('button', { name: /切换语言|Switch language/i })
await expect(localeToggle).toBeVisible({ timeout: 8000 })
await localeToggle.click()

await expect(page.getByRole('heading', { name: 'Sign in to the console' })).toBeVisible()
await expect(page.getByPlaceholder('Enter tenant username')).toBeVisible()
await expect(page.getByPlaceholder('Enter tenant password')).toBeVisible()

await localeToggle.click()
await expect(page.getByRole('heading', { name: '登录控制台' })).toBeVisible()
await expect(page.getByPlaceholder('请输入租户账号')).toBeVisible()
await expect(page.getByPlaceholder('请输入租户密码')).toBeVisible()
})
})
Loading