Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

docs: needs_auth:false assertions still trigger the auth fixture

Đang mở
#2,912 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@marcel-rbro đang làm issue này rồi.

Từ ngày 24/8/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

documentation t-docs

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.

Ngôn ngữ chính
JavaScript
Star
82
Fork
240
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
44

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apify/apify-docs

Tất cả issue của apify/apify-docs

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.