xaqua-udp-automation-testing

Python Behave (BDD) Test Automation Framework for Web, API, & Browser Stack

Authors

Description

Python Behave Test Automation Framework is a behavior-driven development (BDD) framework designed for web, API, and browser stack testing. It leverages Python’s simplicity and readability along with the powerful Behave library to provide an efficient and structured approach to automated testing.

This framework aims to streamline the testing process by enabling testers and developers to write test scenarios in natural language using Gherkin syntax. It encourages collaboration between stakeholders by providing a common language for defining test cases and requirements, making it easier to understand and maintain test suites.

Features

  1. Behavior-Driven Development (BDD): Utilizes Gherkin syntax to define test scenarios in a human-readable format, fostering collaboration and communication between team members.
  2. Web Testing: Supports automated testing of web applications using Selenium WebDriver, allowing for UI testing across different browsers.
  3. API Testing: Provides capabilities for testing RESTful APIs using Python’s requests library, enabling validation of API endpoints and responses.
  4. Browser Stack Integration: Seamlessly integrates with BrowserStack for cross-browser and cross-platform testing, ensuring compatibility and consistency across various environments.
  5. Modular Structure: Organizes test code into reusable modules, making it easy to maintain and scale the test suite as the application evolves.
  6. Reporting and Logging: Generates detailed test reports in HTML format using Allure Framework, providing insights into test execution results, including logs, screenshots, and attachments.
  7. Configuration Management: Supports configuration management through JSON files, allowing for easy configuration of test data, environment settings, and browser capabilities.
  8. Continuous Integration (CI) Ready: Designed to be integrated with popular CI/CD tools like Jenkins, GitLab CI/CD, and GitHub Actions for automated test execution and reporting.
  9. Extensibility: Provides hooks and customizations for extending and enhancing test functionality, such as setting up test fixtures, teardown actions, and test data management.
  10. Scalability: Designed for scalability, allowing for the addition of new features, test cases, and integrations as the testing requirements grow.

Table of Contents

Pre-Requisite

Required tools for the project

Technology_used_in_Framework

AUTOMATION:

REPORTING TOOL :

FRAMEWORK DESIGN PATTERN :

OS for Execution on Local:

OS for Execution on CI/CD:

Note:

Please make sure you have all technologies in your local machine installed or configured.

Installation

To Clone this repository to a local directory

Commands to clone and run the test cases

The above command will clone this repository on your machine locally.

1)To run tests first need to install Selenium

    pip install selenium

2)Install Webdriver Manager

    pip install webdriver-manager

3)Install Behave

    pip install behave

4)Install Allure to generate the report

    pip install allure-behave
    
    pip install allure-python-commons

    pip install allure-combine

Execution

5)To run all the feature file

    behave Features -f allure_behave.formatter:AllureFormatter -o Report_Json

6)To run single feature file

    behave Features/Bmi_Calculator.feature -f allure_behave.formatter:AllureFormatter -o Report_Json

7)To run test cases using Tag name from single feature file

    behave Features/Bmi_Calculator.feature --tags=smoke  -f allure_behave.formatter:AllureFormatter -o Report_Json

8)To run test cases using Tag name from all feature files

    behave Features --tags=regression  -f allure_behave.formatter:AllureFormatter -o Report_Json

Report_Generation

9)To generate HTML report folder from JSON report folder

    allure generate Report_Json -o Report_Html --clean

10)To generate sharable HTML report

    allure-combine Report_Html --dest Final_Report --auto-create-folders

Framework_Structure

image

Features

Environment File (Hooks File)

Pages

Steps

Resources

Utils

Resource

Generated_Reports

image

image