- Install dependencies:
pnpm install - Start MetaMask Test Dapp:
pnpm run serve:test-dapp- Install Playwright:
pnpm exec playwright install 3a. If you do not have Anvil installed, go to the Foundry installation guide and follow the instructions.
- Build cache with our CLI by using a script:
# You can either build cache in a headed mode:
pnpm run build:cache
# Or in a headless mode:
pnpm run build:cache:headless- Run Playwright tests as you would normally do:
# Use one of our scripts:
pnpm run test:playwright:headful
pnpm run test:playwright:headless
pnpm run test:playwright:headless:ui
# Or use Playwright directly:
playwright test
HEADLESS=true playwright test
HEADLESS=true playwright test --uiCurrently, tests are triggered in a headed mode by default. Add HEADLESS=true to run them in a headless mode.
This behavior will change soon! 🫡
If you need more than this example project, check out our tests for MetaMask here.