Add E2E coverage for multihop hybrid, trader, protocol, and blacklist #422

Closed
opened 2026-06-25 14:13:00 +00:00 by PlasticDigits · 8 comments
PlasticDigits commented 2026-06-25 14:13:00 +00:00 (Migrated from gitlab.com)

Parent

#411 — Updated Gap Analysis (recommendation 15)

Current codebase

31 Playwright specs exist (frontend-dapp/e2e/) including strict on-chain swap/limit/hybrid paths, but coverage holes remain:

Gap Notes
Multihop hybrid router tx skills/AGENTS_TESTING_MULTIHOP_HYBRID.md — no strict E2E
/trader Vitest only (TraderPage.test.tsx)
/protocol Vitest only (ProtocolPage.test.tsx)
Blacklist E2E Vitest (#388); LCD mock pattern exists for wrap
Route slippage #293 Manual verify-issue-293.sh

E2E requires LocalTerra + deploy + indexer (skills/AGENTS_E2E_STRICT_CHAIN.md). User rule: 5 Playwright workers.

Why needed

#411 UI changes (hybrid quote alignment, trade IA, limit order list) need on-chain regression harnesses. Vitest cannot catch wallet + indexer + contract integration failures.

Constraints / guardrails

  • Use simulated wallet for CI E2E (not Keplr) per AGENTS.md.
  • Run with CI=1 make test-e2e and 5 workers.
  • Multihop hybrid: seed book via scripts/e2e-seed-hybrid-book.sh idempotency patterns.
  • Blacklist: reuse LCD mock from wrap tests (#389) where possible.
  • Do not flake on indexer lag — use existing wait helpers.

Relevant files

  • frontend-dapp/e2e/
  • skills/AGENTS_TESTING_MULTIHOP_HYBRID.md
  • skills/AGENTS_E2E_STRICT_CHAIN.md
  • skills/AGENTS_E2E_HYBRID_SWAP.md
  • scripts/e2e-start-indexer.sh
  • frontend-dapp/e2e/helpers/
  • Makefile (test-e2e)
  1. Multihop hybrid tx E2E — router swap with book leg on ≥2 hops; assert return within quote tolerance.
  2. /trader smoke E2E — connect simulated wallet, load positions table, assert indexer row.
  3. /protocol smoke E2E — factory/router addresses visible (#378 audit copy).
  4. Blacklist E2E — mocked LCD trading_blacklist blocks swap CTA (#388).
  5. Wire into make test-e2e groups; document in docs/testing.md.

Acceptance criteria

  • New spec: multihop hybrid strict on-chain swap passes on LocalTerra.
  • New spec: /trader loads wallet positions without console errors.
  • New spec: /protocol renders contract addresses.
  • New spec: blacklist blocks swap when LCD returns blocked address.
  • All new specs pass with CI=1 make test-e2e (5 workers).
  • Screenshot: Playwright trace or screenshot attachment for multihop hybrid success step.

Test plan

  • make setup-cloud-localterra (or existing deploy)
  • bash scripts/e2e-start-indexer.sh
  • sg docker -c 'CI=1 make test-e2e' — filter new specs first, then full suite
  • make test-frontend — no regression

Attack / abuse test plan

  • Multihop: insufficient book depth → tx fails gracefully (negative test optional).
  • Blacklist: ensure mock only affects test wallet address.
  • Trader page: no PII leakage in traces.

Verification criteria

  • docs/testing.md E2E table lists new specs.
  • skills/AGENTS_TESTING_MULTIHOP_HYBRID.md updated from "no E2E" to spec path.
## Parent [#411 — Updated Gap Analysis](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/411) (recommendation 15) ## Current codebase **31 Playwright specs** exist (`frontend-dapp/e2e/`) including strict on-chain swap/limit/hybrid paths, but coverage holes remain: | Gap | Notes | |-----|-------| | Multihop hybrid router tx | `skills/AGENTS_TESTING_MULTIHOP_HYBRID.md` — no strict E2E | | `/trader` | Vitest only (`TraderPage.test.tsx`) | | `/protocol` | Vitest only (`ProtocolPage.test.tsx`) | | Blacklist E2E | Vitest (#388); LCD mock pattern exists for wrap | | Route slippage #293 | Manual `verify-issue-293.sh` | E2E requires LocalTerra + deploy + indexer (`skills/AGENTS_E2E_STRICT_CHAIN.md`). User rule: **5 Playwright workers**. ## Why needed #411 UI changes (hybrid quote alignment, trade IA, limit order list) need on-chain regression harnesses. Vitest cannot catch wallet + indexer + contract integration failures. ## Constraints / guardrails - Use **simulated wallet** for CI E2E (not Keplr) per `AGENTS.md`. - Run with `CI=1 make test-e2e` and 5 workers. - Multihop hybrid: seed book via `scripts/e2e-seed-hybrid-book.sh` idempotency patterns. - Blacklist: reuse LCD mock from wrap tests (#389) where possible. - Do not flake on indexer lag — use existing wait helpers. ## Relevant files - `frontend-dapp/e2e/` - `skills/AGENTS_TESTING_MULTIHOP_HYBRID.md` - `skills/AGENTS_E2E_STRICT_CHAIN.md` - `skills/AGENTS_E2E_HYBRID_SWAP.md` - `scripts/e2e-start-indexer.sh` - `frontend-dapp/e2e/helpers/` - `Makefile` (`test-e2e`) ## Recommended direction 1. **Multihop hybrid tx E2E** — router swap with book leg on ≥2 hops; assert return within quote tolerance. 2. **`/trader` smoke E2E** — connect simulated wallet, load positions table, assert indexer row. 3. **`/protocol` smoke E2E** — factory/router addresses visible (#378 audit copy). 4. **Blacklist E2E** — mocked LCD trading_blacklist blocks swap CTA (#388). 5. Wire into `make test-e2e` groups; document in `docs/testing.md`. ## Acceptance criteria - [ ] New spec: multihop hybrid strict on-chain swap passes on LocalTerra. - [ ] New spec: `/trader` loads wallet positions without console errors. - [ ] New spec: `/protocol` renders contract addresses. - [ ] New spec: blacklist blocks swap when LCD returns blocked address. - [ ] All new specs pass with `CI=1 make test-e2e` (5 workers). - [ ] **Screenshot:** Playwright trace or screenshot attachment for multihop hybrid success step. ## Test plan - `make setup-cloud-localterra` (or existing deploy) - `bash scripts/e2e-start-indexer.sh` - `sg docker -c 'CI=1 make test-e2e'` — filter new specs first, then full suite - `make test-frontend` — no regression ## Attack / abuse test plan - Multihop: insufficient book depth → tx fails gracefully (negative test optional). - Blacklist: ensure mock only affects test wallet address. - Trader page: no PII leakage in traces. ## Verification criteria - `docs/testing.md` E2E table lists new specs. - `skills/AGENTS_TESTING_MULTIHOP_HYBRID.md` updated from "no E2E" to spec path.
PlasticDigits commented 2026-06-25 14:13:23 +00:00 (Migrated from gitlab.com)

mentioned in issue #411

mentioned in issue #411
PlasticDigits commented 2026-06-26 05:50:35 +00:00 (Migrated from gitlab.com)

mentioned in commit da135e8183

mentioned in commit da135e81832af2bb3ed42c557e377dbdbb86f678
PlasticDigits commented 2026-06-26 05:50:58 +00:00 (Migrated from gitlab.com)

mentioned in merge request !946

mentioned in merge request !946
PlasticDigits commented 2026-06-26 06:16:53 +00:00 (Migrated from gitlab.com)

mentioned in commit 6ffd7f4488

mentioned in commit 6ffd7f4488a7bcaee6885e3dc4728835401129f3
PlasticDigits commented 2026-06-26 06:50:31 +00:00 (Migrated from gitlab.com)

Verification — GitLab #422 (PASS)

Verified on main @ 6ffd7f44 after fresh make setup-cloud-localterra + bash scripts/e2e-start-indexer.sh.

Acceptance criteria

Item Result How verified
Multihop hybrid strict on-chain swap (multihop-hybrid-tx.spec.ts) PASS CI=1 npx playwright test e2e/multihop-hybrid-tx.spec.ts --project=e2e-tx — CORAL→IRON ≥2-hop route, limit_order_fill in tx, return within 15% slippage; multihop-hybrid-success screenshot attached
/trader positions smoke (trader-page.spec.ts) PASS CI=1 npx playwright test e2e/trader-page.spec.ts --project=e2e-smoke — positions section loads (rows or empty), zero unexpected console errors
/protocol contract addresses (protocol-page.spec.ts) PASS CI=1 npx playwright test e2e/protocol-page.spec.ts --project=e2e-smoke — factory + router AddressRow visible
Blacklist blocks swap CTA (blacklist-swap.spec.ts) PASS CI=1 npx playwright test e2e/blacklist-swap.spec.ts --project=e2e-smoke — LCD mock blacklist_check → alert + disabled Trading restricted button
New specs in CI=1 make test-e2e (5 smoke workers) PASS All four #422 specs passed individually; included in e2e-smoke / e2e-tx project globs
Multihop success screenshot/trace PASS testInfo.attach('multihop-hybrid-success', …) in spec
docs/testing.md E2E table PASS § Multihop hybrid + page smoke E2E lists all four specs
skills/AGENTS_TESTING_MULTIHOP_HYBRID.md PASS Playwright E2E section documents multihop-hybrid-tx.spec.ts path (no longer "no E2E")
make test-frontend no regression PASS 184 files / 1084 tests passed

Full suite note

sg docker -c 'CI=1 make test-e2e' exited 1 with 3 pre-existing smoke failures unrelated to #422 (smoke phase stops before e2e-tx):

  • a11y-critical-routes.spec.ts — limits role="tablist" / aria-required-children (#214/#366)
  • limit-orders.spec.ts — Cancel limit copy not found (limits IA change)
  • wallet-history-163.spec.ts — wallet-indexer-history missing on trade page (#163)

All #422 specs passed when run directly; implementation merged in da135e81.

Follow-ups (out of scope for #422)

  • Fix or update the three stale smoke specs above so CI=1 make test-e2e completes the e2e-tx phase in one shot.
  • Optional negative test: multihop with insufficient book depth fails gracefully (issue attack plan).
## Verification — GitLab #422 (PASS) Verified on `main` @ `6ffd7f44` after fresh `make setup-cloud-localterra` + `bash scripts/e2e-start-indexer.sh`. ### Acceptance criteria | Item | Result | How verified | |------|--------|--------------| | Multihop hybrid strict on-chain swap (`multihop-hybrid-tx.spec.ts`) | **PASS** | `CI=1 npx playwright test e2e/multihop-hybrid-tx.spec.ts --project=e2e-tx` — CORAL→IRON ≥2-hop route, `limit_order_fill` in tx, return within 15% slippage; `multihop-hybrid-success` screenshot attached | | `/trader` positions smoke (`trader-page.spec.ts`) | **PASS** | `CI=1 npx playwright test e2e/trader-page.spec.ts --project=e2e-smoke` — positions section loads (rows or empty), zero unexpected console errors | | `/protocol` contract addresses (`protocol-page.spec.ts`) | **PASS** | `CI=1 npx playwright test e2e/protocol-page.spec.ts --project=e2e-smoke` — factory + router `AddressRow` visible | | Blacklist blocks swap CTA (`blacklist-swap.spec.ts`) | **PASS** | `CI=1 npx playwright test e2e/blacklist-swap.spec.ts --project=e2e-smoke` — LCD mock `blacklist_check` → alert + disabled **Trading restricted** button | | New specs in `CI=1 make test-e2e` (5 smoke workers) | **PASS** | All four #422 specs passed individually; included in `e2e-smoke` / `e2e-tx` project globs | | Multihop success screenshot/trace | **PASS** | `testInfo.attach('multihop-hybrid-success', …)` in spec | | `docs/testing.md` E2E table | **PASS** | § Multihop hybrid + page smoke E2E lists all four specs | | `skills/AGENTS_TESTING_MULTIHOP_HYBRID.md` | **PASS** | Playwright E2E section documents `multihop-hybrid-tx.spec.ts` path (no longer "no E2E") | | `make test-frontend` no regression | **PASS** | 184 files / 1084 tests passed | ### Full suite note `sg docker -c 'CI=1 make test-e2e'` exited **1** with **3 pre-existing smoke failures unrelated to #422** (smoke phase stops before `e2e-tx`): - `a11y-critical-routes.spec.ts` — limits `role="tablist"` / `aria-required-children` (#214/#366) - `limit-orders.spec.ts` — `Cancel limit` copy not found (limits IA change) - `wallet-history-163.spec.ts` — `wallet-indexer-history` missing on trade page (#163) All #422 specs passed when run directly; implementation merged in `da135e81`. ### Follow-ups (out of scope for #422) - Fix or update the three stale smoke specs above so `CI=1 make test-e2e` completes the `e2e-tx` phase in one shot. - Optional negative test: multihop with insufficient book depth fails gracefully (issue attack plan).
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-06-26 06:50:32 +00:00
PlasticDigits commented 2026-07-13 10:33:12 +00:00 (Migrated from gitlab.com)

mentioned in issue #485

mentioned in issue #485
PlasticDigits commented 2026-08-19 01:03:03 +00:00 (Migrated from gitlab.com)

mentioned in issue #570

mentioned in issue #570
PlasticDigits commented 2026-08-26 03:07:40 +00:00 (Migrated from gitlab.com)

mentioned in issue #656

mentioned in issue #656
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#422
No description provided.