Repository navigation
test(mobile): 个人中心从相册换头像进 Maestro 冒烟链 · 修头像上传(#381) - #439
Merged
Merged
Conversation
yile2020
force-pushed
the
test/issue-381
branch
from
November 22, 2026 01:13
b59f0db to
8d055b1
Compare
- CI 跑 Maestro 前往模拟器相册推一张测试图(seed-gallery.sh:adb push + 媒体扫描 + 回查 MediaStore) - 新流程 profile-avatar:登录 → 我的 → 资料 → 编辑 → 从相册选择 → 系统照片选择器 → 裁剪确认 → 上传 → 断言地址换成 /uploads 直链、图真的加载出来(编辑屏和「我的」页两处) - UserAvatar 加 testID:加载成功才是 <id>-loaded,地址换成裂图时不会冒充成功 - setup.mjs 先把 admin 的头像清空,重跑时起点一致 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Expo 57 的 winter 运行时把全局 fetch 换成了 expo/fetch,它的 multipart 编码遇到
RN 的 `{ uri, name, type }` 描述对象直接抛 `Unsupported FormDataPart implementation`,
被客户端包成「连不上服务器」。上一个提交的 Maestro 流程在 CI 模拟器上红在这一步
(截图:「Avatar upload failed · Can't reach the server … Unsupported FormDataPart
implementation」)。改走 `api.sendUpload`(XHR,RN 自己的网络层),和审批附件同一条路。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…· 相册回查防 SIGPIPE(#381) - sendUpload 的 onerror 把 RN XHR 放在 responseText 里的原生错误原文带进报错, 不再只有一句 `upload failed`(client.test.ts 两条,修前红) - 新增 apps/mobile/tests/avatar-upload.test.mjs:守住头像上传走 sendUpload、 不走 sendRaw / fetch;换回修前 avatar.ts 即红 - 编辑资料:头像已写进服务端后 reload() 失败,单独提示「头像已保存,但刷新资料失败」, 地址框照样换成新地址(原来报「上传失败」,用户会重传、留下孤儿文件) - UserAvatar:source 按地址 useMemo,避免原语每次渲染把状态重置成 loading / 坏图反复重挂 - seed-gallery.sh:先收进变量再 grep,避免 pipefail 下 grep -q 早退导致 SIGPIPE 误判 - e2e 分册:重跑前要先跑 setup.mjs 的前提写清楚 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yile2020
force-pushed
the
test/issue-381
branch
from
November 22, 2026 01:44
8d055b1 to
db20a30
Compare
yile2020
enabled auto-merge
November 22, 2026 01:44
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.
Refs #381(只做第 1 条的自动化部分)
做了什么
apps/mobile/e2e/seed-gallery.sh:adb push一张 400×400 的 PNG 到/sdcard/Pictures/,发MEDIA_SCANNER_SCAN_FILE,再回查 MediaStore 确认真的进了索引。查不到就当场红,不让流程在系统界面上干等flows/profile-avatar.yaml:登录 → 我的 → 资料 → 编辑 → 从相册选择 → 系统照片选择器(按 resource-id…:id/icon_thumbnail找,AOSP 和 Google 两个包名都能匹配)→ 裁剪页(CanHub cropper 的…:id/crop_image_menu_crop)→ 上传/uploads/…公开直链、图真的加载出来(编辑屏和「我的」页顶部两处都查)UserAvatar加testID:图片加载成功后是<id>-loaded,加载中是<id>-image,显示首字时是<id>-fallback。只看地址换没换的话,裂图也能过setup.mjs先把 admin 的头像清成null,重跑时起点一致顺手修了一个真 bug:移动端头像上传原来是坏的
流程第一次跑(run 44965454415)就红了:选图、裁剪都过了,回来是 toast「Avatar upload failed · Can't reach the server (http://10.0.2.2:8001): Unsupported FormDataPart implementation」。
fetch换成了expo/fetch,它的 multipart 编码不认 RN 的{ uri, name, type }文件描述,直接抛错,客户端又把这个错包成了「连不上服务器」。lib/avatar.ts原来走的是sendRaw(fetch)api.sendUpload(XHR,走 RN 自己的网络层),和审批附件是同一条路CI 结果(
maestro · 移动端 E2E)profile-avatar红在toast-success,原因就是上面那个 bug(截图在maestro-debug里)profile-avatar39 秒)profile-avatar1 分 24 秒)结论记进了
apps/mobile/e2e/AGENTS.md「换头像」一节,src/app/AGENTS.md头像上传那一节也改了(这份已经到了 500 行的预算,只留了一条指向 e2e 分册的说明)。没做 / 没覆盖
🤖 Generated with Claude Code