This is a Demo test framework for Automation QA course.
Example of pytest + allure based automation test framework. Follow link for details lesson1.
Same framework extended with REST API test cases for saas-template project. Follow link for details lesson2.
Compare lesson1 and lesson2.
Same framework extended with Dockerfile and Jenkinsfile examples. Follow link for details lesson3.
Compare lesson2 and lesson3.
pytest
allure-pytest
requests
Also one need to install Alure CLI to be able generate allure reports, see https://docs.qameta.io/allure/latest/#_reporting.
One can configure test execution against specific environment using environment variables:
Name | Required | Default | Example |
---|---|---|---|
ENVIRONMENT | yes | none | QA, Stage |
TEST_TYPE | yes | none | ui, api |
RESULTS_FOLDER | no | reports | reports |
ENVIRONMENT=QA
TEST_TYPE=api
RESULTS_FOLDER=reports
pytest test/api --alluredir $RESULTS_FOLDER/$TEST_TYPE
allure serve reports
`
docker build -t automation_demo .
mkdir out_docker_results
# Fix Linux
docker run -v $(pwd)/out_docker_results:/out:rw -e "ENVIRONMENT=QA" -e "TEST_TYPE=api" -it automation_demo pytest test/$TEST_TYPE --alluredir /out/$TEST_TYPE
# For Windows
docker run -v /c/users/out_docker_results:/out:rw -e "ENVIRONMENT=QA" -e "TEST_TYPE=api" -it automation_demo pytest test/$TEST_TYPE --alluredir /out/$TEST_TYPE
allure serve out_docker_results