Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Commit d0feaa3

Browse files
committed
debugging further
1 parent b83c422 commit d0feaa3

File tree

2 files changed

+44
-27
lines changed

2 files changed

+44
-27
lines changed

apps/web/e2e/E2Ereadme.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,3 @@ PWDEBUG=1 yarn test:e2e registration-success.spec.ts
8989
---
9090

9191
Feel free to extend this README if you run into anything else that others might find useful. Happy testing! 🎉
92-
<<<<<<< HEAD
93-
=======
94-
95-
### NOTE:
96-
97-
If you see this error:
98-
99-
```bash
100-
101-
Run xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" yarn test:e2e
102-
[WebServer] ⚠ i18n configuration in next.config.js is unsupported in App Router.
103-
[WebServer] Learn more about internationalization in App Router: https://nextjs.org/docs/app/building-your-application/routing/internationalization
104-
105-
Error: Timed out waiting 60000ms from config.webServer.
106-
```
107-
108-
Try re-running the E2E workflow a couple more times
109-
>>>>>>> 6f7964f6 (apply fixes)

apps/web/e2e/tests/registration-failed.spec.ts

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ test.describe('Basename Registration', () => {
1010
metamask,
1111
node,
1212
}) => {
13+
test.setTimeout(120000); // Increase timeout to 2 minutes
14+
1315
// Validate prerequisites
1416
if (!metamask) {
1517
throw new Error('MetaMask is not defined');
@@ -22,21 +24,54 @@ test.describe('Basename Registration', () => {
2224
// Common preparation steps (wallet needs funds to connect)
2325
const { mainPage } = await prepareBasenameFlow(page, metamask);
2426

27+
// Add a small delay to ensure everything is stable
28+
console.log('[test] Waiting for network to stabilize...');
29+
await mainPage.waitForTimeout(2000);
30+
2531
// Get the first default wallet address from Anvil (0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266)
26-
const walletAddress = (await node.getAccounts())[0];
27-
console.log('[test] Using default Anvil wallet address:', walletAddress);
32+
let walletAddress;
33+
try {
34+
const accounts = await node.getAccounts();
35+
walletAddress = accounts[0];
36+
console.log('[test] Using default Anvil wallet address:', walletAddress);
37+
} catch (error) {
38+
console.error('[test] Failed to get accounts:', error);
39+
throw error;
40+
}
41+
42+
// Set wallet balance to a tiny amount - enough for RPC calls but not for registration
43+
// Registration costs around 0.002 ETH, so 0.0001 ETH should be insufficient
44+
const insufficientBalance = BigInt('100000000000000'); // 0.0001 ETH in wei
2845

29-
// NOW set wallet balance to 0 after connection is established
30-
await node.setBalance(walletAddress, 0n);
31-
console.log('[test] Set wallet balance to 0');
46+
try {
47+
console.log('[test] About to set balance...');
48+
await node.setBalance(walletAddress, insufficientBalance);
49+
console.log('[test] Set wallet balance to 0.0001 ETH (insufficient for registration)');
50+
} catch (error) {
51+
console.error('[test] Failed to set balance:', error);
52+
throw error;
53+
}
54+
55+
// Another small delay after balance change
56+
await mainPage.waitForTimeout(1000);
3257

3358
// Attempt registration with no funds
34-
await initiateRegistration(mainPage);
35-
await page.waitForLoadState('networkidle');
59+
try {
60+
await initiateRegistration(mainPage);
61+
await page.waitForLoadState('networkidle');
62+
} catch (error) {
63+
console.error('[test] Failed to initiate registration:', error);
64+
throw error;
65+
}
3666

3767
// Approve the transaction (it should fail due to insufficient funds)
38-
await handleTransaction(metamask, ActionApprovalType.APPROVE);
39-
await page.waitForLoadState('networkidle');
68+
try {
69+
await handleTransaction(metamask, ActionApprovalType.APPROVE);
70+
await page.waitForLoadState('networkidle');
71+
} catch (error) {
72+
console.error('[test] Failed to handle transaction:', error);
73+
throw error;
74+
}
4075

4176
// Look for failure message
4277
await expect(page.getByText(/failed|rejected|insufficient/i)).toBeVisible({ timeout: 30000 });

0 commit comments

Comments
 (0)