zettpunkt79 / test-data-toolkit-py

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Evaluation of behave for test data creation via API

Installation

pipenv install

Excecution

pipenv run behave -D base_url="http://httpbin.org" -D username="user@example.com" -D password="secret"

or

BASE_URL="http://httpbin.org" pipenv runn behave

Excecute only scenarios with @focus tag

behave -D base_url="http://httpbin.org" --tags="@focus"

Build docker container

docker build . -t test-data-toolkit:latest

Dockerized execution

docker run -it test-data-toolkit:latest -D base_url="http://httpbin.org"

Dockerized execution with tags

docker run -it test-data-toolkit:latest -D base_url="http://httpbin.org" --tags="@focus"

Execute local changes in container

docker run -v ${pwd}/features:/home/worker/features -it -e BASE_URL=http://httpbin.org test-data-toolkit:latest

Start server to enable remote execution via API call

flask run -p 4000

Execute via API

curl -X POST -H 'Content-Type: application/json' -d '{"args": ["-D", "base_url=http://httpbin.org", "--tags", "@focus"}' http://localhost:4000/api/execute

About


Languages

Language:Python 73.8%Language:Gherkin 22.4%Language:Dockerfile 3.8%