Python Test Framework with Behave, Playwright, and BehaveX
A robust test automation framework built with Python, utilizing Behave for BDD, Playwright for browser automation, and BehaveX for parallel execution. The framework supports Allure and BehaveX HTML for reporting, and integrates seamlessly with Elasticsearch and Kibana for advanced test result analysis and visualization.
- Execute
pip3 install -r requirements.tx
- Set up allure-report
Ref Link: https://allurereport.org/docs/install/
# Linux Download from https://allurereport.org/docs/install-for-linux/ Execute: sudo dpkg -i allure_*_all.deb Execute: allure --version
- Execute
playwright install
(To install Playwright browsers) - Setup
resources/details.ini
asdelete_old_reports = true [false] start_docker_compose = false [/true] (if false then framwork assumes selenium is running already. Required only if PLaywright is ruuning on Selenium) password_for_sshpass = "passowrd" (this has no affect but can be useful if anyone want to start docker-compose where sudo is required) headless = true [/false] allow_tracing = true [/false] tags = (Provide specifi tag like tags = @QA-1) add_in_elk = false [/true] (if true then framework assuemes elastic search is running) - if add_in_elk is true the set elk_url = https://elk.com send_report_on_email = true [/false] - if send_report_on_email is true the provide below: - token = (Check Notes -> 'Create Gmail Key Password' to generate Token) - sender_email = sender@gmail.com - receiver_email = receiver@gmail.com selenium_host_ip = (Selenium host - required only if PLaywright is ruuning on Selenium) browser = Chrome [/Firefox] url = https://www.saucedemo.com
- Execute
python3 runner.py
- Check all behave options
behave -h
- Check all allure options
allure -h
- Check all playwright options
playwright -h
- Execute
allure serve FOLDER_PATH
to start and create allure-report
- Test is using https://www.saucedemo.com
- Test will be executed in parallel scenario by scenario
- Create Gmail Key Password
1. Goto: https://myaccount.google.com/apppasswords 2. Enter App Name 3. Copy generated password 4. Provide in resources/details.ini
- The test runs on local browsers. But docker support is also available (Refer
start_docker_compose()
in runner.py) - Reports will be available as below:
- Allure:
reports/allure_report
- Behavex HTML:
report/html
- Allure:
- Refer behave.ini for all settings