- 主题(浅色/深色/跟随系统)与正文字号(标准/大/特大)按账号存在本机, 账号切换不串、退出回默认;深色走 html[data-theme] 与 Element Plus 的 html.dark - style.css 收敛为语义调色板::root 的 53 个变量是文件内仅有的颜色字面量, 其余规则全部走 var(),暗色只覆盖变量 - 字号经 --reader-font-scale 只作用于阅读面,不做全局缩放 - 阅读位置按账号+章节保存滚动比例与该章 content_sha256,正文换版本后不恢复 - 复习页键盘:空格/Enter 显示答案、1/2/3 评分;输入控件与聚焦按钮的按键不被劫持 - 站点头部新增「显示」控件,七个学习页面共用 - Playwright 新增 390×844 hasTouch 的 mobile 项目与移动用例(无溢出、可返回、 触摸滑动不误开面板、深色与字号持久化、账号隔离);新增主题变量回归用例 - Wiki 记录 Architecture、Business-Rules、Local-Development 与需求更新
28 lines
1.3 KiB
TypeScript
28 lines
1.3 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test'
|
|
|
|
// Local development traffic must bypass any workstation HTTP proxy.
|
|
process.env.NO_PROXY = [process.env.NO_PROXY, '127.0.0.1', 'localhost'].filter(Boolean).join(',')
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
forbidOnly: !!process.env.CI,
|
|
retries: 0,
|
|
reporter: 'list',
|
|
// Every spec loads the whole SPA from the shared dev server, so a slow first module graph
|
|
// under parallel workers must not fail an assertion that the app itself would pass.
|
|
expect: { timeout: 15000 },
|
|
use: { baseURL: 'http://127.0.0.1:5173', headless: true, trace: 'off' },
|
|
projects: [
|
|
// Desktop behaviour, including the keyboard paths.
|
|
{ name: 'chromium', use: { ...devices['Desktop Chrome'], channel: 'chrome' }, testIgnore: /mobile-.*\.spec\.ts$/ },
|
|
// A touch phone viewport: the same pages at 390x844 with touch enabled. This is an emulated
|
|
// device, not a real phone; the hand-feel of a long-press selection still needs a person.
|
|
{
|
|
name: 'mobile',
|
|
testMatch: /mobile-.*\.spec\.ts$/,
|
|
use: { ...devices['Pixel 7'], channel: 'chrome', viewport: { width: 390, height: 844 } },
|
|
},
|
|
],
|
|
webServer: { command: 'npm run dev -- --host 127.0.0.1', url: 'http://127.0.0.1:5173', reuseExistingServer: !process.env.CI },
|
|
})
|