Files
marketplaces/e2e/README.md
sdarbinyan 55634b3b57
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Deploy Frontend / deploy (push) Has been cancelled
Merge improvements/fork-harvest into main
Fork-harvest brings: the ip-api.com geo fix, credential bundle scan,
mock gateways out of production, JIT compiler dropped (1.55->1.04 MB),
host hardening, provider-agnostic identity + VK/Yandex + account linking,
and the backend contracts consolidated into one BACKEND-INTEGRATION.md.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

# Conflicts:
#	docs/backend/BACKEND-HANDOFF.md
#	docs/backend/TRACK-S-SECURITY-RBAC-CONTRACT.md
2026-08-22 16:19:55 +04:00

3.1 KiB
Raw Permalink Blame History

E2E — Playwright

Track Q (docs/PRODUCT-PLAN-v3.1-DELIVERY-PLAN.md, Q1). None of this existed before 2026-08-18.

Run

npm run e2e          # headless, boots the dev server automatically
npm run e2e:ui        # interactive runner
npm run e2e:report    # last HTML report

Against a different server (staging, a locally-started backend):

BASE_URL=https://staging.example.com npm run e2e

What this suite currently covers, and what it doesn't

environment.ts ships useMockData: false — the dev server this suite boots hits real /api/ endpoints, which 404 (../docs/backend/BACKEND-INTEGRATION.md — no backend is running anywhere this session can reach). The product catalog itself renders from a separate mocked bootstrap/catalog path (useMockBootstrapOnLocal: true), so real prices and real currency conversion ARE exercised — smoke.spec.ts explicitly ignores the expected 404 console noise rather than pretending it isn't there.

This is not the same guarantee as running against a live backend. Checkout, payment, and anything behind a real endpoint are not covered until BASE_URL points at a live environment. Confirmed once, concretely: on the first run, this suite caught a real bug (@marketplaces/auth shipping without Angular Ivy metadata, breaking app bootstrap) and a real test defect (a duplicate hidden dropdown made the first currency-switch attempt click a no-op element) — both fixed as part of standing this suite up. See the commit history in src/main.ts and this directory for what each was.

Files

File Covers
currency-switch.spec.ts 160 RUB must not silently become 160 USD on a currency switch — Track Q Q4, and the regression guard ../docs/backend/BACKEND-INTEGRATION.md §5 exists to close. Written before the checkout money-truth rewrite (F10F16 in the frontend backlog), specifically so that rewrite has a net under it.
smoke.spec.ts App boots, storefront renders, no console errors on first paint.
admin-dev-bypass.spec.ts ?devBypassAdmin=true actually reaches the admin shell without a Telegram login (Track Q F59).
checkout-request-shape.spec.ts The amount actually charged must be computed server-side, never sent by the client (PHASE-1-MONEY-FX-PAYMENTS-CONTRACT.md §5.2). Was red for a real bug, not a harness issue — root-caused 2026-08-21, see the fakeCustomerSession comment and api-headers.interceptor.ts.
checkout-idempotent-click.spec.ts Double-clicking checkout sends exactly one checkout-session request (Track Q F62). Same root cause and fix as above.

Adding a test

  • Prefer existing CSS classes / ARIA roles already in the templates (.currency-button, role="option", etc.) over inventing new selectors — there are no data-testid attributes in this codebase yet, and adding them project-wide is out of scope for this suite.
  • One behavior per test. Name the file after the behavior, not the page.
  • If a test needs backend state that mock data can't produce, mark it test.skip(!process.env.BASE_URL, 'needs a live backend') rather than deleting it — it documents the gap.