Fork this repository and create a comprehensive suite of end-to-end (e2e) tests for a decentralized application (DApp) that interacts with a smart contract on the Sepolia Testnet. The DApp consists of a smart contract and a Next.js frontend application. You can access the DApp from https://qa-challange.netlify.app.
Organize this project as you prefer. Inside the folder e2e you will find the the feature files, which following the Gherkin syntax for behavior-driven development (BDD). Use the following existing feature files as a basis for this challenge:
01-app-access.feature02-search-erc20-token.feature03-deposit-erc20-token.feature
- Test the connection to the user's wallet (e.g., MetaMask)
- Verify that the ERC20 token address input field works correctly
- Test the display of the current token balance
- Test the token transfer process from the wallet to the smart contract
- Execute the e2e tests using a GitHub Actions workflow
- Document how to run tests
- Be proactive in providing feedback in an MD document about this exercise and share your thoughts on what other aspects should be taken care of to ensure a good level of quality for a web application
- [Bonus] Display test results in an easily shareable format
This is a Next.js project that uses the Web3 library to interact with the MetaMask wallet and perform actions by calling smart contract methods.
To use this application, you need to:
- Install MetaMask on your browser (Download MetaMask)
- Connect MetaMask to the Sepolia testnet
Network Name: Sepolia RPC URL: https://sepolia.infura.io/v3/ Chain ID: 11155111 Currency Symbol: SepoliaETH Block Explorer URL (Optional): https://sepolia.etherscan.io
Get free ETH from these faucets:
- https://sepoliafaucet.com (connect with Alchemy)
- https://faucets.chain.link/sepolia
The application allows interaction with ERC20 tokens deployed on the Sepolia testnet. For testing purposes, you can use our example ERC20 token deployed at:
0x9982f9A3bA28c34aD03737745d956EC0668ea440
By selecting this token, the application will allow you to mint 100 tokens at a time.
-
Open a terminal at the root path of this project
-
Execute the following command:
docker-compose up -d
-
Access the application at http://localhost:3000 using your browser
-
Open a terminal at the root path of this project
-
Execute the following commands:
npm install npm run build && npm run start -
Access the application at http://localhost:3000 using your browser