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
Summary
(window as any).ethereumis mocked in multiple e2e specs but never explicitly cleaned up between files; some specs reassign and othersdelete, leaving inconsistent state.Affected area
tests/e2e/wallet-connection.spec.ts(delete (window as any).ethereumonly after the suite)tests/e2e/property-purchase-flow.spec.ts(sets(window as any).ethereumand never deletes)tests/e2e/property-purchase.spec.tstests/e2e/visual-regression.spec.tstests/e2e/accessibility.spec.tsSteps to reproduce / impact
When specs run in parallel or in a different order than designed, the global
(window as any).ethereummock leaks between tests, producing flakes and silent state corruption. Wiping inconsistently can also leaveisMetaMask/isCoinbaseWallettruthy when the underlying provider wasn't actually installed.Expected behaviour
A central
tests/e2e/wallet-fixture.ts(or PlaywrightaddInitScript) installs a fresh mock on every page navigation and tears it down deterministically.Acceptance criteria
window.ethereumis reset before each test.(window as any).ethereumdirectly.