Skip to content

Latest commit

 

History

History

integration-tests

Integration tests for for Block Explorer UI and API

Based on Jest.io/TypeScript/TDD.

Installation

npm install

Setting up env variables

  • Create .env file in the integration-tests/src/playbook/ package folder and copy paste .env.example content in there.
cp .env.example packages/integration-tests/src/playbook/.env
  • Add your private wallet key to WALLET_PRIVATE_KEY= By default we use richWalletPrivateKey private key in integration-tests/src/playbook/utils/getWallet.ts from integration-tests/src/entities.ts.

Preparing a local environment

Make sure you have Docker installed. Before running the tests you need to spin up a local environment (use docker-compose.yaml from the root directory):

docker compose up

Running API tests

-- all tests:

npm run integration-test:api 

Running UI tests

-- all tests:

npm run integration-test:ui 

If you need to run the exact test or/and suite you can change key-words from it to fit (for the test) and describe to fdescribe for suite.

If you need to exclude some specific test/suites, you can change keywords it to xit and/or describe to xdescribe.

The test solution contains two main folders: src and tests. src folder contains:

  • essential scenarios
  • predefined entities and config config files
  • contracts folder with a set of contracts
  • deploy folder with a set of deploy scripts
  • buffer folder as a temporary storage of transaction hashes and addresses
  • utils folder with utils scripts

tests folder contains sets of:

  • api endpoints tests, which cover essential part of worker and api functionality
  • ui UI tests, which cover essential part of Block explorer functionality