E2E: hybrid swap tx path without conditional test.skip #193

Closed
opened 2026-05-26 07:59:26 +00:00 by PlasticDigits · 6 comments
PlasticDigits commented 2026-05-26 07:59:26 +00:00 (Migrated from gitlab.com)

Problem statement

frontend-dapp/e2e/hybrid-swap.spec.ts uses conditional test.skip (no dual-CW20 pair, paused pair, no route, no balance). Default CI/local path must execute a funded hybrid swap and assert book + pool legs without skipping for environment gaps alone.

Evidence / context

Proposed solution

  1. CI/local setup: seed resting limits + fund dev wallet so hybrid path is always available on the default pair.
  2. Replace conditional skips with hard failures when prerequisites missing (or dedicated test.describe.configure project that guarantees chain state).
  3. Assert tx success, wasm events (book_return_amount / hybrid disclosure UI).

Acceptance criteria

  • Default Playwright job runs hybrid swap E2E without test.skip for missing funds/pair/route.
  • Document required env in frontend-dapp/e2e/README.md.
  • CI workflow seeds chain state or fails fast with actionable error (not silent skip).

Priority

P1

## Problem statement [`frontend-dapp/e2e/hybrid-swap.spec.ts`](frontend-dapp/e2e/hybrid-swap.spec.ts) uses **conditional `test.skip`** (no dual-CW20 pair, paused pair, no route, no balance). Default CI/local path must **execute** a funded hybrid swap and assert book + pool legs without skipping for environment gaps alone. ## Evidence / context - Backlog **#103**, **#79**; [`docs/testing.md`](docs/testing.md). - LocalTerra + `make deploy-local` + dev wallet funding policy in [`scripts/qa/README.md`](scripts/qa/README.md). ## Proposed solution 1. CI/local setup: seed resting limits + fund dev wallet so hybrid path is always available on the default pair. 2. Replace conditional skips with **hard failures** when prerequisites missing (or dedicated `test.describe.configure` project that guarantees chain state). 3. Assert tx success, wasm events (`book_return_amount` / hybrid disclosure UI). ## Acceptance criteria - [ ] Default Playwright job runs hybrid swap E2E **without** `test.skip` for missing funds/pair/route. - [ ] Document required env in [`frontend-dapp/e2e/README.md`](frontend-dapp/e2e/README.md). - [ ] CI workflow seeds chain state or fails fast with actionable error (not silent skip). ## Priority **P1**
PlasticDigits commented 2026-05-26 08:00:43 +00:00 (Migrated from gitlab.com)

mentioned in issue #201

mentioned in issue #201
PlasticDigits commented 2026-05-26 09:39:34 +00:00 (Migrated from gitlab.com)

mentioned in commit 947ff8cdfc

mentioned in commit 947ff8cdfca903c3b963657313752ade920f5dd6
PlasticDigits commented 2026-05-26 09:39:41 +00:00 (Migrated from gitlab.com)

Implementation (merged to main @ 947ff8c)

