test(e2e): pool-tx must fail (not skip); provision funds for local Playwright wallet #103

Closed
opened 2026-04-22 03:24:07 +00:00 by PlasticDigits · 8 comments
PlasticDigits commented 2026-04-22 03:24:07 +00:00 (Migrated from gitlab.com)

Summary

Pool provide / withdraw E2E tests must fail the build when preconditions are not met (funded dev wallet, LCD up, CTA not blocked) instead of silently skipping with test.skip, which masks regressions in the pool transaction path.

Current baseline (repo)

  • frontend-dapp/e2e/pool-tx.spec.ts (and similar patterns in wrap-pool.spec.ts, etc.): on Insufficient or Connect submit label, calls test.skip(true, '... fund the dev wallet ...').
  • e2e/helpers/chain.ts — skipIfLcdUnreachable and others skip if LCD is down.
  • e2e/fixtures/dev-wallet.ts — connects Simulated Wallet (fixed address) but does not assert chain balance or pre-fund for pool amounts.

Requirements

  • E2E harness must provision funds to the test wallet on the local chain used by Playwright (LocalTerra or compose stack): e.g. genesis adjustment, tax-free faucet script, or terrad tx bank send in globalSetup / fixture before pool tests.
  • Replace skip with expect.fail or hard throw for pool-tx when:
    • LCD unreachable (or split into a separate optional job if product insists on “no chain in CI” — default should be required job with chain).
    • CTA still shows Insufficient after funding step.
  • Document the exact denoms/tokens and minimum amounts the suite requires in docs/testing.md or e2e/README.md.
  • Align with 5 workers policy in playwright.config.ts (do not break stability when funding in parallel — use per-worker accounts or idempotent funding).

Acceptance criteria

  • pool-tx.spec.ts has no test.skip for “fund the dev wallet” on the default CI path.
  • A single command (pnpm exec playwright test e2e/pool-tx.spec.ts or equivalent) is documented and passes on a fresh localnet when followed.
  • If chain is intentionally absent, an explicit env flag (e.g. REQUIRE_LOCALTERRA=0) may downgrade — document; default = strict.

References

  • frontend-dapp/e2e/pool-tx.spec.ts
  • frontend-dapp/e2e/helpers/chain.ts
  • frontend-dapp/e2e/fixtures/dev-wallet.ts
  • .cursor/rules/playwright-workers.mdc — workers=5

Labels suggested

testing, e2e, frontend, infra, launch-blocker

## Summary **Pool provide / withdraw** E2E tests must **fail the build** when preconditions are not met (funded dev wallet, LCD up, CTA not blocked) instead of **silently skipping** with `test.skip`, which **masks regressions** in the pool transaction path. ## Current baseline (repo) - `frontend-dapp/e2e/pool-tx.spec.ts` (and similar patterns in `wrap-pool.spec.ts`, etc.): on **Insufficient** or **Connect** submit label, calls `test.skip(true, '... fund the dev wallet ...')`. - `e2e/helpers/chain.ts` — `skipIfLcdUnreachable` and others skip if LCD is down. - `e2e/fixtures/dev-wallet.ts` — connects **Simulated Wallet** (fixed address) but does **not** assert chain balance or pre-fund for pool amounts. ## Requirements - **E2E harness** must **provision funds** to the test wallet on the **local chain** used by Playwright (LocalTerra or compose stack): e.g. genesis adjustment, `tax`-free faucet script, or `terrad tx bank send` in `globalSetup` / fixture **before** pool tests. - **Replace skip with expect.fail or hard throw** for pool-tx when: - LCD unreachable (or split into a **separate** optional job if product insists on “no chain in CI” — default should be **required job with chain**). - CTA still shows **Insufficient** after funding step. - **Document** the exact **denoms/tokens** and **minimum amounts** the suite requires in `docs/testing.md` or `e2e/README.md`. - Align with **5 workers** policy in `playwright.config.ts` (do not break stability when funding in parallel — use per-worker accounts or idempotent funding). ## Acceptance criteria - [ ] `pool-tx.spec.ts` has **no** `test.skip` for “fund the dev wallet” on the **default** CI path. - [ ] A single command (`pnpm exec playwright test e2e/pool-tx.spec.ts` or equivalent) is documented and passes on a **fresh** localnet when followed. - [ ] If chain is intentionally absent, an **explicit** env flag (e.g. `REQUIRE_LOCALTERRA=0`) may downgrade — document; **default = strict**. ## References - `frontend-dapp/e2e/pool-tx.spec.ts` - `frontend-dapp/e2e/helpers/chain.ts` - `frontend-dapp/e2e/fixtures/dev-wallet.ts` - `.cursor/rules/playwright-workers.mdc` — workers=5 ## Labels suggested `testing`, `e2e`, `frontend`, `infra`, `launch-blocker`
PlasticDigits commented 2026-04-22 03:24:50 +00:00 (Migrated from gitlab.com)

mentioned in issue #107

