优化 E2E 测试执行效率,修复 navigator.clipboard 权限失败#1459
Open
cyfung1031 wants to merge 2 commits into
Open
Conversation
Member
|
感觉只有核心流程才做e2e,太重了,其它的用单元测试就行,有点乱了 |
navigator.clipboard 可能导致的权限失败问题
Collaborator
Author
没更改 |
navigator.clipboard 可能导致的权限失败问题navigator.clipboard 权限失败
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
优化 E2E 测试的执行效率,并调整 Playwright 相关命令与浏览器权限配置,降低测试等待成本并提升脚本安装辅助流程的稳定性。
Changes
将 Playwright 相关命令统一改为
pnpm exectest:e2e:install,用于安装 Chromiumpnpm test:e2e:installtest:e2e/test:e2e:ui统一使用pnpm exec playwright ...缩短 E2E 测试中的等待时间
优化脚本安装辅助流程的稳定性
clipboard-read/clipboard-write权限,避免剪贴板权限导致的 E2E 不稳定问题Motivation
当前 E2E 测试中存在较多偏保守的长 timeout 和固定等待,导致测试反馈较慢。
同时,脚本安装辅助函数依赖剪贴板写入 Monaco Editor,在浏览器 / CI 环境中如果未显式授予剪贴板权限,可能出现权限相关的不稳定问题。
本 PR 通过缩短等待时间、统一 Playwright 命令入口,并补充剪贴板权限配置,提升 E2E 测试的执行速度和可靠性。
Testing
相关 E2E 命令:
pnpm test:e2e:installpnpm test:e2epnpm test:e2e:uiNotes
本 PR 主要影响测试代码、Playwright 配置与 CI 脚本,不涉及业务逻辑变更。
本 PR 未调整 E2E 覆盖范围,仅优化现有 E2E 用例的执行等待与辅助函数稳定性。