Manoj Sharma
- python3
- pip3
- Clone the repo
- Go to project directory
cd py_api_test_automation_tests
- Install poetry
pip3 install poetry
- Go to virtual env
poetry shell
- Install dependencies
poetry install
We need API_KEY to run these tests. Either set the environment variable or add the API_KEY directly in the config file. API KEY is used to create APP_KEY in the BG API tests.
export API_KEY=<Your environment specific app key>
export REALM=<'develop','alpha' or 'beta'>
⚠️ We need to place the required config file in resources folder under tests (tests/resources/config.yaml).
TestConfig:
testDataPrefix: API-AUTOMATION-TEST-
realm: $REALM #set this value directly in yaml or set it via environment variable
logRequestResponse : False #set it to True or False depending upon if you want to log request/response in report and on console
beta:
Services:
SampleService:
baseUri: https://platform-core-qa-api.beta.celonis.cloud
apiKey: $API_KEY #set this value directly in yaml or set it via environment variable
alpha:
Services:
SampleService:
baseUri: https://business-graph.alpha.celonis.cloud
apiKey: $API_KEY #set this value directly in yaml or set it via environment variable
headers:
- name: Authorization
value: Bearer $API_KEY #set this value directly in yaml or set it via environment variable
- name: tests
value: tests
SampleStreamService:
baseUri: https://business-graph.alpha.celonis.cloud
apiKey: $API_KEY #set this value directly in yaml or set it via environment variable
stream: True
headers:
- name: Authorization
value: Bearer $API_KEY #set this value directly in yaml or set it via environment variable
develop:
Services:
SampleService:
baseUri: https://platform-core-qa-api.develop.celonis.cloud
apiKey: $API_KEY #set this value directly in yaml or set it via environment variable
⚠️ Create a settings.py folder in the root of the project. This is used to standarize the ROOT_DIR.
import os
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
poetry run pytest
Or filter the test run using markers
poetry run pytest -m <markers>
eg. to run all tests marked with '@pytest.mark.sanity'
poetry run pytest -m sanity
Test Report are generated inside the report folder in root directory. If logRequestResponse property is enabled, then request/response body is also added to the report. This is useful in case of CI/CD run.
Contributions are always welcome! Thanks to all the contributions ⭐
Reach out to Manoj Sharma for queries.
⚠️ Note: Details will be added soon......
Reach out to Manoj Sharma for queries.