Synpress is a testing framework built on top of Cypress that provides support for decentralized applications (DApps). It enables end-to-end testing with MetaMask integration, making it ideal for Web3 projects.
To set up the project, first install the necessary dependencies using npm
:
npm i
- Copy the example environment configuration file:
cp .env.example .env
- Update the
cypress.env.json
file with your test environment details:
{
"ENV_NAME": "LOCAL",
"BASE_URL": "https://metamask.github.io/test-dapp/",
"WALLET_ADDRESS": "0x7c71a3d85a8d620eeab9339cce776ddc14a8129c"
}
Ensure that the wallet address and any other environment-specific settings are correctly updated.
To execute the test cases, you can use one of the following commands:
- For running Synpress end-to-end tests:
npm run e2e:synpress
- For live execution with real-time feedback:
npm run e2e:synpress:live
For a more in-depth explanation of how this project works, including use cases and testing scenarios, please refer to this article on Medium.