Files
marketplaces/e2e
sdarbinyan e5ed1c96e5
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
fix: checkout double-click created two sessions; F59/F62 E2E coverage
E2E found a real, pre-existing bug, not a test artifact: isCheckoutDisabled
only checked terms/auth/delivery-selection, never whether a checkout was
already in flight. A double-click (or any rapid repeat click) fired two
handler calls before showPaymentPopup's change detection had a chance to
cover the button, producing two separate POST /api/v2/storefront/checkout
requests for one click.

Fixed with checkoutInFlight, set synchronously at the top of checkout()
before anything async happens, checked in isCheckoutDisabled. Released in
both closePaymentPopup() (every retry/close path routes through it) and
setPaymentError() directly, since the popup can stay open to show an error
rather than closing - relying on only one of those would leave a failed
attempt unable to retry.

Track Q coverage (F59, F62):

- admin-dev-bypass.spec.ts - proves ?devBypassAdmin=true (already shipped
  in app.ts, gated by @marketplaces/auth's isDevMode() check at runtime)
  actually gets an E2E run into the admin shell without a Telegram login.
  This was the missing piece behind Q2's note that past "verified live"
  admin claims were code-inspection only.
- checkout-idempotent-click.spec.ts - the frontend-testable half of Q5
  ("repeat webhook and double-click create exactly one order"). The
  webhook-idempotency half is a backend contract
  (PHASE-1-MONEY-FX-PAYMENTS-CONTRACT.md §6.3) this suite can't exercise
  without a live backend.

One own test bug fixed en route, not shipped: the idempotency test's first
draft waited on label[for="terms-checkbox"], which does not exist in the
markup (the checkbox and its text share a plain clickable wrapper, no
label/for). checkout-request-shape.spec.ts already had the correct fallback
(dispatchEvent('click') on the input directly) for exactly this reason -
this test just hadn't copied it.

Verified: 237/237 unit tests, arch:check clean, 7/7 E2E, production build
succeeds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 21:57:09 +04:00
..

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-HANDOFF.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/PHASE-1-MONEY-FX-PAYMENTS-CONTRACT.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.

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.