mentioned in issue #107
PlasticDigits commented 2026-04-22 04:59:55 +00:00 (Migrated from gitlab.com)

mentioned in commit 844607a438

mentioned in commit 844607a43804ca154ecdb789267e326c961bb657
PlasticDigits commented 2026-04-22 05:00:52 +00:00 (Migrated from gitlab.com)

mentioned in issue #106

mentioned in issue #106
PlasticDigits commented 2026-04-22 05:19:43 +00:00 (Migrated from gitlab.com)

mentioned in commit 1fb7d4aac1

mentioned in commit 1fb7d4aac1c30d6dfbed8290915c52adf52fa00c
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-04-22 05:20:03 +00:00
PlasticDigits commented 2026-04-22 05:20:19 +00:00 (Migrated from gitlab.com)

@brouie Could you verify this on a fresh localnet when you have a moment?

Implemented (merged to `main`):

  • Global provisioning: `playwright.config.ts` now runs `e2e/global-setup.ts` before tests. In the default (strict) mode it waits for the LCD, requires `frontend-dapp/.env.local` from `scripts/deploy-dex-local.sh`, then runs `scripts/e2e-provision-dev-wallet.sh` inside the LocalTerra container. That script walks factory `pairs`, collects CW20 contract addresses, and idempotently mints top-ups to the simulated dev wallet (`terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v`) when any balance is below `E2E_DEV_MIN_CW20_U128` (default `1000000000000` raw units). Native uluna/uusd for gas remain from genesis (`docker/init-chain.sh`).

  • Strict vs optional: `REQUIRE_LOCALTERRA=0` skips global setup and restores skip behavior for LCD / pool CTAs (for jobs without a chain). Any other unset value keeps strict behavior.

  • Tests: `pool-tx.spec.ts` no longer uses `test.skip` for under-funded wallet on the default path; blocked submit labels and missing tx alerts fail with clear messages. `wrap-pool.spec.ts` transaction tests follow the same pattern. Amounts in pool-tx were adjusted to human `10` / `10` to avoid exhausting the wallet in one shot.

  • Docs: `frontend-dapp/e2e/README.md` + `docs/testing.md` document the one-command run (`pnpm exec playwright test e2e/pool-tx.spec.ts` or `npx playwright test e2e/pool-tx.spec.ts`), denoms, minimums, and `REQUIRE_LOCALTERRA`.

Suggested verification: `docker compose up -d localterra`, `bash scripts/deploy-dex-local.sh`, then `cd frontend-dapp && npx playwright test e2e/pool-tx.spec.ts`.

Thanks!

@brouie Could you verify this on a fresh localnet when you have a moment? **Implemented (merged to \`main\`):** - **Global provisioning:** \`playwright.config.ts\` now runs \`e2e/global-setup.ts\` before tests. In the default (strict) mode it waits for the LCD, requires \`frontend-dapp/.env.local\` from \`scripts/deploy-dex-local.sh\`, then runs \`scripts/e2e-provision-dev-wallet.sh\` inside the LocalTerra container. That script walks factory \`pairs\`, collects CW20 contract addresses, and **idempotently mints** top-ups to the simulated dev wallet (\`terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v\`) when any balance is below \`E2E_DEV_MIN_CW20_U128\` (default \`1000000000000\` raw units). Native **uluna/uusd** for gas remain from genesis (\`docker/init-chain.sh\`). - **Strict vs optional:** \`REQUIRE_LOCALTERRA=0\` skips global setup and restores **skip** behavior for LCD / pool CTAs (for jobs without a chain). Any other unset value keeps **strict** behavior. - **Tests:** \`pool-tx.spec.ts\` no longer uses \`test.skip\` for under-funded wallet on the default path; blocked submit labels and missing tx alerts **fail** with clear messages. \`wrap-pool.spec.ts\` transaction tests follow the same pattern. Amounts in pool-tx were adjusted to human \`10\` / \`10\` to avoid exhausting the wallet in one shot. - **Docs:** \`frontend-dapp/e2e/README.md\` + \`docs/testing.md\` document the one-command run (\`pnpm exec playwright test e2e/pool-tx.spec.ts\` or \`npx playwright test e2e/pool-tx.spec.ts\`), denoms, minimums, and \`REQUIRE_LOCALTERRA\`. **Suggested verification:** \`docker compose up -d localterra\`, \`bash scripts/deploy-dex-local.sh\`, then \`cd frontend-dapp && npx playwright test e2e/pool-tx.spec.ts\`. Thanks!
PlasticDigits commented 2026-05-26 07:59:26 +00:00 (Migrated from gitlab.com)

mentioned in issue #193

mentioned in issue #193
PlasticDigits commented 2026-05-26 07:59:54 +00:00 (Migrated from gitlab.com)

mentioned in issue #195

mentioned in issue #195
PlasticDigits commented 2026-05-26 08:00:43 +00:00 (Migrated from gitlab.com)

mentioned in issue #201

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