Skip to content

[ci] browser: pin page locale and run every workflow - #196

Merged
kunkunblueberry merged 2 commits into
ThinkFlowLab:mainfrom
wangtiance:fix/issue-160-browser-locale
Nov 7, 2026
Merged

kunkunblueberry merged 2 commits into
ThinkFlowLab:mainfrom
wangtiance:fix/issue-160-browser-locale

Conversation

@wangtiance

@wangtiance wangtiance commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Pin browser.newPage() to en-US or zh-CN on all 52 isolated browser
    pages, so the asserted language no longer follows the browser language of
    the machine that runs the check.
  • Guard that rule with npm run check:browser-locale: a page without an
    explicit locale, or a locale that disagrees with the script's own
    selectors, fails the checks job before the browser job starts.
  • Run the 18 browser workflows through scripts/run-browser-suite.mjs, which
    keeps going after a failure and reports every result, so one broken script
    no longer hides the ones after it.
  • Fix the layer studio race that made canvas_layers fail after the second
    apply: apply through tests/browser/layerApply.mjs, which waits for the
    studio dialog to detach instead of a button that renames itself to
    "Processing…" while saving. canvas_crop.mjs used the same wait, and
    canvas_layers.mjs now shares the helper after main fixed the same wait
    inline.
  • Document the locale rule, the runner, and why a control that renames itself
    while saving cannot be a completion signal.

Why

Issue #160: the first browser workflow waited for Chinese text while the CI
browser selected English, and the job stopped before the remaining checks.

#165 already moved the 18 CI workflows to English. This PR closes the gaps
that remained: 32 other scripts still asserted Chinese text without pinning a
locale, and the workflow still stopped at the first failure. The race fix
comes from the first CI run of that runner, where canvas_layers failed
because the test reloaded before the editor consumed its receipt.

Evidence

  • node --check on every touched script: 0 errors.
  • npm run check:browser-locale: 52 pages, 0 problems.
  • Negative fixture (missing and mismatched locale): both reported, exit 1.
  • npm run check:i18n: 0 problems.
  • npm run test:browser without Playwright: all 18 workflows attempted and
    summarized, exit 1.
  • CI run of this branch: 17/18 passed and the remaining 16 workflows still
    ran after canvas_layers failed, which is the intended behavior.
  • The real browser pass is the CI isolated browser job; the race itself
    cannot be exercised without Playwright locally.

Fixes #160

- Pin `browser.newPage()` to `en-US` or `zh-CN` in every isolated browser
  script, so the asserted language no longer follows the browser language
  of the machine that runs it (issue ThinkFlowLab#160).
- Add `scripts/check-browser-locale.mjs`, which rejects a page without an
  explicit locale and a locale that disagrees with the script's own
  selectors; CI runs it before the browser job.
- Add `scripts/run-browser-suite.mjs`, which runs all 18 workflows, keeps
  going after a failure, and fails once at the end, so one broken script
  no longer hides the ones after it.
- Document the locale rule and the new npm scripts.

Refs: ThinkFlowLab#160

- `node --check` on every touched script: 0 errors.
- `node scripts/check-browser-locale.mjs`: 52 pages, 0 problems.
- Negative fixture with a missing and a mismatched locale: both reported,
  exit 1.
- `node scripts/check-i18n.mjs`: 0 problems.
- `node scripts/run-browser-suite.mjs` without Playwright: ran all 18
  workflows and failed once with a summary, which is the intended
  behavior. The real browser pass needs the CI isolated browser job.
- Add `tests/browser/layerApply.mjs`: apply the layer studio, then wait for
  the studio dialog to detach, which only happens after the acknowledgement
  has been applied.
- Use that helper in `canvas_layers.mjs` and `canvas_crop.mjs` instead of
  waiting for the "Apply to canvas" button to become hidden. The button
  renames itself to "Processing…" while saving, and `waitFor` treats a
  missing element as hidden, so that wait returned before the receipt and
  the following reload restored an unconfirmed draft.
- Document the rule: a control that renames itself while saving cannot be a
  completion signal.

- `node --check` on every browser script: 0 errors.
- `node scripts/check-browser-locale.mjs`: 52 pages, 0 problems.
- The failing flow needs Playwright, so the CI browser rerun is the
  verification for the layer cascade itself.

Refs: ThinkFlowLab#160
@wangtiance
wangtiance force-pushed the fix/issue-160-browser-locale branch from 9783ddf to 1cd0803 Compare November 7, 2026 10:27

@FayeSpica FayeSpica left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kunkunblueberry
kunkunblueberry merged commit e34e6c9 into ThinkFlowLab:main Nov 7, 2026
1 check passed
@wangtiance
wangtiance deleted the fix/issue-160-browser-locale branch November 7, 2026 15:40
@FayeSpica FayeSpica added area:ci Continuous integration and checks type:ci Build, test and release automation labels Nov 10, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci Continuous integration and checks type:ci Build, test and release automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] CI browser workflow expects Chinese in an English browser

3 participants