Skip to content

chore(e2e): add smart E2E runner with shared dev server - #207

Merged
Gaubee merged 1 commit into
mainfrom
chore/e2e-runner-improvements
Jan 10, 2026
Merged

Gaubee merged 1 commit into
mainfrom
chore/e2e-runner-improvements

Conversation

@Gaubee

@Gaubee Gaubee commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

Summary

添加智能 E2E Runner 脚本,解决以下问题:

  1. 避免单次全部运行 - 按文件分片执行,减少单次运行时间
  2. 共享 dev server - 避免并行运行时的端口冲突
  3. 智能检测变更 - 只运行与变更相关的测试文件

Changes

新增 scripts/e2e-runner.ts

# 运行变更的 spec 文件(智能检测)
pnpm e2e:runner

# 运行所有 mock 测试
pnpm e2e:runner --all --mock

# 手动指定分片
pnpm e2e:runner --shard 1/3 --mock

# 更新截图基准
pnpm e2e:runner pages.mock --update

设计原则

  1. 按类型分组 - mock 和 non-mock 测试分开运行,共享各自的 dev server
  2. 串行执行 - 同类型测试串行运行,避免资源竞争
  3. 失败继续 - 单个文件失败不影响其他文件继续运行

CI 更新

更新 .github/workflows/ci.yml,使用 e2e:runner 替代原有的全量运行:

# 使用 e2e:runner 分片运行 E2E 测试
pnpm e2e:runner --all --mock
pnpm e2e:runner --all

截图基准更新

更新了 Mobile Safari 的截图基准文件。

Testing

  • pnpm e2e:runner authorize.mock pages.mock 通过
  • pnpm e2e:runner --dry-run --all --mock 正确显示分片

- Add scripts/e2e-runner.ts for intelligent E2E test execution
- Share dev server across spec files to avoid port conflicts
- Support --mock, --shard, --update, --project options
- Auto-detect changed files and run only affected tests
- Update CI to use e2e:runner instead of running all tests at once
- Update Safari screenshot baselines
@Gaubee
Gaubee merged commit a80736e into main Jan 10, 2026
5 checks passed
@Gaubee
Gaubee deleted the chore/e2e-runner-improvements branch January 10, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant