Setup with Cypress
This guide provides a streamlined setup process for integrating Cypress with Synpress to automate tests for Web3 dapps. While this covers the basic configuration, Synpress offers a wide range of advanced features for comprehensive testing.
Prerequisites
- Node.js v18+
- Basic knowledge of Cypress and TypeScript
Installation
Install Cypress and Synpress in your project:
Setup
-
Create a Cypress configuration file (
cypress.config.ts
) in your project root: -
Create a support file (
src/cypress/support/e2e.ts
): -
Update your
tsconfig.json
to include Cypress types:
Writing Tests
Here’s an example of how to write tests using Cypress with Synpress:
-
Create a test file (e.g.,
test/cypress/e2e/metamask.cy.ts
):
Running Tests
To run your Cypress tests with Synpress:
-
Start your local development server (if testing against a local app).
-
Run the tests:
This will execute your tests using Cypress with Synpress integration.
Next Steps
- Explore the API documentation for detailed Synpress functionalities
- Check out example projects in the Synpress GitHub repository
- Join our Discord community for support and best practices