Skip to content
pheeelPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

CI Tests

Faraway Tech Task

This repository contains testing framework based on Playwright, Typescript and Synpress using Playwright Test as a test runner.

Features:

  • Configurable amount of retries and max workers via .env file
  • Basic ESLint and Prettier configuration
  • CI setup for tests
  • Static code analysis on CI with TypeScript Compiler and ESLint
  • HTML report generation

Local Setup

First you'll need to install dependencies:

$ npm install

NOTE: If you don't have the correct version of Chromium installed, you can run the following command to install it:

$ npx playwright install chromium 

Now, we can optionally set up the environment variables. You can find .env file in the root directory of the project and change the following variables depending on your needs::

# Number of workers to run tests in parallel, default: 1
MAX_WORKERS=1 

# Number of retries for each test, default: 0
RETRIES=0 

Then we need to build our backend and frontend images, for that follow the steps below:

  1. Build the frontend and backend images:
$ docker pull evercoinx/faraway:nft-collection-deployer-frontend
$ docker pull evercoinx/faraway:nft-collection-deployer-backend
  1. Get corresponding image IDs
$ docker images
  1. Run containers
$ docker run -p 4000:4000 <Backend Image ID>   
$ docker run -p 3000:3000 <Frontend Image ID>

Running tests

To run the tests in the chromium project:

$ npm run test

Generating Report

To generate and open HTML report of the last tests run:

$ npx playwright show-report

Static Code Analysis

You can also check static code analysis issues with the following commands:

$ npm run lint:fix # Check and fix ESLint issues
$ npm run prettier # Format code with Prettier
$ npm run tsc # Check TypeScript compilation issues

CI Run

Open GitHub Action and trigger the job manually.

Additional Notes

Tests may fail due to non-isolated environment - the smart contract can be triggered by other users causing new event to appear in the app.

Tests may fail due to insufficient MATIC tokens in the test account. You can top up the account balance by using the faucet: https://www.alchemy.com/faucets/polygon-mumbai
The test account address is: 0x5dF162C376950311F2EE4241180611c81c30F517

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages