E2E: limit place + cancel tx without conditional test.skip #195

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

Problem statement

Limit order on-chain E2E in frontend-dapp/e2e/limit-orders-tx.spec.ts skips when the first factory pair is paused or prerequisites are missing. Default CI must place and cancel limits with a funded wallet without environment-only skips.

Evidence / context

Proposed solution

  1. CI selects a non-paused pair (or unpauses test pair in deploy script).
  2. Fund dev wallet for bid/ask escrow tokens.
  3. Remove test.skip branches that mask missing setup; fail with clear setup errors.

Acceptance criteria

  • Playwright: place bid or ask, cancel, assert success (tx or balance delta).
  • No skip solely for missing funds / paused default pair on main E2E job.
  • Document in frontend-dapp/e2e/README.md.

Priority

P1

## Problem statement Limit order **on-chain** E2E in [`frontend-dapp/e2e/limit-orders-tx.spec.ts`](frontend-dapp/e2e/limit-orders-tx.spec.ts) skips when the first factory pair is **paused** or prerequisites are missing. Default CI must **place and cancel** limits with a funded wallet without environment-only skips. ## Evidence / context - Backlog **#72**, **#103**; UI smoke in [`limit-orders.spec.ts`](frontend-dapp/e2e/limit-orders.spec.ts). ## Proposed solution 1. CI selects a **non-paused** pair (or unpauses test pair in deploy script). 2. Fund dev wallet for bid/ask escrow tokens. 3. Remove `test.skip` branches that mask missing setup; fail with clear setup errors. ## Acceptance criteria - [ ] Playwright: place bid or ask, cancel, assert success (tx or balance delta). - [ ] No skip solely for missing funds / paused default pair on main E2E job. - [ ] Document in [`frontend-dapp/e2e/README.md`](frontend-dapp/e2e/README.md). ## 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:42:23 +00:00 (Migrated from gitlab.com)

mentioned in commit b83977d2ec

mentioned in commit b83977d2ec4e1fe0e86204c48a77fbb3be36e8ad
PlasticDigits commented 2026-05-26 09:42:30 +00:00 (Migrated from gitlab.com)

Implementation landed on main (b83977d)

@brouie — please verify on a LocalTerra stack when you have a moment.

