Skip to content

roopeshh/github-public-api-tests

Repository files navigation

Prerequisites

  1. Docker should be installed. You can install the latest version from here.
  2. Nodejs should be installed. You can install the LTS version from here.
  3. Allure should be installed for viewing the test results. You can install the latest version from here.
  4. You will need a IDE/text editor like VSCode/WebStorm or similar to view/edit the code.

How to run the tests locally

  • To test with npm: Update src/config/local.env with your github username and personal access token.
  • To test with docker: Update Dockerfile with your github username and personal access token.
  • You can generate personal access token from your github account -> https://github.com/settings/tokens.

Test With Makefile (npm)

  1. Open the project folder (github-public-api-tests).
  2. Run source src/config/local.env to set environment variables on your command line.
  3. Run command make npm on your command line. It will run the tests and opens the allure test report in the browser.

Test With Makefile (docker)

  1. Open the project folder (github-public-api-tests).
  2. Run command make docker on your command line. It will run the tests on docker locally. Unfortunately, allure doesn't have official image yet for reports on docker.

Other way

  1. Open the project folder (github-public-api-tests).
  2. Run npm install on your command line to install all the dependencies.
  3. Run source src/config/local.env to set environment variables on your command line.
  4. To run the tests, run command npm test. You can check for the test results in the terminal.
  5. To see the test report run command allure serve. This opens test report in your browser.

Note:

  • All the commands are run from folder github-public-api-tests.
  • If you want to use the username and personal access token of my test account it is already saved in local.env. But, the personal access token expires and you will have to request me for the new token(could be related to 2FA). Sorry for the inconvenience.

CI/CD:

  • Gitlab-CI integration is available here.
  • For now, tests can be run on gitlab and then the test results in xml are stored as artifacts. But, we do not have the results in html yet.

About

API tests for GitHub public APIs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published