Skip to content

bug: inconsistent (window as any).ethereum mock setup in Playwright specs #420

Description

@nanaf6203-bit

Summary

(window as any).ethereum is mocked in multiple e2e specs but never explicitly cleaned up between files; some specs reassign and others delete, leaving inconsistent state.

Affected area

  • tests/e2e/wallet-connection.spec.ts (delete (window as any).ethereum only after the suite)
  • tests/e2e/property-purchase-flow.spec.ts (sets (window as any).ethereum and never deletes)
  • tests/e2e/property-purchase.spec.ts
  • tests/e2e/visual-regression.spec.ts
  • tests/e2e/accessibility.spec.ts

Steps to reproduce / impact

When specs run in parallel or in a different order than designed, the global (window as any).ethereum mock leaks between tests, producing flakes and silent state corruption. Wiping inconsistently can also leave isMetaMask / isCoinbaseWallet truthy when the underlying provider wasn't actually installed.

Expected behaviour

A central tests/e2e/wallet-fixture.ts (or Playwright addInitScript) installs a fresh mock on every page navigation and tears it down deterministically.

Acceptance criteria

  • A single shared fixture is used for wallet snapshotting.
  • window.ethereum is reset before each test.
  • No spec edits (window as any).ethereum directly.
  • Add a regression test that runs two specs in parallel and verifies no leaked mock.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working correctlypriority/p2P2 — medium prioritytestingTest coverage or test reliability

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions