Skip to content

Conversation

@AugustoL
Copy link
Collaborator

@AugustoL AugustoL commented Dec 10, 2025

Add comprehensive Playwright E2E test suite for OpenScan Explorer using Ethereum mainnet data.

Test Coverage (43 tests)

Block Page (7 tests)

Transaction Page (7 tests)

  • Legacy (Type 0) transactions - pre-EIP-2718
  • EIP-1559 (Type 2) transactions - post-London with maxFeePerGas
  • From/to address display and linking
  • Transaction value and fee calculations
  • Input data and other attributes section
  • Block number linking
  • Invalid transaction hash handling

Address Page (17 tests)

  • EOA accounts with balance and transaction count
  • ENS name resolution (vitalik.eth)
  • ERC20 token contracts (USDC) with contract details
  • Verified contracts (Uniswap Router) with bytecode section

ERC721 (BAYC) tests:

  • Collection details (name, symbol, 10,000 NFTs total)
  • Contract verification (date, Partial Match, compiler 0.7.0)
  • Read functions (21): name, symbol, totalSupply, balanceOf, ownerOf, tokenURI, etc.
  • Write functions (16): approve, transferFrom, safeTransferFrom, etc.
  • Events (4): Approval, ApprovalForAll, OwnershipTransferred, Transfer

ERC1155 (Rarible) tests:

  • Multi-token collection details (name, symbol, metadata URI)
  • Contract verification (date, MATCH type, compiler 0.5.17)
  • Read functions (16): balanceOf, name, symbol, uri, supportsInterface, etc.
  • Write functions (12): mint, burn, safeTransferFrom, setApprovalForAll, etc.
  • Events (8): TransferSingle, TransferBatch, ApprovalForAll, URI, etc.

Token Detail Page (12 tests)

ERC721 Token Tests (BAYC #1 and #100):

  • NFT Details section (Token ID, Token Standard, Collection Size, Owner)
  • Token image display
  • Properties/attributes grid with trait types and values
    • BAYC Add types #1: Mouth: Grin, Clothes: Vietnam Jacket, Background: Orange, Eyes: Blue Beams, Fur: Robot
    • BAYC Improve e2e tests #100: Background: Yellow, Mouth: Bored Cigarette, Hat: Party Hat 2, Fur: Dark Brown, Eyes: Wide Eyed
  • Token URI section with IPFS link and Open URI button
  • Raw Metadata section (expandable)
  • Navigation from collection page via token lookup input

ERC1155 Token Tests (Rarible):

  • Token details page display
  • Balance lookup section (unique to ERC1155)
  • Navigation from collection page

Error Handling:

  • Invalid token ID handling
  • Invalid contract address handling

Infrastructure

  • Page Object Model pattern for maintainable tests
  • GitHub Actions workflow runs tests on every PR
  • Mainnet fixtures indexed by block number and transaction hash
  • Headless mode by default (no browser windows opening)
  • Graceful error handling for RPC rate limiting and network issues

Files Added/Modified

e2e/
├── fixtures/
│   └── mainnet.ts          # Ethereum mainnet test data
├── pages/
│   ├── address.page.ts     # Address page object
│   ├── block.page.ts       # Block page object
│   └── transaction.page.ts # Transaction page object
└── tests/
    ├── address.spec.ts     # Address page tests
    ├── block.spec.ts       # Block page tests
    ├── token.spec.ts       # Token detail tests
    └── transaction.spec.ts # Transaction page tests

.github/workflows/e2e.yml   # CI workflow
playwright.config.ts        # Playwright configuration
README.md                   # Updated with E2E section

…ss pages

Add comprehensive E2E test suite using Playwright with Ethereum mainnet fixtures:

Block tests:
- Pre-London blocks (openscan-explorer#10,000, openscan-explorer#1,000,000) with difficulty, total difficulty
- Post-London blocks (openscan-explorer#20,000,000) with base fee, burnt fees, withdrawals
- London hard fork boundary blocks (openscan-explorer#12,964,999, openscan-explorer#12,965,000)
- More details section with all hash fields verification

Transaction fixtures covering all types:
- Legacy (Type 0) - pre-EIP-2718
- EIP-1559 (Type 2) - post-London with maxFeePerGas
- Blob (Type 3) - post-Dencun with blob gas fields
- Failed transactions and contract creations

Address tests:
- EOA accounts with ENS resolution
- ERC20 token contracts (USDC)
- Verified contracts (Uniswap Router)

Infrastructure:
- Page Object Model pattern for maintainability
- GitHub Actions workflow for PR testing
- Mainnet fixtures indexed by block number/tx hash
@github-actions
Copy link

github-actions bot commented Dec 10, 2025

🚀 Preview: https://pr-88--openscan.netlify.app
📝 Commit: 1c1987afb5a2d72d85767c4a11abb0becfd45153

ERC721 (BAYC) tests:
- Collection details (name, symbol, total minted)
- Contract verification (date, match type, compiler 0.7.0)
- Read functions (21): name, symbol, totalSupply, balanceOf, ownerOf, etc.
- Write functions (16): approve, transferFrom, safeTransferFrom, etc.
- Events (4): Approval, ApprovalForAll, OwnershipTransferred, Transfer

ERC1155 (Rarible) tests:
- Multi-token collection details (name, symbol, metadata URI)
- Contract verification (date, MATCH type, compiler 0.5.17)
- Read functions (16): balanceOf, name, symbol, uri, etc.
- Write functions (12): mint, burn, safeTransferFrom, etc.
- Events (8): TransferSingle, TransferBatch, ApprovalForAll, URI, etc.

Token detail page tests:
- ERC721 token viewing with image container and details section
- ERC1155 token viewing with balance lookup section
- Navigation from collection page via token lookup input
- Error handling for invalid tokens/contracts
Token fixtures with detailed metadata:
- BAYC openscan-explorer#1: properties (Mouth: Grin, Clothes: Vietnam Jacket, Background: Orange, Eyes: Blue Beams, Fur: Robot)
- BAYC openscan-explorer#100: properties (Background: Yellow, Mouth: Bored Cigarette, Hat: Party Hat 2, Fur: Dark Brown, Eyes: Wide Eyed)
- Token URIs, collection size (10,000 NFTs)

Token detail page tests:
- NFT Details section (Token ID, Token Standard, Collection Size, Owner)
- Token image display
- Properties/attributes grid with trait types and values
- Token URI section with IPFS link and Open URI button
- Raw Metadata section (expandable)
- Different properties for different tokens (openscan-explorer#1 vs openscan-explorer#100)
@AugustoL AugustoL requested a review from MatiasOS December 11, 2025 11:47
@AugustoL AugustoL marked this pull request as ready for review December 11, 2025 11:47
@AugustoL AugustoL merged commit a032d5d into openscan-explorer:dev Dec 11, 2025
3 checks passed
@AugustoL AugustoL mentioned this pull request Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants