Skip to content

Commit 9b203b9

Browse files
committed
test b4 worked for failed register, testing all at once now
1 parent 7f90fa5 commit 9b203b9

File tree

9 files changed

+21
-12
lines changed

9 files changed

+21
-12
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ jobs:
5757
- name: Run E2E tests
5858
env:
5959
NODE_OPTIONS: '--dns-result-order=ipv4first'
60-
run: xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" yarn test:e2e registration-failed.spec.ts
60+
run: xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" yarn test:e2e

apps/web/e2e/appSession.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export async function switchToBaseNetworkIfNeeded(page: Page): Promise<boolean>
9595
page.url(),
9696
);
9797
await page.waitForLoadState('networkidle');
98+
await page.waitForTimeout(5000);
9899
// Prefer the explicit "Connect to Base" button if present
99100
const explicitSelector = 'button:has-text("Connect to Base")';
100101

apps/web/e2e/basenameHelpers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ export async function navigateToBasenameRegistration(page: Page): Promise<void>
4747
* @param basename - The basename to search for
4848
*/
4949
export async function searchForBasename(page: Page, basename: string): Promise<void> {
50+
await page.waitForTimeout(2000);
5051
const searchInput = page.locator(SELECTORS.SEARCH_INPUT).first();
5152
await expect(searchInput).toBeVisible();
5253
await searchInput.clear();
5354
await searchInput.fill(basename);
5455
await page.waitForLoadState('networkidle');
56+
await page.waitForTimeout(2000);
5557
}
5658

5759
/**

apps/web/e2e/tests/connectWallet.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { test } from '../testFixture';
22
import { connectWallet } from '../appSession';
33

4+
test.describe.configure({ mode: 'parallel' });
5+
46
test.describe('Connect Wallet', () => {
57
test('should connect to wallet', async ({ page, metamask }) => {
68
if (!metamask) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import { prepareBasenameFlow, handleTransaction } from '../appSession';
44
import { initiateRegistration } from '../basenameHelpers';
55
import { ActionApprovalType } from '@coinbase/onchaintestkit';
66

7+
test.describe.configure({ mode: 'parallel' });
8+
79
test.describe('Basename Registration', () => {
810
test('should fail registration when wallet has insufficient funds', async ({
911
page,
1012
metamask,
1113
node,
1214
}) => {
13-
test.setTimeout(120000); // Increase timeout to 2 minutes
14-
1515
// Validate prerequisites
1616
if (!metamask) {
1717
throw new Error('MetaMask is not defined');
@@ -26,7 +26,7 @@ test.describe('Basename Registration', () => {
2626

2727
// Add a small delay to ensure everything is stable
2828
console.log('[test] Waiting for network to stabilize...');
29-
await mainPage.waitForTimeout(4000);
29+
await mainPage.waitForTimeout(2000);
3030

3131
// Get the first default wallet address from Anvil (0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266)
3232
let walletAddress;

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { prepareBasenameFlow, handleTransaction } from '../appSession';
44
import { initiateRegistration } from '../basenameHelpers';
55
import { ActionApprovalType } from '@coinbase/onchaintestkit';
66

7+
test.describe.configure({ mode: 'parallel' });
8+
79
test.describe('Basename Registration', () => {
810
test('should fail registration when transaction is rejected', async ({ page, metamask }) => {
911
// Validate prerequisites
@@ -14,7 +16,7 @@ test.describe('Basename Registration', () => {
1416
// Common preparation steps
1517
const { mainPage } = await prepareBasenameFlow(page, metamask);
1618

17-
await mainPage.waitForTimeout(4000);
19+
await mainPage.waitForTimeout(2000);
1820

1921
// Attempt registration and explicitly reject the transaction in MetaMask
2022
await initiateRegistration(mainPage);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { test } from '../testFixture';
33
import { handleTransaction, prepareBasenameFlow } from '../appSession';
44
import { initiateRegistration, SELECTORS } from '../basenameHelpers';
55

6+
test.describe.configure({ mode: 'parallel' });
7+
68
// Main test
79
test.describe('Basename Registration', () => {
810
test('should successfully register a basename', async ({ page, metamask }) => {
@@ -14,7 +16,7 @@ test.describe('Basename Registration', () => {
1416
// Common preparation steps (connect wallet, switch network, navigate & select basename)
1517
const { mainPage } = await prepareBasenameFlow(page, metamask);
1618

17-
await mainPage.waitForTimeout(4000);
19+
await mainPage.waitForTimeout(2000);
1820

1921
// Complete registration
2022
await initiateRegistration(mainPage);

apps/web/e2e/walletConfig/coinbaseWalletConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const baseConfig = configure()
2323
chainId: base.id,
2424
symbol: 'ETH',
2525
// placeholder for the actual rpcUrl, which is auto injected by the node fixture
26-
rpcUrl: 'http://127.0.0.1:8545',
26+
rpcUrl: 'http://localhost:8545',
2727
});
2828

2929
// Build the config

apps/web/playwright.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ const baseURL = `http://localhost:${PORT}`;
1919
* See https://playwright.dev/docs/test-configuration.
2020
*/
2121
export default defineConfig({
22-
timeout: 5 * 60 * 1000,
22+
timeout: 2 * 60 * 1000,
2323
testDir: './e2e/tests',
2424
/* Run tests in files in parallel */
25-
fullyParallel: false,
25+
fullyParallel: true,
2626
/* Fail the build on CI if you accidentally left test.only in the source code. */
2727
forbidOnly: !!process.env.CI,
2828
/* Retry on CI only */
29-
retries: process.env.CI ? 5 : 0,
29+
retries: 6,
3030
/* Opt out of parallel tests on CI. */
31-
workers: 10,
31+
workers: process.env.CI ? 4 : 8,
3232
maxFailures: 1,
3333
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
3434
reporter: 'html',
@@ -51,7 +51,7 @@ export default defineConfig({
5151

5252
/* Increase default expect timeout */
5353
expect: {
54-
timeout: 120000,
54+
timeout: 30000,
5555
},
5656

5757
/* Configure projects for major browsers */

0 commit comments

Comments
 (0)