GithubHelp home page GithubHelp logo

pyqa-apiv2's Introduction

BINK API 2.0

This is a framework design in Python for the test automation of Bink's APIs. The framework has been designed using the Pytest-BDD plugin to implement the BDD approach. Modules of the framework are designed in such a way that it can be reused by all merchants in any channels This framework will provide a Regression testing suite for all available API endpoints, and also serve for Sanity, Smoke testing & In- Sprint testing for all channels & merchants.

Set Up

This project requires an up-to-date version of Python 3 It uses poetry to manage packages. To set up this project on your local machine:

  1. Clone the repo from GitHub ([email protected]:binkhq/bink-api-v2-automation-suite.git)
  2. Execute poetry shell , from the project's root directory to create the virtual environment
  3. Execute poetry install to install depedndecies from pyproject.toml
  4. Install Azure CLI and login to Azure for Key Vault access brew install azure-cli az login

Executing Tests from Local

  1. Test Execution:

    • Use pytest command
    • Use markers '-m' to filter tests by BDD tags
    • Pass variables '--env' to set current environment (defaulted to staging)
    • The default environment is staging and default channel is bink
  2. A few sample execution commands:

    • pytest -m "add" --env staging : Execute Add Journey for all merchants in staging
    • pytest -m "add and viator" --env staging : Execute Add Journey for Viator in staging
    • pytest -m "add and enrol" : Execute Add & Enrol Journey for all merchants in staging
  3. Commands used for nighly regression in bink in staging

    • pytest -m "bink_regression_api2.0" --env staging
  4. Run Database query from the test scripts:

    • Connect to Tailscale
    • Set the env variable for DB in the terminal set HERMES_DATABASE_URI $(kubectl get secret azure-postgres -o json | jq -r .data.url_hermes | base64 --decode) (Env variables: HERMES_DATABASE_URI, HARMONIA_DATABASE_URI, SNOWSTORM_DATABASE_URI)
    • Execute the tests as usual from local

Executing tests from Kubernetes pods

  1. Create a new corn job : kubectl create job --from=cronjob/pyqa-apiv2 <jobname>
  2. Execute the whole suite:
  • To run a Check the pod status - A new pod will create and it will be in 'Running' status
  • Once all the tests are completed the HTML result will be published in Alerts-QA teams channel
  1. Execute a subset of tests fron the newly created pod:
  • Get the pod name : kubectl get pods
  • Get into the pod: kubectl exec -it <pyqa pod name> -- bash
  • Idetify the subset of tests need to execute by using the tags in th.feature files
  • Execute tests from terminal using pytest -m "<unique tag name>" --env staging

Scheduled Regression execution

  1. The whole suite will run based on the cron job 0 20 * * 1-5 ( Monday to Friday at 8pm) If any change needed in the schedule, update the same in gitops (https://github.com/binkhq/gitops/blob/master/overlays/uksouth-staging/olympus/pyqa-apiv2/cronjob.yaml)
  2. And the results will be published on Alerts-QA teams channel
  3. The generic tag used for regression execution :_ '@bink_regression_api2'_

Execution using Starbug

https://hellobink.atlassian.net/wiki/spaces/BD/pages/3802562640/Executing+API+v2.0+Automation+Framework+pyqa-apiv2+using+Starbug+tbc

pyqa-apiv2's People

Contributors

npatil2022 avatar braghavanbink avatar rpatelbink avatar navyaaj avatar navyaannajames avatar rupalpatelj112 avatar thenu97 avatar bv-binkqa avatar cpressland avatar haffi96 avatar skothabink avatar twinchester avatar dependabot[bot] avatar k-aziz avatar bmamidisetti avatar

Watchers

 avatar Francesco Milani avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.