Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions e2e/explorer.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { expect, test } from '@playwright/test';

// The explorer polls the live vibenet API, which is reset from time to time, so
// these tests assert that blocks and transactions are present in general and can
// be opened — never that a specific block or transaction exists. Right after a
// reset there may be no transactions yet, so the transaction cases tolerate the
// empty state rather than flaking.
const ROW_TIMEOUT = 20_000;

test('explorer page loads with latest blocks and transactions', async ({ page }) => {
await page.goto('/vibenet/explorer');

await expect(page).toHaveTitle(/Explorer · Vibenet/);
await expect(page.getByText('Latest Blocks')).toBeVisible();
await expect(page.getByText('Latest Transactions')).toBeVisible();

// A running chain always has blocks; transactions can be momentarily empty
// after a reset, so accept the empty state there.
await expect(page.locator('tr[aria-label^="Block "]').first()).toBeVisible({
timeout: ROW_TIMEOUT,
});
const txRow = page.locator('tr[aria-label^="Transaction "]').first();
await expect(txRow.or(page.getByText('No transactions yet'))).toBeVisible({
timeout: ROW_TIMEOUT,
});
});

test('explorer opens the latest block', async ({ page }) => {
await page.goto('/vibenet/explorer');

const latestBlock = page.locator('tr[aria-label^="Block "]').first();
await expect(latestBlock).toBeVisible({ timeout: ROW_TIMEOUT });
await latestBlock.getByRole('link').first().click();

await expect(page).toHaveURL(/\/vibenet\/explorer\/block\//);
await expect(page.getByText('Gas Limit')).toBeVisible({ timeout: ROW_TIMEOUT });
});

test('explorer opens the latest transaction', async ({ page }) => {
await page.goto('/vibenet/explorer');

const latestTx = page.locator('tr[aria-label^="Transaction "]').first();
await expect(latestTx.or(page.getByText('No transactions yet'))).toBeVisible({
timeout: ROW_TIMEOUT,
});
// Nothing to open right after a reset — skip rather than fail.
test.skip(
await page.getByText('No transactions yet').isVisible(),
'no transactions on vibenet yet',
);

await latestTx.getByRole('link').first().click();
await expect(page).toHaveURL(/\/vibenet\/explorer\/tx\//);
await expect(page.getByText(/^Logs \(/)).toBeVisible({ timeout: ROW_TIMEOUT });
});
8 changes: 8 additions & 0 deletions e2e/faucet.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect, test } from '@playwright/test';

test('faucet page loads', async ({ page }) => {
await page.goto('/vibenet/faucet');

await expect(page).toHaveTitle(/Faucet · Vibenet/);
await expect(page.getByText('Recipient Address', { exact: true })).toBeVisible();
});
8 changes: 8 additions & 0 deletions e2e/vibenet.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect, test } from '@playwright/test';

test('vibenet home page loads', async ({ page }) => {
await page.goto('/vibenet');

await expect(page).toHaveTitle(/Vibenet · Base Chain/);
await expect(page.getByText(/ephemeral Base developer network/)).toBeVisible();
});
Loading