docs: needs_auth:false assertions still trigger the auth fixture
维护者通常 1 天内回复
@marcel-rbro 已经在做这个了。
开始于 2026年8月24日。
评估
这个 Issue 还没有评估数据。
描述
Part of #2671.
Problem
from-doc.spec.ts:50 destructures { page, browser }, and page comes from ./auth.fixture. Requesting it runs the worker-scoped authState fixture — a full login — before the anon-context branch at line 66 is ever reached.
That branch exists specifically so assertions tagged needs_auth: false (the sign-in / sign-up pages) run logged out, since visiting /sign-up with a session redirects into the app and the documented buttons vanish. The fixture dependency defeats it: those assertions can only run if credentials are available, even though they need no session.
Evidence
With CONSOLE_STAGING_USER_EMAIL / CONSOLE_STAGING_USER_PASSWORD unset and only CONSOLE_STAGING_URL present, all 38 UI assertions fail with:
Error: CONSOLE_STAGING_URL, CONSOLE_STAGING_USER_EMAIL and CONSOLE_STAGING_USER_PASSWORD must be set
at auth.fixture.ts:36
Expected: the 2 assertions with needs_auth: false should still run and pass, since the anon path builds its own context from browser + baseURL.
Fix
Don't request page unconditionally. Options: take only { browser } in the test signature and resolve the authenticated page inside the needs_auth branch, or split the two cases into separate test() declarations so Playwright only instantiates the fixture where it's needed.
Impact
Minor and latent — CI always has credentials, so nothing fails there today. It matters for local runs without secrets, where the credential-free subset should still be runnable, and it means the logged-out assertions aren't actually verifying the logged-out state they were written for.
- 主要语言
- JavaScript
- 星标
- 82
- 派生
- 240
- 平均合并
- 4 天 2 小时
- 30 天内合并 PR
- 44
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apify/apify-docs 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
apify/apify-docs#3071 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
apify/apify-docs#3049 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
apify/apify-docs#2742 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 82/100
apify/apify-docs#2741 ·
维护者通常 1 天内回复
-
low priority t-unblocking tech enhancement
难度 2/5 1-3 小时 新手友好度 65/100
apify/apify-docs#2451 ·
维护者通常 1 天内回复
相似的 Issue
-
t0ggles
难度 2/5 1-3 小时 新手友好度 70/100
nolimits4web/swiper#8240 · 1 条评论 ·
-
netbox status: backlog topic: testing type: housekeeping
难度 2/5 1-3 小时 新手友好度 70/100
netbox-community/netbox#23395 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
[scanner] check:spelling skips blog/ — posts and author metadata are never spell-checked可能已有人在做 @hivecommons-hive 今天认领。 未关闭agent/scanner bug hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
Edit: HTVKey.vn未关闭channels:edit check:passed
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 6 天内回复