Test automation framework repo to execute described tests against mento-web and other possible projects
Here you can find more detailed overview of test automation
- Execute
npm install. - Execute
npm run install-playwright. - Fill the
SEED_PHRASE, andWALLET_PASSWORDvariables. - Specify the
IS_MAINNETvariable (ensure you re-built synpress cache when changing a chain by this flag!). - Execute
npm run build-synpress-cache.
Install Foundry (includes Anvil):
# Using the official installer
curl -L https://foundry.paradigm.xyz | bash
foundryup
# OR using Homebrew (macOS)
brew install foundry| Variable | Example | Description |
|---|---|---|
| *ENV | prod |
required env, default prod |
| *SPECS_TYPE | web |
required specs type to run. Can be: all or web or api |
| SPECS_REGEX | connect-wallet,wallet-modal |
specs names or tags separated by comma which will be executed locally, if no or disabled will execute all specs, disabled by default |
| TEST_RETRY | 1 |
retries N times if test fails, disabled by default |
| *SEED_PHRASE | 'seed phrase' |
required seed phrase for connection of metamask wallet |
| *WALLET_PASSWORD | 'password' |
required password for connection of metamask wallet |
| *IS_MAINNET | 'true' |
required flag to specify chain for test running |
| IS_FORK | 'true' |
enable fork mode for local testing with Anvil, disabled by default |
| TEST_RUN_TIMEOUT | 120_000 |
custom test run timeout, disabled by default |
| TEST_TIMEOUT | 120_000 |
custom test timeout, disabled by default |
| LOG_LEVEL | DEBUG |
desired log level, disabled by default. Can be: ALL, TRACE, INFO, DEBUG |
| TESTOMAT_REPORT_GENERATION | false |
desired option to generate testomat test run report or not. Can be: true or false |
| TESTOMATIO_TITLE | your own title |
desired testomat test run report title to run locally. |
| *TESTOMAT_API_KEY | api key |
testomat api key to run locally. Can be taken from GH actions secrets or lastPass note |
- headed - with opening browser (command can be shortened to
npm t)
npm run test
- ui - with opening browser in specified app with all devtools, traces, and other playwright features
npm run test:ui
- debug - with opening browser and specified debug app to pause/resume test
npm run test:debug
- headless - without opening browser and other playwright features
npm run test:headless
- Navigate to the CI
- Select the "Specific Test Run" workflow
- Click on the "Run workflow" drop-down
- Select a branch, write a spec name/s, and select specs type
You can run tests against a local fork of Celo mainnet or testnet for faster, deterministic testing without real gas costs (it also runs a blockexplorer to be able to work with our dApps).
-
Specify IS_FORK=true and SEED_PHRASE to use a fork value.
-
Start a fork with a blockexplorer via makefile:
# Fork Celo mainnet with a block explorer
make mainnet-fork-setup- Build synpress cache on a fork:
npm run build-synpress-cache- Run tests:
npm test