makecindy / makecindy/cindy

mobile E2E 登录流断链:maestro login_mock 仍指向已删除的 dev login 入口(来自 PR #5)

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.7k
Forks
395
Avg merge
21h 48m
Merged PRs (30d)
776

Description

PR makecindy/cindy-temp#5 把登录迁移到 auth-server,新登录页移除了旧「开发调试 / 本地模拟登录」入口(`login.debugButton` / `login.devLoginButton`),mobile E2E 工具链有三处随之断链:

1. `apps/mobile/e2e/maestro/login_mock_no_clear.yaml`(39-55 行)仍在点这两个已不存在的 testID;`login_mock.yaml` 转调它——**所有 E2E flow 的登录前置全断**。
2. `apps/mobile/scripts/maestro-flow-smoke.mjs`(57-58、186-187 行)把这两个 testID 列为 flow marker 和 source anchor,`pnpm --filter mobile test:e2e:maestro:check` 现在必失败(vitest 单测不受影响,`pnpm test:unit` 仍是绿的)。
3. `EXPO_PUBLIC_XDT_DEV_LOGIN_ENABLED` / `DEV_LOGIN_ENABLED`(`apps/mobile/src/config/env.ts:67`)整条 plumbing 目前无消费方,但 `local-device-link-smoke.mjs` 仍在注入。

没在合并前顺手修的原因:修复方案是个设计决策,两条候选路线——

- **A. E2E 栈 mock auth-server**:`mock-device-link-host` 增加 auth-server 端点(request-code / verify / refresh),`EXPO_PUBLIC` 的 auth base 指向 mock,maestro 直接驱动真实登录 UI(identifier → 验证码)。好处:测的就是真实登录流,不需要任何 dev-only UI。
- **B. 恢复受控 dev login 入口**:新登录页加回 `DEV_LOGIN_ENABLED` 门控的调试按钮 + `AuthContext.devLogin`(POST `/api/auth/dev-login`)。注意新模型 access token 不落盘、冷启动靠 auth-server refresh 换 token——dev session 需要单独的 refresh 分支(仍走产品服),否则 App 重启即被登出,E2E 第二个 flow 起就挂。

方案定了之后,顺带处理 `DEV_LOGIN_ENABLED` plumbing 的去留与 `mobileEnvBootstrap` / `releaseLib` 相关断言。

(来自 PR makecindy/cindy-temp#5 的代码审查,关联 PR:https://github.com/makecindy/cindy-temp/pull/5 )

Contributor guide

Open the contributing guide

Research direction

Start with apps/mobile/e2e/maestro/login_mock_no_clear.yaml, login_mock.yaml, apps/mobile/scripts/maestro-flow-smoke.mjs, and apps/mobile/src/config/env.ts, then review the auth-server migration in PR #5. Decide between mocking auth-server and restoring a controlled dev-login path, including the DEV_LOGIN_ENABLED plumbing and related assertions. Done means the obsolete testIDs are removed or replaced and pnpm --filter mobile test:e2e:maestro:check passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, mobile, testing
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.