Skip to content

chrispsheehan/coin-typescript-api-test-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScriptAPITestFramework

This framework targets the Coin Ranking API.

Configuration

Configuration is stored in the below format. Auth token will need to be populated. It can be obtained from the RapidApi site.

{
    "BASE_URL" : "https://coinranking1.p.rapidapi.com",
    "AUTH_TOKEN" : "[ENTER_AUTH_TOKEN_HERE]"
}

All below jobs are dependant on each other and defined in .github/workflows/github-ci.yml.

  • Build: Ensures no build time errors
  • Test: Ensures no failures during tests
  • Publish: Builds image and pushes to Dockerhub

Required GitHub repositry secrets

  • API_CONFIG: Json string as per above configuration json.
  • DOCKER_PASSWORD: Username used to log into Dockerhub
  • DOCKER_USERNAME: Password used to log into Dockerhub

Run it locally

cd src
npm run build
npm run test

Run it in docker

Build the image locally.

docker build . -t [YourImageName] 

Run the container.

docker run -it [YourImageName] 

Filters

Filters can be appended to local and docker tests.

Documentation found here

Examples filters;

"(@coins and not @exchanges)"
"(@coins or @exchanges)"
"@coins"
  • Local: tags=@coins npm run test
  • Docker: docker run -it [YourImageName] --tags=@coins

Run in parallel

Simply add parameter as per below

--parallel 3

To-Do

  • Proper versioning on docker images. At the moment all images are tagged with latest, ideally this would be an incremented major/minor version.
  • Work out why the exchanges/ endpoints aren't authenticating.
  • Logging

About

BDD test framework for API tests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published