fix(e2e): locate LUNC-C pool card on paginated pool page (#340) #837

Closed
PlasticDigits wants to merge 830 commits from cursor/gitlab-issue-workflow-47d4 into main
PlasticDigits commented 2026-06-08 08:44:13 +00:00 (Migrated from gitlab.com)

Summary

Fixes GitLab #340: wrap-pool tx specs (E7–E10) timed out expanding the LUNC-C card when the indexer pool list exceeds PAGE_SIZE (20) and LUNC-C is not on page 1.

Changes

  • Add frontend-dapp/e2e/helpers/pool-nav.ts:
    • gotoPoolCardBySymbol — indexer search (#pool-search + Search), paginate fallback, word-boundary card match (avoids ALUNC-C false positives), indexer outage detection.
    • gotoWrapPoolLuncCard — searches by VITE_LUNC_C_TOKEN_ADDRESS when available (from global-setup / .env.local), else LUNC-C.
  • Update wrap-pool.spec.ts tx describe to use gotoWrapPoolLuncCard instead of .filter({ hasText: 'LUNC-C' }) on the default page-1 list.
  • wrap-e2e.ts: requirePoolCardWithNativeWrap / requirePoolCardWithReceiveWrapped accept Page | Locator (scoped to the located card).
  • global-setup.ts: load VITE_LUNC_C_TOKEN_ADDRESS from .env.local for env-driven search.
  • e2e/README.md: document pool pagination invariant for wrap-pool tx.
  • Minor: E9/E10 withdraw tests use getByTitle('Use max balance') instead of /^\d/ (was matching 0.5% slippage preset).

Acceptance checklist

Criterion Verification Result
wrap-pool tx E7–E10 pass with ≥75 indexer pairs Search/pagination helper is the required code path; full 75+ volume repro needs accumulated QA DB (not available on fresh deploy-local). Verified search narrows list to 1 LUNC-C card via token address on 27-pair deploy. PASS (mechanism) / SKIP (75+ volume repro)
Tests pass on fresh 25-pair local deploy sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- ./node_modules/.bin/playwright test e2e/wrap-pool.spec.ts --project=e2e-tx -g "Pool Transaction"' → 4/4 passed PASS
LUNC-C located via search/pagination/env — not page-1 luck Error-context snapshot shows search box filled with VITE_LUNC_C_TOKEN_ADDRESS, indexer total 1 pair, LUNC-C/EMBER card visible PASS
UI smoke tests E6–E10 unchanged or improved Same file UI describe unchanged; full wrap-pool run: UI E6–E10 + tx E7–E10 9/9 passed PASS
No weakening of strict E2E skip policy No test.skip added; missing pair still fails with seed instructions PASS
wrap-pool.spec.ts --project=e2e-tx 4/4 tx See above PASS
wrap-pool.spec.ts --project=e2e-smoke wrap-pool.spec.ts is e2e-tx only per playwright.config.ts (testMatch: txSpecGlobs) SKIP (N/A)
CI=1 make test-e2e full suite Not run (scope: wrap-pool); recommend CI on merge SKIP
Manual: search LUNC-C on /pool with many pairs Verified via Playwright: search by token address returns LUNC-C/EMBER card PASS

Verification for third parties

make setup-cloud-localterra   # or existing QA stack with indexer
export PATH="$HOME/.nvm/versions/node/$(cat .nvmrc)/bin:$PATH"
sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- ./node_modules/.bin/playwright test e2e/wrap-pool.spec.ts --project=e2e-tx -g "Pool Transaction"'

On QA with 75+ pairs: confirm /pool default view hides LUNC-C on page 1, then run the command above — expand should succeed within the 90s beforeEach window.


Note

Low Risk
Playwright E2E and helper-only changes; strict failure paths and seed messaging are preserved with no production runtime impact.

Overview
Fixes GitLab #340: wrap-pool tx specs (E7–E10) were timing out when the indexer pool list paginates (20 pairs/page) and LUNC-C is not on the default view.

Adds e2e/helpers/pool-nav.ts with gotoPoolCardBySymbol (pool search, paginate within filtered results, clear search + paginate fallback, word-boundary card match to avoid false positives like ALUNC-C) and gotoWrapPoolLuncCard (search by VITE_LUNC_C_TOKEN_ADDRESS when set, else LUNC-C). wrap-pool.spec.ts tx tests use the helper instead of a page-wide hasText: 'LUNC-C' filter. wrap-e2e.ts scopes requirePoolCardWithNativeWrap / requirePoolCardWithReceiveWrapped to Page | Locator. global-setup.ts loads VITE_LUNC_C_TOKEN_ADDRESS from .env.local; e2e/README.md documents the pagination invariant. E9/E10 withdraw flows use getByTitle('Use max balance') so locators do not hit slippage presets (e.g. 0.5%).

Reviewed by Cursor Bugbot for commit 7486c859a6. Bugbot is set up for automated code reviews on this repo. Configure here.

## Summary Fixes [GitLab #340](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/340): wrap-pool **tx** specs (E7–E10) timed out expanding the LUNC-C card when the indexer pool list exceeds `PAGE_SIZE` (20) and LUNC-C is not on page 1. ### Changes - Add `frontend-dapp/e2e/helpers/pool-nav.ts`: - `gotoPoolCardBySymbol` — indexer search (`#pool-search` + Search), paginate fallback, word-boundary card match (avoids `ALUNC-C` false positives), indexer outage detection. - `gotoWrapPoolLuncCard` — searches by `VITE_LUNC_C_TOKEN_ADDRESS` when available (from `global-setup` / `.env.local`), else `LUNC-C`. - Update `wrap-pool.spec.ts` tx describe to use `gotoWrapPoolLuncCard` instead of `.filter({ hasText: 'LUNC-C' })` on the default page-1 list. - `wrap-e2e.ts`: `requirePoolCardWithNativeWrap` / `requirePoolCardWithReceiveWrapped` accept `Page | Locator` (scoped to the located card). - `global-setup.ts`: load `VITE_LUNC_C_TOKEN_ADDRESS` from `.env.local` for env-driven search. - `e2e/README.md`: document pool pagination invariant for wrap-pool tx. - Minor: E9/E10 withdraw tests use `getByTitle('Use max balance')` instead of `/^\d/` (was matching `0.5%` slippage preset). ## Acceptance checklist | Criterion | Verification | Result | |-----------|--------------|--------| | wrap-pool tx E7–E10 pass with ≥75 indexer pairs | Search/pagination helper is the required code path; full 75+ volume repro needs accumulated QA DB (not available on fresh `deploy-local`). Verified search narrows list to 1 LUNC-C card via token address on 27-pair deploy. | **PASS** (mechanism) / **SKIP** (75+ volume repro) | | Tests pass on fresh 25-pair local deploy | `sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- ./node_modules/.bin/playwright test e2e/wrap-pool.spec.ts --project=e2e-tx -g "Pool Transaction"'` → **4/4 passed** | **PASS** | | LUNC-C located via search/pagination/env — not page-1 luck | Error-context snapshot shows search box filled with `VITE_LUNC_C_TOKEN_ADDRESS`, indexer total 1 pair, LUNC-C/EMBER card visible | **PASS** | | UI smoke tests E6–E10 unchanged or improved | Same file UI describe unchanged; full wrap-pool run: UI E6–E10 + tx E7–E10 **9/9 passed** | **PASS** | | No weakening of strict E2E skip policy | No `test.skip` added; missing pair still fails with seed instructions | **PASS** | | `wrap-pool.spec.ts --project=e2e-tx` 4/4 tx | See above | **PASS** | | `wrap-pool.spec.ts --project=e2e-smoke` | `wrap-pool.spec.ts` is `e2e-tx` only per `playwright.config.ts` (`testMatch: txSpecGlobs`) | **SKIP** (N/A) | | `CI=1 make test-e2e` full suite | Not run (scope: wrap-pool); recommend CI on merge | **SKIP** | | Manual: search `LUNC-C` on `/pool` with many pairs | Verified via Playwright: search by token address returns LUNC-C/EMBER card | **PASS** | ## Verification for third parties ```bash make setup-cloud-localterra # or existing QA stack with indexer export PATH="$HOME/.nvm/versions/node/$(cat .nvmrc)/bin:$PATH" sg docker -c 'bash scripts/with-node.sh --cwd frontend-dapp -- ./node_modules/.bin/playwright test e2e/wrap-pool.spec.ts --project=e2e-tx -g "Pool Transaction"' ``` On QA with 75+ pairs: confirm `/pool` default view hides LUNC-C on page 1, then run the command above — expand should succeed within the 90s `beforeEach` window. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Playwright E2E and helper-only changes; strict failure paths and seed messaging are preserved with no production runtime impact. > > **Overview** > Fixes **GitLab #340**: wrap-pool **tx** specs (E7–E10) were timing out when the indexer pool list paginates (**20 pairs/page**) and LUNC-C is not on the default view. > > Adds **`e2e/helpers/pool-nav.ts`** with **`gotoPoolCardBySymbol`** (pool search, paginate within filtered results, clear search + paginate fallback, word-boundary card match to avoid false positives like `ALUNC-C`) and **`gotoWrapPoolLuncCard`** (search by **`VITE_LUNC_C_TOKEN_ADDRESS`** when set, else `LUNC-C`). **`wrap-pool.spec.ts`** tx tests use the helper instead of a page-wide `hasText: 'LUNC-C'` filter. **`wrap-e2e.ts`** scopes **`requirePoolCardWithNativeWrap`** / **`requirePoolCardWithReceiveWrapped`** to **`Page | Locator`**. **`global-setup.ts`** loads **`VITE_LUNC_C_TOKEN_ADDRESS`** from **`.env.local`**; **`e2e/README.md`** documents the pagination invariant. E9/E10 withdraw flows use **`getByTitle('Use max balance')`** so locators do not hit slippage presets (e.g. `0.5%`). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7486c859a6aa204b3058097ddc660251d53e7e16. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
PlasticDigits commented 2026-06-08 08:44:20 +00:00 (Migrated from gitlab.com)

mentioned in issue #340

mentioned in issue #340
ghost1 commented 2026-06-08 08:44:33 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-08 08:45:10 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-08 08:46:30 +00:00 (Migrated from gitlab.com)

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.

Reviewed by Cursor Bugbot for commit 7486c859a6. Configure here.

<!-- BUGBOT_REVIEW --> Cursor Bugbot has reviewed your changes and found 1 potential issue. <!-- BUGBOT_FIX_ALL --> <a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTo3MGUwNmQ2Ny03YTI4LTQ4NmYtYTFkMi05MmM0ZjY1NzI5MjAiLCJlbmNyeXB0aW9uS2V5IjoiMERIT3NWTXhjNXNsRDFFdkNrbVlxTUhTc2RpdVhBUk5MSXFkU1U0VVBrVSIsImJyYW5jaCI6ImN1cnNvci9naXRsYWItaXNzdWUtd29ya2Zsb3ctNDdkNCIsInJlcG9Pd25lciI6IlBsYXN0aWNEaWdpdHMiLCJyZXBvTmFtZSI6ImNsOHktZGV4LXRlcnJhY2xhc3NpYyJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <!-- /BUGBOT_FIX_ALL --> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN --> <sup>Bugbot Autofix is [ON](https://www.cursor.com/dashboard/bugbot). A cloud agent has been kicked off to fix the reported issue. <!-- BUGBOT_AUTOFIX_AGENT_LINK --></sup> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END --> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7486c859a6aa204b3058097ddc660251d53e7e16. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-08 08:46:32 +00:00 (Migrated from gitlab.com)

Pagination skips pages while loading

Medium Severity

In paginateToPoolCard, each Next click is followed immediately by a short visibility check, without waiting for the pool list fetch to finish (unlike submitPoolSearch, which calls waitForPoolListSettled). While /pool shows loading skeletons and no cards, the helper can treat the pair as missing and click Next again, advancing the UI page before the prior page’s results render and skipping the page that actually contains the card.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7486c859a6. Configure here.

### Pagination skips pages while loading **Medium Severity** <!-- DESCRIPTION START --> In `paginateToPoolCard`, each `Next` click is followed immediately by a short visibility check, without waiting for the pool list fetch to finish (unlike `submitPoolSearch`, which calls `waitForPoolListSettled`). While `/pool` shows loading skeletons and no cards, the helper can treat the pair as missing and click `Next` again, advancing the UI page before the prior page’s results render and skipping the page that actually contains the card. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 6b66322b-d453-4b61-9315-7112879cc85a --> <!-- LOCATIONS START frontend-dapp/e2e/helpers/pool-nav.ts#L71-L80 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFlMzQ5YzBlLTlmYjAtNGQ3Mi1iYTJmLTViNDdiMzFlNDI1OCIsImVuY3J5cHRpb25LZXkiOiJhZkxrSFBhSXhzSWtEcmlCaWZWaVZialR4VnhXNmZaZGpac3p5T3pfdmVVIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy00N2Q0IiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFlMzQ5YzBlLTlmYjAtNGQ3Mi1iYTJmLTViNDdiMzFlNDI1OCIsImVuY3J5cHRpb25LZXkiOiJhZkxrSFBhSXhzSWtEcmlCaWZWaVZialR4VnhXNmZaZGpac3p5T3pfdmVVIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy00N2Q0IiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjExOSwiY29tbWl0U2hhIjoiNzQ4NmM4NTlhNmFhMjA0YjMwNTgwOTdkZGM2NjAyNTFkNTNlN2UxNiIsInByb3ZpZGVyIjoiZ2l0bGFiIiwiaG9zdG5hbWUiOiJnaXRsYWIuY29tIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7486c859a6aa204b3058097ddc660251d53e7e16. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PlasticDigits commented 2026-06-08 08:47:15 +00:00 (Migrated from gitlab.com)

Security review

Commit reviewed: 7486c859a6aa204b3058097ddc660251d53e7e16
Scope: E2E-only changes for wrap-pool tx specs (#340): pool-nav.ts, wrap-e2e.ts, wrap-pool.spec.ts, global-setup.ts, e2e/README.md.

Outcome: FINDINGS: 0 medium+

Reviewed the MR diff for injection, authn/authz, secret leakage, SSRF/XSS, and unsafe deserialization. Changes are confined to Playwright test helpers and specs; no production frontend, indexer, or contract code is modified.

  • pool-nav.ts drives the existing /pool search UI in a test browser with hardcoded LUNC-C or deploy-time VITE_LUNC_C_TOKEN_ADDRESS (public on-chain address from .env.local). escapeRegExp is used before building the card-matching RegExp.
  • wrap-e2e.ts / wrap-pool.spec.ts scope locators to the located card; locator selector hardening only.
  • No new dependencies, secrets, network endpoints, or auth boundaries.

Inline threads: none (no medium+ findings).

## Security review **Commit reviewed:** `7486c859a6aa204b3058097ddc660251d53e7e16` **Scope:** E2E-only changes for wrap-pool tx specs (#340): `pool-nav.ts`, `wrap-e2e.ts`, `wrap-pool.spec.ts`, `global-setup.ts`, `e2e/README.md`. **Outcome:** `FINDINGS: 0` medium+ Reviewed the MR diff for injection, authn/authz, secret leakage, SSRF/XSS, and unsafe deserialization. Changes are confined to Playwright test helpers and specs; no production frontend, indexer, or contract code is modified. - `pool-nav.ts` drives the existing `/pool` search UI in a test browser with hardcoded `LUNC-C` or deploy-time `VITE_LUNC_C_TOKEN_ADDRESS` (public on-chain address from `.env.local`). `escapeRegExp` is used before building the card-matching `RegExp`. - `wrap-e2e.ts` / `wrap-pool.spec.ts` scope locators to the located card; locator selector hardening only. - No new dependencies, secrets, network endpoints, or auth boundaries. **Inline threads:** none (no medium+ findings).
ghost1 commented 2026-06-08 08:47:39 +00:00 (Migrated from gitlab.com)

added 1 commit

  • c9742e67 - fix(e2e): wait for pool list to settle after pagination Next click

Compare with previous version

added 1 commit <ul><li>c9742e67 - fix(e2e): wait for pool list to settle after pagination Next click</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/119/diffs?diff_id=1839214483&start_sha=7486c859a6aa204b3058097ddc660251d53e7e16)
PlasticDigits commented 2026-06-08 08:49:34 +00:00 (Migrated from gitlab.com)

Security review

Commit reviewed: c9742e67f26bb6d6cd16b16a414ac37ebc115ffc
Scope: E2E-only changes for wrap-pool tx specs (#340): pool-nav.ts, wrap-e2e.ts, wrap-pool.spec.ts, global-setup.ts, e2e/README.md (re-reviewed after pagination-settle fix in paginateToPoolCard).

Outcome: FINDINGS: 0 medium+

Reviewed the full MR diff (main..HEAD, 5 files) for injection, authn/authz bypass, secret leakage, SSRF/XSS, unsafe deserialization, and supply-chain risk. All changes are confined to Playwright test helpers and specs; no production frontend, indexer, or contract code is modified.

Trace summary (no exploitable paths):

  • pool-nav.ts automates the existing /pool search UI in a test browser. Search input is hardcoded LUNC-C or deploy-time VITE_LUNC_C_TOKEN_ADDRESS (public on-chain address from .env.local, same pattern as existing LCD/indexer env loading in global-setup.ts). escapeRegExp is applied before building the card-matching RegExp. Pagination helper only clicks in-page Next/Search controls — no new network endpoints or server-side sinks.
  • wrap-e2e.ts / wrap-pool.spec.ts scope locators to the located card (Page | Locator); locator hardening only, no auth boundary changes.
  • No new dependencies, secrets, logging of sensitive material, or runtime code paths reachable by external attackers.

Prior review: commit 7486c859 — same outcome; latest commit adds waitForPoolListSettled after pagination (test reliability only, not a security control change).

Inline threads: none (no medium+ findings).

## Security review **Commit reviewed:** `c9742e67f26bb6d6cd16b16a414ac37ebc115ffc` **Scope:** E2E-only changes for wrap-pool tx specs (#340): `pool-nav.ts`, `wrap-e2e.ts`, `wrap-pool.spec.ts`, `global-setup.ts`, `e2e/README.md` (re-reviewed after pagination-settle fix in `paginateToPoolCard`). **Outcome:** `FINDINGS: 0` medium+ Reviewed the full MR diff (`main..HEAD`, 5 files) for injection, authn/authz bypass, secret leakage, SSRF/XSS, unsafe deserialization, and supply-chain risk. All changes are confined to Playwright test helpers and specs; no production frontend, indexer, or contract code is modified. **Trace summary (no exploitable paths):** - `pool-nav.ts` automates the existing `/pool` search UI in a test browser. Search input is hardcoded `LUNC-C` or deploy-time `VITE_LUNC_C_TOKEN_ADDRESS` (public on-chain address from `.env.local`, same pattern as existing LCD/indexer env loading in `global-setup.ts`). `escapeRegExp` is applied before building the card-matching `RegExp`. Pagination helper only clicks in-page Next/Search controls — no new network endpoints or server-side sinks. - `wrap-e2e.ts` / `wrap-pool.spec.ts` scope locators to the located card (`Page | Locator`); locator hardening only, no auth boundary changes. - No new dependencies, secrets, logging of sensitive material, or runtime code paths reachable by external attackers. **Prior review:** commit `7486c859` — same outcome; latest commit adds `waitForPoolListSettled` after pagination (test reliability only, not a security control change). **Inline threads:** none (no medium+ findings).
PlasticDigits (Migrated from gitlab.com) closed this pull request 2026-06-08 09:11:27 +00:00

Pull request closed

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!837
No description provided.