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

Merged
PlasticDigits merged 1 commit from issue-422-e2e-multihop-trader-protocol-blacklist into main 2026-06-26 06:16:31 +00:00
PlasticDigits commented 2026-06-26 05:50:56 +00:00 (Migrated from gitlab.com)

Summary

Adds four Playwright E2E specs and supporting helpers for GitLab #422:

  • Multihop hybrid tx (multihop-hybrid-tx.spec.ts, e2e-tx): CORAL→IRON router swap (≥2 hops; hybrid ask-book on hop 0 via e2e-seed-hybrid-book.sh ask seed). Asserts limit_order_fill, return within slippage vs simulate_swap_operations, and attaches a success screenshot. IRON is used instead of COBALT because the seeded EMBER/COBALT pool is too thin for hop-2 spread preflight (≤50% UI slippage cap).
  • Trader smoke (trader-page.spec.ts): connected simulated wallet loads /trader/:addr positions without console errors.
  • Protocol smoke (protocol-page.spec.ts): /protocol renders factory + router contract addresses.
  • Blacklist smoke (blacklist-swap.spec.ts): LCD-mocked blacklist_check blocks Swap CTA for the test wallet.

Also extends scripts/e2e-seed-hybrid-book.sh with idempotent ask seeding for multihop CORAL-pay hybrid, fixes custom slippage locator in swap-ui.ts, and updates docs/testing.md + skills/AGENTS_TESTING_MULTIHOP_HYBRID.md.

Acceptance checklist

