Repository navigation
fix(e2e): TC-E2E-126 偶发拿到真实引擎译文 → 首装按界面语言写目标语言与种子设置交错,种子被整份覆盖回默认引擎;夹具等首装落定再交出 service worker,DeepL 替身改走能扛住 SW 重启的描述符(#723) - #765
Merged
Conversation
…等首装落定再交出 service worker,DeepL 替身改走能扛住 SW 重启的描述符(#723) CI 失败那次的网络 trace 里整页翻译发的是 translate.googleapis.com、tl=en: 种子里的 enginePriority: ['deepl'] 与目标语言都没生效。Playwright 的 locale 是挂上 worker 之后才覆盖界面语言的,首装处理可能先看到真实的 en-US, patchSettings 先读后写,与 seedSettings 交错时把种子整份写回默认值。 - background 暴露首装处理落定的信号,夹具等它之后才把 worker 交给用例 - DeepL 替身并入 e2e-mock 描述符,新增 mockDeepl 夹具,SW 重启后自愈 - TC-E2E-126 先认替身的译文前缀,没经过替身时报错直接指向替身或种子设置 Co-Authored-By: zhexuancai-uts <261878103+zhexuancai-uts@users.noreply.github.com>
Co-Authored-By: zhexuancai-uts <261878103+zhexuancai-uts@users.noreply.github.com>
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.
问题
TC-E2E-126 偶发失败:期望框里写回
[DL:JA] 你好世界,实际是Hello World。上一批起已经连着三批在 CI 上出现,重跑即过。根因
票面推测的是“SW 里直接改写
self.fetch的 DeepL 替身扛不住 SW 重启”。查了 PR #722 那次失败的 trace,真正的原因不是这个:translate.googleapis.com/...&tl=en—— 种子里的enginePriority: ['deepl']和目标语言 zh-CN 都没生效,设置回到了默认值。patchSettings({ to })(365-60 E2E 首装按界面语言改写目标语言,覆盖种子设置导致随机失败(父 #365) #469)。夹具用locale: 'zh-CN'想让推导结果是 zh-CN,但 Playwright 的 locale 是挂上 worker 之后才覆盖界面语言的:CI 的 Linux 上真实界面是 en-US,首装处理经常赶在覆盖之前,推导出 en。seedSettings交错时合并基底是空存储,种子被整份写回默认值。本地强制 en-US 实测:改前 6 次里 4 次在夹具交出 worker 之后才落盘。Hello World。只启用 DeepL 时路由器不会去别的引擎:拿到 Google 的真实译文,是因为种子被覆盖后启用的本来就是 Google。修复
ptInstallSettled(与applyE2EMock同一类调试面,首装逻辑本身不变),serviceWorker夹具等它落定之后才把 worker 交给用例,种子一定写在首装写入之后。ensureE2EMock自愈重装,与mockGoogle(E2E: 核心翻译功能在 CI 中完全不工作 — translateAndWait 超时导致 13 个测试失败 #89、E2E: TC-E2E-22 infinite scroll — observer 不触发新内容翻译 (#84 回归) #90)同一套装法。新增mockDeepl夹具,其他自带 key 的用例可以共用。[DL:,没经过替身时报错是“整页翻译 / 输入翻译没有经过 DeepL 替身:替身失效,或种子设置被改写”,而不是译文不符。断言值本身没有放宽,没有加重试或跳过。验证
--repeat-each 20 --retries 0:默认配置 20/20 通过;夹具强制 en-US 界面再跑 20/20 通过。【译】Write a reply。pnpm test1442 条全过,pnpm typecheck通过,pnpm test:e2e:core100 过 2 跳过。Closes #723