What changed

  • limit-orders-tx.spec.ts: strict place + cancel path — no test.skip when the first factory pair is paused or setup is missing (default / CI path).
  • Pair selection: LCD walks factory pairs and picks the first dual-CW20 pair with is_paused: false (firstUnpausedDualCwPair in e2e/helpers/lcd.ts).
  • Assertions: success alerts include TX hash; LCD poll expects wasm place_limit_order and cancel_limit_order.
  • Helpers: e2e/helpers/limit-e2e.ts (requireLimitTxPair, selectLimitPairByFactoryIndex, CTA guards); reuses skipOrFailIfPairPaused (L6).
  • Docs / agents: frontend-dapp/e2e/README.md, docs/testing.md, docs/limit-orders.md, new skills/AGENTS_E2E_LIMIT_ORDERS_TX.md (cross-linked with hybrid E2E #193 and dev-wallet skill).

REQUIRE_LOCALTERRA=0 still allows documented skips for jobs without a chain (unchanged pattern).

Verification checklist

  • docker compose up -d localterra
  • bash scripts/deploy-dex-local.sh (creates frontend-dapp/.env.local)
  • cd frontend-dapp && pnpm exec playwright test e2e/limit-orders-tx.spec.ts
  • Both tests pass without skip; place/cancel show .alert-success with TX:
  • Full suite: pnpm exec playwright test (or CI E2E job) still green
  • If first pair is paused locally, tests still pass (selects next unpaused dual-CW20 pair)

Issue left open pending your sign-off.

## Implementation landed on `main` (b83977d) @brouie — please verify on a LocalTerra stack when you have a moment. ### What changed - **`limit-orders-tx.spec.ts`**: strict place + cancel path — no `test.skip` when the first factory pair is paused or setup is missing (default / CI path). - **Pair selection**: LCD walks factory pairs and picks the first **dual-CW20** pair with `is_paused: false` (`firstUnpausedDualCwPair` in `e2e/helpers/lcd.ts`). - **Assertions**: success alerts include TX hash; LCD poll expects wasm `place_limit_order` and `cancel_limit_order`. - **Helpers**: `e2e/helpers/limit-e2e.ts` (`requireLimitTxPair`, `selectLimitPairByFactoryIndex`, CTA guards); reuses `skipOrFailIfPairPaused` (L6). - **Docs / agents**: `frontend-dapp/e2e/README.md`, `docs/testing.md`, `docs/limit-orders.md`, new `skills/AGENTS_E2E_LIMIT_ORDERS_TX.md` (cross-linked with hybrid E2E #193 and dev-wallet skill). `REQUIRE_LOCALTERRA=0` still allows documented skips for jobs without a chain (unchanged pattern). ### Verification checklist - [ ] `docker compose up -d localterra` - [ ] `bash scripts/deploy-dex-local.sh` (creates `frontend-dapp/.env.local`) - [ ] `cd frontend-dapp && pnpm exec playwright test e2e/limit-orders-tx.spec.ts` - [ ] Both tests pass without skip; place/cancel show `.alert-success` with `TX:` - [ ] Full suite: `pnpm exec playwright test` (or CI E2E job) still green - [ ] If first pair is paused locally, tests still pass (selects next unpaused dual-CW20 pair) Issue left **open** pending your sign-off.
PlasticDigits commented 2026-05-27 07:13:05 +00:00 (Migrated from gitlab.com)

Verification (agent)

Note: GitLab IID 1954 does not exist on this project; work targeted #195 (limit place/cancel tx E2E).

Root cause

limit-orders-tx.spec.ts used default UI price 1 on bid side while indexed reference was ~0.90, so the place gate correctly disabled submit. Under bot swarm load, occasional account sequence mismatch errors also caused flaky failures.

Fix (merged to main in d68e1a3 / merge 4b3c4cf)

  • fillValidLimitPrice() — sets bid/ask price relative to resolved reference
  • submitPlaceLimitAndExpectTx() / submitCancelLimitAndExpectTx() — retry with backoff on sequence mismatch
  • Updated e2e/README.md

Verification checklist

  • Playwright e2e/limit-orders-tx.spec.ts — place + cancel, wasm place_limit_order / cancel_limit_order (2/2 passed)
  • No env-only skip on strict path (unpaused pair + provisioned wallet)
  • Documented in frontend-dapp/e2e/README.md
  • Browser MCP: /limits loads Place limit / Cancel limit UI on http://127.0.0.1:3010

Run command

COMPOSE_PROJECT_NAME=cl8y-dex-terraclassic bash scripts/with-node.sh --cwd frontend-dapp -- npx playwright test e2e/limit-orders-tx.spec.ts --project=e2e-tx

## Verification (agent) **Note:** GitLab IID **1954** does not exist on this project; work targeted **#195** (limit place/cancel tx E2E). ### Root cause `limit-orders-tx.spec.ts` used default UI price `1` on **bid** side while indexed reference was ~0.90, so the place gate correctly disabled submit. Under bot swarm load, occasional **account sequence mismatch** errors also caused flaky failures. ### Fix (merged to `main` in `d68e1a3` / merge `4b3c4cf`) - `fillValidLimitPrice()` — sets bid/ask price relative to resolved reference - `submitPlaceLimitAndExpectTx()` / `submitCancelLimitAndExpectTx()` — retry with backoff on sequence mismatch - Updated `e2e/README.md` ### Verification checklist - [x] Playwright `e2e/limit-orders-tx.spec.ts` — place + cancel, wasm `place_limit_order` / `cancel_limit_order` (2/2 passed) - [x] No env-only skip on strict path (unpaused pair + provisioned wallet) - [x] Documented in `frontend-dapp/e2e/README.md` - [x] Browser MCP: `/limits` loads Place limit / Cancel limit UI on http://127.0.0.1:3010 ### Run command `COMPOSE_PROJECT_NAME=cl8y-dex-terraclassic bash scripts/with-node.sh --cwd frontend-dapp -- npx playwright test e2e/limit-orders-tx.spec.ts --project=e2e-tx`
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-27 07:13:07 +00:00
PlasticDigits commented 2026-05-27 07:13:21 +00:00 (Migrated from gitlab.com)

mentioned in commit d68e1a3e03

mentioned in commit d68e1a3e03814161f7633135240e8a318a6bd396
PlasticDigits commented 2026-05-27 07:13:21 +00:00 (Migrated from gitlab.com)

mentioned in commit 4b3c4cf849

mentioned in commit 4b3c4cf849950ba2665170c01ebb1c03818e6025
PlasticDigits commented 2026-05-31 13:52:02 +00:00 (Migrated from gitlab.com)

mentioned in issue #259

mentioned in issue #259
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#195
No description provided.