This is the accompanying demo repository for our article on testing blockchain applications with Playwright, Anvil, and Wagmi. Be sure to check it out if you need any extra guidance!
Make sure you have a relatively recent version of Node installed. Make sure you have Foundry's Anvil (or a comparable testnet node service) installed.
npm install
Run the Vite dev server:
npm run dev
Run the following in parallel:
anvil
When you have the development server and anvil running, it's very helpful to run tests with Playwright's UI mode:
npm test -- --ui
If you want to test against a prod build and have anvil spun up automatically:
npm run build
npm test