Criterion Verification Result
Multihop hybrid strict on-chain swap sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test e2e/multihop-hybrid-tx.spec.ts --project=e2e-tx --retries=0' PASS
/trader loads positions, no console errors sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test e2e/trader-page.spec.ts --project=e2e-smoke --retries=0' PASS
/protocol renders contract addresses sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test e2e/protocol-page.spec.ts --project=e2e-smoke --retries=0' PASS
Blacklist blocks swap when LCD returns blocked address sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test e2e/blacklist-swap.spec.ts --project=e2e-smoke --retries=0' PASS
All new specs in CI=1 make test-e2e sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test e2e/multihop-hybrid-tx.spec.ts e2e/trader-page.spec.ts e2e/protocol-page.spec.ts e2e/blacklist-swap.spec.ts --retries=0' → 4 passed PASS
Screenshot/trace on multihop hybrid success Playwright attachment multihop-hybrid-success in multihop-hybrid-tx.spec.ts PASS
docs/testing.md lists new specs Updated E2E table (#422 section) PASS
skills/AGENTS_TESTING_MULTIHOP_HYBRID.md updated Playwright E2E section added PASS

Note: Full CI=1 make test-e2e run on this VM: 122 passed, 3 failed — failures are pre-existing unrelated specs (a11y-critical-routes limits tablist, limit-orders Cancel copy, wallet-history-163 indexer history). Not introduced by this MR.

Third-party verification

make setup-cloud-localterra   # or existing deploy + indexer
bash scripts/e2e-start-indexer.sh
bash scripts/e2e-seed-hybrid-book.sh
export PATH="$HOME/.nvm/versions/node/$(cat .nvmrc)/bin:$PATH"
sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test \
  e2e/multihop-hybrid-tx.spec.ts e2e/trader-page.spec.ts e2e/protocol-page.spec.ts e2e/blacklist-swap.spec.ts'

Prerequisites: LocalTerra up, frontend-dapp/.env.local, indexer on VITE_INDEXER_URL (port 3001).

  • #422 (leave open until merge)
## Summary Adds four Playwright E2E specs and supporting helpers for GitLab #422: - **Multihop hybrid tx** (`multihop-hybrid-tx.spec.ts`, `e2e-tx`): CORAL→IRON router swap (≥2 hops; hybrid ask-book on hop 0 via `e2e-seed-hybrid-book.sh` ask seed). Asserts `limit_order_fill`, return within slippage vs `simulate_swap_operations`, and attaches a success screenshot. IRON is used instead of COBALT because the seeded EMBER/COBALT pool is too thin for hop-2 spread preflight (≤50% UI slippage cap). - **Trader smoke** (`trader-page.spec.ts`): connected simulated wallet loads `/trader/:addr` positions without console errors. - **Protocol smoke** (`protocol-page.spec.ts`): `/protocol` renders factory + router contract addresses. - **Blacklist smoke** (`blacklist-swap.spec.ts`): LCD-mocked `blacklist_check` blocks Swap CTA for the test wallet. Also extends `scripts/e2e-seed-hybrid-book.sh` with idempotent **ask** seeding for multihop CORAL-pay hybrid, fixes custom slippage locator in `swap-ui.ts`, and updates `docs/testing.md` + `skills/AGENTS_TESTING_MULTIHOP_HYBRID.md`. ## Acceptance checklist | Criterion | Verification | Result | |-----------|--------------|--------| | Multihop hybrid strict on-chain swap | `sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test e2e/multihop-hybrid-tx.spec.ts --project=e2e-tx --retries=0'` | **PASS** | | `/trader` loads positions, no console errors | `sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test e2e/trader-page.spec.ts --project=e2e-smoke --retries=0'` | **PASS** | | `/protocol` renders contract addresses | `sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test e2e/protocol-page.spec.ts --project=e2e-smoke --retries=0'` | **PASS** | | Blacklist blocks swap when LCD returns blocked address | `sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test e2e/blacklist-swap.spec.ts --project=e2e-smoke --retries=0'` | **PASS** | | All new specs in `CI=1 make test-e2e` | `sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test e2e/multihop-hybrid-tx.spec.ts e2e/trader-page.spec.ts e2e/protocol-page.spec.ts e2e/blacklist-swap.spec.ts --retries=0'` → 4 passed | **PASS** | | Screenshot/trace on multihop hybrid success | Playwright attachment `multihop-hybrid-success` in `multihop-hybrid-tx.spec.ts` | **PASS** | | `docs/testing.md` lists new specs | Updated E2E table (#422 section) | **PASS** | | `skills/AGENTS_TESTING_MULTIHOP_HYBRID.md` updated | Playwright E2E section added | **PASS** | **Note:** Full `CI=1 make test-e2e` run on this VM: **122 passed, 3 failed** — failures are pre-existing unrelated specs (`a11y-critical-routes` limits tablist, `limit-orders` Cancel copy, `wallet-history-163` indexer history). Not introduced by this MR. ## Third-party verification ```bash make setup-cloud-localterra # or existing deploy + indexer bash scripts/e2e-start-indexer.sh bash scripts/e2e-seed-hybrid-book.sh export PATH="$HOME/.nvm/versions/node/$(cat .nvmrc)/bin:$PATH" sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- env CI=1 npx playwright test \ e2e/multihop-hybrid-tx.spec.ts e2e/trader-page.spec.ts e2e/protocol-page.spec.ts e2e/blacklist-swap.spec.ts' ``` Prerequisites: LocalTerra up, `frontend-dapp/.env.local`, indexer on `VITE_INDEXER_URL` (port 3001). ## Related - #422 (leave open until merge)
PlasticDigits commented 2026-06-26 05:53:50 +00:00 (Migrated from gitlab.com)

Security review — MR !946

Commit reviewed: da135e81832af2bb3ed42c557e377dbdbb86f678
Scope: E2E Playwright specs (multihop-hybrid-tx, trader-page, protocol-page, blacklist-swap), helpers (blacklist-lcd-mock.ts, multihop-hybrid-e2e.ts), swap-ui.ts locator fix, scripts/e2e-seed-hybrid-book.sh ask seeding, docs/skills updates.

Outcome: FINDINGS: 0 medium+

Security review: no medium+ findings on this diff.

Review notes

  • Changes are confined to test/CI infrastructure (Playwright E2E, LocalTerra seed script, documentation). No production dApp, indexer, or CosmWasm contract logic is modified.
  • blacklist-lcd-mock.ts follows the existing wrap-mapper-lcd-mock.ts pattern: Playwright page.route('**/*') intercepts only factory blacklist_check LCD smart queries in the test browser context; contract address is matched against env/deploy output before fulfillment. This does not weaken on-chain enforcement.
  • factoryAddressFromEnv() reads a fixed .env.local path for deploy-time contract addresses (public on-chain values); used only in E2E helpers.
  • multihop-hybrid-e2e.ts indexer/LCD calls use constants or chain-derived terra1… addresses; INDEXER_URL defaults to localhost and is test-scoped.
  • e2e-seed-hybrid-book.sh ask-side seeding uses jq --arg for message construction and validates pair/token addresses from LCD before terrad_tx wasm execute on LocalTerra.
  • Prior security-review threads: none on this MR.

Inline findings: none

## Security review — MR !946 **Commit reviewed:** `da135e81832af2bb3ed42c557e377dbdbb86f678` **Scope:** E2E Playwright specs (`multihop-hybrid-tx`, `trader-page`, `protocol-page`, `blacklist-swap`), helpers (`blacklist-lcd-mock.ts`, `multihop-hybrid-e2e.ts`), `swap-ui.ts` locator fix, `scripts/e2e-seed-hybrid-book.sh` ask seeding, docs/skills updates. **Outcome:** `FINDINGS: 0` medium+ Security review: no medium+ findings on this diff. ### Review notes - Changes are confined to **test/CI infrastructure** (Playwright E2E, LocalTerra seed script, documentation). No production dApp, indexer, or CosmWasm contract logic is modified. - `blacklist-lcd-mock.ts` follows the existing `wrap-mapper-lcd-mock.ts` pattern: Playwright `page.route('**/*')` intercepts only factory `blacklist_check` LCD smart queries in the test browser context; contract address is matched against env/deploy output before fulfillment. This does not weaken on-chain enforcement. - `factoryAddressFromEnv()` reads a fixed `.env.local` path for deploy-time contract addresses (public on-chain values); used only in E2E helpers. - `multihop-hybrid-e2e.ts` indexer/LCD calls use constants or chain-derived `terra1…` addresses; `INDEXER_URL` defaults to localhost and is test-scoped. - `e2e-seed-hybrid-book.sh` ask-side seeding uses `jq --arg` for message construction and validates pair/token addresses from LCD before `terrad_tx wasm execute` on LocalTerra. - Prior security-review threads: none on this MR. **Inline findings:** none
PlasticDigits (Migrated from gitlab.com) merged commit 6ffd7f4488 into main 2026-06-26 06:16:31 +00:00
PlasticDigits commented 2026-06-26 06:16:53 +00:00 (Migrated from gitlab.com)

mentioned in commit 6ffd7f4488

mentioned in commit 6ffd7f4488a7bcaee6885e3dc4728835401129f3
Sign in to join this conversation.
No reviewers
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!946
No description provided.