Skip to content

test(e2e): 手机账号菜单重开并重断言后再点击(#1391) - #1392

Merged
zhaozhaozz merged 1 commit into
mainfrom
bot/issue-1391
Nov 25, 2026
Merged

zhaozhaozz merged 1 commit into
mainfrom
bot/issue-1391

Conversation

@agent-ci-infra-bot

Copy link
Copy Markdown
Contributor

修复 #1391:390px 手机视口下,账号菜单可能在链接断言通过后被异步 shell 同步关闭,导致 admin-area 用例在「全局设置」点击处耗尽 90s,或在链接断言处看到 0 个可见链接。

根因按检视结论修正:当前手机步骤停在 #/projects,真正关闭菜单的是 (1) setViewportSize 引起的断点重同步(static/shell.js:564 → syncConsoleShell),(2) 项目列表渲染后的后台权限刷新(static/app/project-rows.js:139-148 → syncConsoleShell),并非 personalCanManageApps。

改动(仅 e2e 测试):

  • test/e2e/helpers/console-navigation.mjs 新增 openAccountMenu / clickAccountMenuEntry:每次尝试先重新打开菜单,再用 2s 短超时重新断言可见链接集合,随后点击;consoleNavigate 手机分支复用同一打开逻辑。
  • test/e2e/console/admin-area.spec.mjs 超管段(F1)与项目管理员段(F2)改用上述片段;链接集合、URL、picker、#console-account-settings 隐藏、scrollWidth 断言全部保留。
  • 未改产品代码、SSH 授权或 fix(runner): pin SSH grant re-arming to the task directory and stop agent socket recursion #1390。

验证:

  • npx playwright test -c test/e2e/playwright.config.mjs test/e2e/console/admin-area.spec.mjs --repeat-each 20 → 20 passed (15.7s)。
  • 本机 20 次未自然复现竞态;另用未提交的临时探针在 390px 注入两种形态(断言前/点击前隐藏菜单):旧写法看到 0 个可见链接,新片段均恢复并通过(2 passed)。
  • admin-area + brand + trial-fixes + console-addresses + console-states → 8 passed (6.3s)。
  • npm run check 通过(850 个运行时 JS 文件语法检查)。

风险:重试仍保持精确链接集合断言,仅在菜单被关闭时重开,最多 3-4 次、每次 2s,不会掩盖菜单内容错误;持续失败仍会以最后一次真实错误抛出。

Closes #1391

测试

npm run test:e2e -- test/e2e/console/admin-area.spec.mjs

由 agent 自报,平台未重跑。

提交:eed1247e65bf2cbc62aaeef18df38dc1e33a938f

@zhaozhaozz

Copy link
Copy Markdown
Collaborator

Reviewed head eed1247e65bf2cbc62aaeef18df38dc1e33a938f. The change is test-only (e2e helper + admin-area spec): every attempt re-opens the phone account menu and re-asserts the exact visible link set before clicking, with bounded retries and the original assertions kept, so the race described in #1391 no longer exhausts the test timeout without masking menu content or navigation errors.

All six required checks passed on this head (unit, e2e, bot-control-plane, bot-computer-manager, bot-project-computer, bot-cloudflare-tunnel), and CodeQL is green. No blocking findings. Enqueued into the merge queue with expectedHeadOid set to this reviewed head.

Merged via the queue into main with commit 2806b78 Nov 25, 2026
12 checks passed
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.

e2e:手机账号菜单在断言通过后被关掉,admin-area 点击「全局设置」超时

1 participant