Files
bridge/pkg/ui
zeekayandHanzo Dev f2f4d8a33d fix: complete the TypeScript 7 tsconfig migration
The first pass left three classes of config that BOTH tsc 5.9 and tsc 7
reject. Each was proven against both compilers before changing:

  TS5090  A `paths` target must be relative once `baseUrl` is gone. The
          first pass skipped the "./" prefix wherever baseUrl pointed at
          the config's own directory, reasoning it was semantically
          equivalent. It is not — without baseUrl a non-relative target
          is rejected outright, by 5.9 as well as 7.

  TS5110  `moduleResolution: node16` requires `module: node16`. The first
          pass mapped commonjs projects to node16 resolution alone, which
          BROKE those configs for the current toolchain. Both are now set.

  TS5102  `downlevelIteration` is also removed in TS7; it was missing from
          the dead-flag list.

Verified: repos that tsc 7 previously refused (base-studio, js-sdk, kv-js)
now report zero config errors on tsc 7 AND tsc 5.9.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 20:17:34 -07:00
..
2025-08-03 15:52:32 -05:00

Bridge UI Automation

Automated UI testing for the Lux Bridge using Selenium WebDriver and TypeScript.

Overview

This test suite validates the complete bridge flow including:

  • Wallet connection (MetaMask, WalletConnect, etc.)
  • Network selection and switching
  • Token selection and amount input
  • Cross-chain transfers with MPC signatures
  • Transaction status tracking
  • Error handling

Quick Start

  1. Install dependencies:

    npm install
    
  2. Set up test wallets:

    npm run setup:wallets
    
  3. Run all tests:

    npm test
    

Test Scenarios

Core Bridge Flow

  • Connect wallet
  • Select source network and token
  • Select destination network
  • Enter amount and recipient
  • Approve token (if needed)
  • Initiate bridge transfer
  • Monitor transaction status
  • Verify completion on destination

MPC Integration Tests

  • Key generation coordination
  • Signature generation for transfers
  • Threshold signature validation
  • Node failure recovery

Error Scenarios

  • Insufficient balance
  • Network errors
  • MPC node failures
  • Invalid addresses
  • Gas estimation failures

Running Tests

Command Description
npm test Run all tests
npm run test:smoke Quick smoke tests
npm run test:mpc MPC-specific tests
npm run test:networks Network switching tests
npm run test:tokens Token transfer tests

Configuration

Create a .env.test file:

# Test wallet credentials
TEST_WALLET_PRIVATE_KEY=your_test_wallet_key
TEST_WALLET_ADDRESS=your_test_wallet_address

# Bridge endpoints
BRIDGE_UI_URL=http://localhost:3000
BRIDGE_API_URL=http://localhost:5000

# MPC nodes
MPC_NODE_URLS=http://localhost:6000,http://localhost:6001,http://localhost:6002

# Test networks
TEST_NETWORKS=ethereum,bsc,polygon,lux

MPC Testing

The MPC integration tests validate:

  1. Key Generation: Distributed key generation across nodes
  2. Signing: Threshold signature generation
  3. Recovery: Node failure and recovery scenarios
  4. Performance: Signature generation time

Writing Tests

Example test structure:

import { BridgeTestHelper } from './helpers/bridge-helper';

describe('Bridge Transfer Flow', () => {
  let bridge: BridgeTestHelper;

  beforeEach(async () => {
    bridge = new BridgeTestHelper();
    await bridge.initialize();
  });

  it('should complete cross-chain transfer', async () => {
    // Connect wallet
    await bridge.connectWallet('metamask');
    
    // Select networks
    await bridge.selectSourceNetwork('ethereum');
    await bridge.selectDestinationNetwork('bsc');
    
    // Configure transfer
    await bridge.selectToken('USDC');
    await bridge.enterAmount('100');
    await bridge.enterRecipient(TEST_RECIPIENT);
    
    // Execute transfer
    await bridge.approveToken();
    const txId = await bridge.initiateBridge();
    
    // Monitor completion
    await bridge.waitForCompletion(txId);
    
    // Verify on destination
    const balance = await bridge.getDestinationBalance('USDC');
    expect(balance).toBeGreaterThan(99); // Account for fees
  });
});

CI/CD Integration

Tests run automatically on:

  • Pull requests
  • Commits to main branch
  • Before deployment

GitHub Actions workflow included in .github/workflows/bridge-tests.yml