coinbase / coinbase/onchaintestkit

Allow custom timeouts in Metamask wallet configuration

Open
#203 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
14
Forks
15
PR merge metrics
No merged PRs in 30d

Description

## Summary

The timeout for waiting on MetaMask notification popups is currently
hardcoded to 15 seconds inside `NotificationPage` in `src/wallets/MetaMask/pages/NotificationPage/index.ts`:
```typescript
const WAIT_FOR_PAGE_TIMEOUT_MS = 15_000
```

There is no way for users to change this value through the config builder.

## Problem

This causes two issues:

- On slow CI machines, popups can take longer than 15 seconds to appear,
causing tests to fail even when nothing is actually wrong.
- During local debugging, developers cannot lower the timeout to fail
faster when something is broken.

## Suggested Solution

Add a `.withTimeout(ms)` method to the config builder so users can do:
```typescript
configure()
.withMetaMask()
.withTimeout(30000)
.withSeedPhrase({ ... })
.build()
```

This should fall back to the existing 15 second default if not called,
so it is fully backwards compatible.

@justinchung-cb, I would like to work on this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.