Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cypress E2E tests for core functionality across multiple networks #140

Merged
merged 28 commits into from
Jul 31, 2024

Conversation

portdeveloper
Copy link
Member

@portdeveloper portdeveloper commented Jul 28, 2024

Description

This PR

  • Adds Cypress as a dev dependency
  • Adds id react-select-container to the div containing NetworksDropdown component for selection in Cypress tests
  • Implements 5 end-to-end tests to ensure core functionality
  • Runs a simple call to the heimdall backend to wake it up before the tests.
  • Implements a GitHub workflow that is run on pushes and pull requests on main

Before merging

  • We should add NEXT_PUBLIC_HEIMDALL_URL to GitHub Actions Repository secrets

Tests Added

  1. DAI Contract Interaction on Ethereum main net

    • Visits the application homepage
    • Inputs DAI contract address (0x6B175474E89094C44Da98b954EedeAC495271d0F)
    • Loads the contract and verifies URL
    • Interacts with balanceOf method
    • Verifies result display
  2. Proxy Contract Interaction on Base Network

    • Selects Base network from dropdown
    • Loads proxy contract (0xca808b3eada02d53073e129b25f74b31d8647ae0)
    • Verifies Implementation Address visibility
    • Interacts with balanceOf method using vitalik.eth address
    • Checks for result display
  3. Unverified Contract Interaction on Sepolia Testnet

    • Selects Sepolia network
    • Loads unverified contract (0x759c0e9d7858566df8ab751026bedce462ff42df)
    • Initiates decompilation process
    • Verifies presence of changeOwner write method in UI
  4. Contract Interaction on BNB Smart Chain

    • Navigates to "Other chains" and selects BNB Smart Chain
    • Loads WETH contract (0x2170ed0880ac9a755fd29b2688956bd959f933f8)
    • Interacts with balanceOf method
    • Verifies result display
  5. Custom Chain (Parex) Addition and ABI Submission

    • Adds Parex as a custom chain with specific network details
    • Loads a contract on Parex (0x6058518142C6AD506530F5A62dCc58050bf6fC28)
    • Manually submits contract ABI
    • Interacts with getUserBalance method
    • Verifies result display

Pics and video

Tests running on the same repo with env vars set:
image

0728.mp4

TODO

  • Update the README file to include information about running Cypress tests
  • ADD VIDEO AND PICTURES to the PR

Related Issues

*Fixes #137 *

Copy link

vercel bot commented Jul 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
abi-ninja-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 0:46am

@Ansonhkg
Copy link

This is cool!

@technophile-04
Copy link
Member

TYSM @portdeveloper this is really AWESOME!!!

@technophile-04 technophile-04 merged commit d0ebfcb into main Jul 31, 2024
4 checks passed
@portdeveloper portdeveloper deleted the feat/cypress-tests branch August 12, 2024 05:54
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.

Sample basic test example contracts
3 participants