Replaced conditional test.skip on the default Playwright path with strict prerequisite checks and chain seeding for hybrid swap E2E (GitLab #193).

What changed

  • scripts/e2e-seed-hybrid-book.sh — idempotently places a resting bid on the first dual-CW20 factory pair (hybrid book legs paying token0 match bids). Env: E2E_HYBRID_SEED_BID_ESCROW, E2E_HYBRID_SEED_BID_PRICE.
  • frontend-dapp/e2e/global-setup.ts — runs the seed after e2e-provision-dev-wallet.sh.
  • frontend-dapp/e2e/helpers/hybrid-e2e.ts — requireDualCwPair, requireHybridControlsVisible, skipOrFailIfPairPaused, assertHybridSwapCtaNotBlocked (strict vs REQUIRE_LOCALTERRA=0 optional skips).
  • frontend-dapp/e2e/hybrid-swap.spec.ts — hard failures for missing pair/route/balance/pause on default path; on-chain case asserts limit_order_fill and positive book_return_amount on the swap wasm event.
  • Docs / agent playbooks — docs/testing.md, frontend-dapp/e2e/README.md, docs/limit-orders.md, skills/AGENTS_E2E_HYBRID_SWAP.md (cross-linked from AGENTS_HYBRID_QUOTING.md).

Verification checklist

  • docker compose up -d localterra && bash scripts/deploy-dex-local.sh
  • cd frontend-dapp && pnpm exec playwright test e2e/hybrid-swap.spec.ts — 3 passed, no skips on default path
  • Global setup logs show e2e-seed-hybrid-book: resting bid seeded (or skip when head already set)
  • On-chain test tx includes wasm limit_order_fill and book_return_amount > 0
  • UI disclosure test shows hybrid execution summary (Hybrid (pool + limit book) or Indexer hybrid) + limit-book alert doc link
  • Optional: REQUIRE_LOCALTERRA=0 pnpm exec playwright test e2e/hybrid-swap.spec.ts still skips when LCD absent

@brouie — please run the checklist on a fresh LocalTerra deploy when you have a moment and confirm the default CI E2E job stays green.

Leaving this issue open until verified.

## Implementation (merged to `main` @ 947ff8c) Replaced conditional `test.skip` on the **default** Playwright path with strict prerequisite checks and chain seeding for hybrid swap E2E ([GitLab #193](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/193)). ### What changed - **`scripts/e2e-seed-hybrid-book.sh`** — idempotently places a resting **bid** on the first dual-CW20 factory pair (hybrid book legs paying token0 match bids). Env: `E2E_HYBRID_SEED_BID_ESCROW`, `E2E_HYBRID_SEED_BID_PRICE`. - **`frontend-dapp/e2e/global-setup.ts`** — runs the seed after `e2e-provision-dev-wallet.sh`. - **`frontend-dapp/e2e/helpers/hybrid-e2e.ts`** — `requireDualCwPair`, `requireHybridControlsVisible`, `skipOrFailIfPairPaused`, `assertHybridSwapCtaNotBlocked` (strict vs `REQUIRE_LOCALTERRA=0` optional skips). - **`frontend-dapp/e2e/hybrid-swap.spec.ts`** — hard failures for missing pair/route/balance/pause on default path; on-chain case asserts `limit_order_fill` **and** positive `book_return_amount` on the `swap` wasm event. - **Docs / agent playbooks** — `docs/testing.md`, `frontend-dapp/e2e/README.md`, `docs/limit-orders.md`, `skills/AGENTS_E2E_HYBRID_SWAP.md` (cross-linked from `AGENTS_HYBRID_QUOTING.md`). ### Verification checklist - [ ] `docker compose up -d localterra && bash scripts/deploy-dex-local.sh` - [ ] `cd frontend-dapp && pnpm exec playwright test e2e/hybrid-swap.spec.ts` — **3 passed**, no skips on default path - [ ] Global setup logs show `e2e-seed-hybrid-book: resting bid seeded` (or skip when head already set) - [ ] On-chain test tx includes wasm `limit_order_fill` and `book_return_amount` > 0 - [ ] UI disclosure test shows hybrid execution summary (`Hybrid (pool + limit book)` or `Indexer hybrid`) + limit-book alert doc link - [ ] Optional: `REQUIRE_LOCALTERRA=0 pnpm exec playwright test e2e/hybrid-swap.spec.ts` still skips when LCD absent @brouie — please run the checklist on a fresh LocalTerra deploy when you have a moment and confirm the default CI E2E job stays green. Leaving this issue **open** until verified.
PlasticDigits commented 2026-05-26 09:42:31 +00:00 (Migrated from gitlab.com)

mentioned in issue #195

mentioned in issue #195
PlasticDigits commented 2026-05-27 06:40:28 +00:00 (Migrated from gitlab.com)

mentioned in commit c99b4174fe

mentioned in commit c99b4174fe820860d406d95c483e970284c665a9
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-27 06:40:45 +00:00
PlasticDigits commented 2026-05-27 06:40:46 +00:00 (Migrated from gitlab.com)

Verification complete (2026-05-27)

Verified GitLab #193 on LocalTerra + deployed factory + indexer. 3/3 hybrid-swap Playwright tests pass on the strict default path (--project=e2e-tx), with no test.skip for missing funds/pair/route.

Checklist

  • LocalTerra up + factory deployed (existing .env.local; shared compose project)
  • npx playwright test e2e/hybrid-swap.spec.ts --project=e2e-tx — 3 passed, no skips
  • Global setup: e2e-seed-hybrid-book: bid book already has head order …; skipping (idempotent re-run)
  • On-chain test tx includes wasm limit_order_fill and book_return_amount > 0
  • UI disclosure test shows hybrid execution summary + limit-book doc link
  • Acceptance criteria: strict helpers + seed scripts documented in frontend-dapp/e2e/README.md; CI workflow runs deploy + global setup (.github/workflows/test.yml)

Fixes merged to main @ c99b417

  1. scripts/lib/e2e-terrad-tx.sh — retry terrad tx on account sequence mismatch (bot swarm / concurrent LocalTerra traffic during global setup).
  2. frontend-dapp/e2e/hybrid-swap.spec.ts — on-chain case relies on global-setup book seed instead of placing a UI bid at price 1 (invalid vs live reference); scoped success alert to swap panel.

Notes

  • E2E tx tests need the dev wallet (test1) not contending with the 30-worker bot swarm; swarm was stopped for the test run and relaunched after.
  • Cursor browser MCP was unavailable in this environment; UI assertions were covered by passing Playwright specs + frontend dev server smoke on :3000.
## Verification complete (2026-05-27) Verified GitLab #193 on LocalTerra + deployed factory + indexer. **3/3** hybrid-swap Playwright tests pass on the strict default path (`--project=e2e-tx`), with **no `test.skip`** for missing funds/pair/route. ### Checklist - [x] LocalTerra up + factory deployed (existing `.env.local`; shared compose project) - [x] `npx playwright test e2e/hybrid-swap.spec.ts --project=e2e-tx` — **3 passed**, no skips - [x] Global setup: `e2e-seed-hybrid-book: bid book already has head order …; skipping` (idempotent re-run) - [x] On-chain test tx includes wasm `limit_order_fill` and `book_return_amount` > 0 - [x] UI disclosure test shows hybrid execution summary + limit-book doc link - [x] Acceptance criteria: strict helpers + seed scripts documented in `frontend-dapp/e2e/README.md`; CI workflow runs deploy + global setup (`.github/workflows/test.yml`) ### Fixes merged to `main` @ c99b417 1. **`scripts/lib/e2e-terrad-tx.sh`** — retry `terrad tx` on account sequence mismatch (bot swarm / concurrent LocalTerra traffic during global setup). 2. **`frontend-dapp/e2e/hybrid-swap.spec.ts`** — on-chain case relies on global-setup book seed instead of placing a UI bid at price `1` (invalid vs live reference); scoped success alert to swap panel. ### Notes - E2E tx tests need the dev wallet (`test1`) not contending with the 30-worker bot swarm; swarm was stopped for the test run and relaunched after. - Cursor browser MCP was unavailable in this environment; UI assertions were covered by passing Playwright specs + frontend dev server smoke on `:3000`.
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#193
No description provided.