Skip to content

fix: restore devnet/testnet e2e contract tests - #1998

Merged
nelitow merged 13 commits into
masterfrom
nj/fix/e2e
Feb 23, 2026
Merged

fix: restore devnet/testnet e2e contract tests#1998
nelitow merged 13 commits into
masterfrom
nj/fix/e2e

Conversation

@nelitow

@nelitow nelitow commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix devnet/testnet E2E contract tests that were completely broken due to a Babel transpilation error, and resolve several secondary issues causing test flakiness.

Root cause: The fuels SDK code generator produces TypeScript declare class fields in CustomAsset.ts, which are incompatible with Playwright's Babel transform pipeline. This caused a SyntaxError that prevented all devnet/testnet E2E tests from running.

Additional fixes:

  • Replace brittle XPath account selector with DB lookup in getAddressForAccountNumber — accounts are sorted alphabetically in the UI, not by creation order
  • Fix getWalletPopupPage race condition where popups opening before waitForEvent was registered were missed — now uses concurrent polling + event listening
  • Fix chain ID detection in dApp Providers.tsx to correctly distinguish devnet vs testnet based on provider URL
  • Wait for network switch confirmation in addNetwork to prevent downstream flakiness
  • Update devnet network name to match actual chain name (Fuel Ignition Sepolia Devnet)
  • Fix popup URL predicate in FuelWalletTestHelper to include .html extension
  • Redeploy MainContract and ExternalContract to both devnet and testnet with fresh state (old contracts had accumulated state causing ArithmeticOverflow)
  • Update fast-xml-parser override to resolve critical audit vulnerability

Checklist

  • I've added error handling for all actions/requests, and verified how this error will show on UI. (or there was no error handling)
  • I've reviewed all the copy changed/added in this PR, using AI if needed. (or there was no copy changes)
  • I checked the resulting UI both in Light and Dark mode (or no UI changes were made)
  • I reviewed the entire PR myself (preferably, on GH UI)

…e2e tests

The auto-generated CustomAsset.ts contained TypeScript declare fields that
Playwright's Babel transform cannot handle. The deploy script already strips
these, but devnet/testnet workflows use committed files directly.
@nelitow nelitow self-assigned this Feb 19, 2026
@cursor

cursor Bot commented Feb 19, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches Playwright test helpers used across suites and updates generated contract bindings/contract IDs, which can affect test stability and environment targeting even though runtime wallet logic is largely unchanged.

Overview
Restores reliability of devnet/testnet E2E contract tests by hardening Playwright wallet automation and aligning test configuration with current networks and deployments.

This removes brittle UI-driven account address retrieval (XPath + clipboard) in favor of querying the wallet DB and normalizing via Address, fixes a race in getWalletPopupPage by combining page-event listening with polling, and adds a wait after network switching. Contract-test setup is updated to infer chainId from VITE_FUEL_PROVIDER_URL, refreshes deployed contract IDs, and regenerates contract bindings (dropping problematic declare blocks) to avoid Playwright/Babel syntax errors; a small timing tweak reduces unnecessary waits. Also updates dependency overrides/lockfile for fast-xml-parser and adds a changeset for patch releases.

Written by Cursor Bugbot for commit d735c55. This will update automatically on new commits. Configure here.

…countNumber

The e2e test used a hardcoded XPath to find accounts by list position,
but the UI sorts accounts alphabetically with the current account pinned
first, causing position mismatches and test failures.
@nelitow nelitow closed this Feb 19, 2026
@nelitow nelitow reopened this Feb 19, 2026
Remove redundant `declare` blocks from CustomAsset.ts (the `interface` and `functions` type declarations) to clean up generated TypeScript typings. Also delete the outdated CustomAsset.ts.bak backup file. This is a non-functional cleanup to reduce duplicate/type clutter in the contract bindings.
@nelitow nelitow changed the title fix: remove declare blocks from CustomAsset.ts to fix devnet/testnet … fix: restore devnet/testnet e2e contract tests Feb 20, 2026
Comment thread packages/app/src/networks.ts
Comment thread packages/e2e-contract-tests/src/components/Providers.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread packages/app/playwright/crx/utils/popup.ts
@nelitow
nelitow merged commit 7aba974 into master Feb 23, 2026
34 of 40 checks passed
@nelitow
nelitow deleted the nj/fix/e2e branch February 23, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants