{"id":29584149,"url":"https://github.com/prashant1507/playwright-behave-allure-framework","last_synced_at":"2025-07-20T00:06:18.727Z","repository":{"id":304458088,"uuid":"1018851704","full_name":"prashant1507/playwright-behave-allure-framework","owner":"prashant1507","description":"Python BDD test framework with Playwright, Behave, and Allure","archived":false,"fork":false,"pushed_at":"2025-07-13T08:17:26.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-13T09:24:51.424Z","etag":null,"topics":["allure-reports","bdd","behave","parallel-testing","playwright","python3"],"latest_commit_sha":null,"homepage":"https://github.com/prashant1507/playwright-behave-allure-framework","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prashant1507.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-13T07:23:27.000Z","updated_at":"2025-07-13T07:50:51.000Z","dependencies_parsed_at":"2025-07-13T09:34:59.505Z","dependency_job_id":null,"html_url":"https://github.com/prashant1507/playwright-behave-allure-framework","commit_stats":null,"previous_names":["prashant1507/playwright-behave-allure-framework"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/prashant1507/playwright-behave-allure-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashant1507%2Fplaywright-behave-allure-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashant1507%2Fplaywright-behave-allure-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashant1507%2Fplaywright-behave-allure-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashant1507%2Fplaywright-behave-allure-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prashant1507","download_url":"https://codeload.github.com/prashant1507/playwright-behave-allure-framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashant1507%2Fplaywright-behave-allure-framework/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266047213,"owners_count":23868706,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["allure-reports","bdd","behave","parallel-testing","playwright","python3"],"created_at":"2025-07-20T00:06:16.171Z","updated_at":"2025-07-20T00:06:18.712Z","avatar_url":"https://github.com/prashant1507.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Automation Framework with Playwright + Behave + Allure\n\n[![Python](https://img.shields.io/badge/Python-3.12+-blue.svg)](https://python.org)\n[![Playwright](https://img.shields.io/badge/Playwright-Latest-green.svg)](https://playwright.dev)\n[![Behave](https://img.shields.io/badge/Behave-Latest-orange.svg)](https://behave.readthedocs.io)\n[![Allure](https://img.shields.io/badge/Allure-Latest-red.svg)](https://docs.qameta.io/allure/)\n\nA powerful, scalable automation framework combining **Playwright** for browser automation, **Behave** for BDD testing, *\n*Allure** for reporting, and **Page Object Model** for maintainable test structure.\n\n## 🚀 Quick Start\n\n```bash\n# Clone and setup\ngit clone https://github.com/prashant1507/playwright-behave-allure-framework.git\ncd playwright-behave-allure-framework/\n\n# Install dependencies\npip install -r requirements.txt\nplaywright install\n\n# Install node for checking tracing\nbrew install node\n\n# Run your first test\npython run_tests.py --tags @smoke\n```\n\n---\n\n## 📋 Table of Contents\n\n- [✨ Key Features](#-key-features)\n- [🏗️ Architecture](#️-architecture)\n- [⚙️ Setup Guide](#️-setup-guide)\n- [🧪 Running Tests](#-running-tests)\n- [📊 Reporting](#-reporting)\n- [🏷️ Tag Filtering](#tag-filtering)\n- [�� Code Organization](#code-organization)\n- [🔍 Investigate Tracing](#investigate-tracing)\n- [📄 Log Files](#log-files)\n\n---\n\n## ✨ Key Features\n\n| Feature                       | Description                                             | Benefits                                        |\n|-------------------------------|---------------------------------------------------------|-------------------------------------------------|\n| 🏗️ **Page Object Model**     | Centralized element selectors and reusable page methods | Maintainable, scalable test structure           |\n| 🚀 **Parallel Execution**     | Multi-worker test execution feature-by-feature          | Faster test execution, efficient resource usage |\n| 🏷️ **Smart Tag Filtering**   | Filter tests by tags (`@smoke`, `@regression`, `@api`)  | Run only relevant tests, reduce execution time  |\n| 📊 **Enhanced Reporting**     | Allure integration with automatic screenshots           | Detailed HTML reports with failure analysis     |\n| ⚙️ **Flexible Configuration** | YAML config + environment variables + command-line args | Easy configuration management                   |\n| 🌐 **Multi-Browser Support**  | Chromium, Firefox, WebKit support                       | Cross-browser testing capabilities              |\n| 🎯 **Clean Output**           | Filtered console output with organized reporting        | Reduced noise, better debugging                 |\n\n---\n\n## 🏗️ Architecture\n\n```\n┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   Feature Files │    │  Step Defs      │    │  Page Objects   │\n│   (Gherkin)     │───▶│  (Test Logic)   │───▶│  (Selectors)    │\n└─────────────────┘    └─────────────────┘    └─────────────────┘\n         │                       │                       │\n         ▼                       ▼                       ▼\n┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   Behave        │    │   Playwright    │    │   Allure        │\n│   (BDD Engine)  │    │   (Browser)     │    │   (Reporting)   │\n└─────────────────┘    └─────────────────┘    └─────────────────┘\n```\n\n---\n\n## ⚙️ Setup Guide\n\n### 1. Prerequisites\n\n- **Python 3.12+**\n- **Git** (for version control)\n- **Allure** (for reporting)\n\n### 2. Environment Setup\n\n```bash\n# Create virtual environment\npython -m venv venv\n\n# Activate virtual environment\n# On macOS/Linux:\nsource venv/bin/activate\n# On Windows:\nvenv\\Scripts\\activate\n\n# Upgrade pip\npip install --upgrade pip\n```\n\n### 3. Install Dependencies\n\n```bash\n# Install Python packages\npip install -r requirements.txt\n\n# Install Playwright browsers\nplaywright install\n```\n\n### 4. Install Allure (Optional)\n\n```bash\n# macOS (using Homebrew)\nbrew install allure\n\n# Windows (using Scoop)\nscoop install allure\n\n# Linux\nsudo apt-add-repository ppa:qameta/allure\nsudo apt-get update\nsudo apt-get install allure\n```\n\n### 5. Configuration\n\n#### Set URL in `config.yaml`:\n\n```yaml\nbase_url: https://httpbin.org\n```\n\n**Important:** The `base_url` is **required** in `config.yaml`. The framework will raise an error if it's missing.\n\n### 6. Verify Installation\n\n```bash\n# Run a quick test\npython run_tests.py --tags @smoke --headless\n```\n\n---\n\n## 🧪 Running Tests\n\n### Basic Test Execution\n\n```bash\n# Run all tests\npython run_tests.py\n\n# Run specific feature files\npython run_tests.py features/login.feature features/forms.feature\n\n# Run tagged tests\npython run_tests.py --tags @smoke\npython run_tests.py --tags @regression\n\n# Run with tracing\npython run_tests.py --tracing\n```\n\n### Parallel Execution\n\n```bash\n# Run with optimal worker count\npython run_tests.py --parallel\n\n# Run with custom workers\npython run_tests.py --parallel --workers 4\n\n# Run tagged tests in parallel\npython run_tests.py --parallel --tags @smoke @regression\n```\n\n### Browser Options\n\n```bash\n# Different browsers\npython run_tests.py --browser chromium\npython run_tests.py --browser firefox\npython run_tests.py --browser webkit\n\n# Headless mode\npython run_tests.py --headless\npython run_tests.py --browser firefox --headless\n```\n\n### Advanced Combinations\n\n```bash\n# Parallel execution with specific browser and headless mode\npython run_tests.py --parallel --browser firefox --headless --workers 4\n\n# Run specific tags with custom configuration\npython run_tests.py --tags @smoke @api --browser webkit --headless\n\n# Run with auto-serve report\npython run_tests.py --tags @smoke --serve-report\n```\n\n---\n\n## 📊 Reporting\n\n### Allure Reports\n\n```bash\n# Generate and serve report\npython run_tests.py --tags @smoke --serve-report\n\n# Or manually serve existing report\nallure serve reports/allure-results\n```\n\n### Report Features\n\n- **📊 HTML Reports** - Detailed test results with trends\n- **📸 Screenshots** - Automatic capture on failures\n- **📋 Failing Scenarios** - Clear summary of failed tests\n- **📈 Trends** - Historical test execution data\n- **🔍 Detailed Analysis** - Step-by-step failure analysis\n\n### Report Structure\n\n```\nreports/\n├── allure-results/          # Allure report data\n│   ├── *.json               # Test results\n│   └── *.xml                # Test metadata\n├── screenshots/             # Failure screenshots\n│   └── screenshot_*.png     # Automatic screenshots\n└── workers/                 # Parallel execution logs\n    └── worker_*.log         # Worker-specific logs\n```\n\n### Best Practices\n\n1. **Keep selectors in page objects** - Centralized element management\n2. **Keep assertions in step definitions** - Test logic separation\n3. **Use Playwright's `expect()`** - Reliable assertions\n4. **Create reusable page methods** - Reduce code duplication\n\n--- \n## Tag Filtering\n\nAvailable tags in the framework:\n\n- `@smoke` - Quick validation tests\n- `@regression` - Comprehensive test suite\n- `@api` - API testing scenarios\n- `@performance` - Performance testing\n\n```bash\n# Single tag\npython run_tests.py --tags @smoke\n\n# Multiple tags (OR logic)\npython run_tests.py --tags @smoke @regression\n\n# Parallel with tags\npython run_tests.py --parallel --tags @api\n```\n\n---\n\n### Code Organization\n\n1. **Keep step definitions focused**\n   ```python\n   @when(\"the user clicks the login button\")\n   def step_click_login(context):\n       login_page = context.page_factory.get_login_page(context.page)\n       login_page.click_login_button()\n   ```\n\n2. **Use page objects for interactions**\n   ```python\n   def click_login_button(self):\n       self.click_element(self.LOGIN_BUTTON)\n   ```\n\n3. **Use Playwright assertions**\n   ```python\n   expect(context.page).to_contain_text(\"Welcome\")\n   ```\n\n---\n\n### Investigate Tracing\n```bash\n# Install Playwright trace viewer\nnpx playwright show-trace reports/traces/FILE_NAME.zip\n\n# Or use the web interface\nnpx playwright show-trace --host 0.0.0.0 --port 8080 reports/traces/FILE_NAME.zip\n```\n---\n\n### Log Files\n\nCheck log files for detailed error information:\n\n- `reports/test.log` - Detailed test execution logs\n- `reports/workers/` - Parallel execution logs\n- `reports/traces/` - Tracing reports\n\n---\n\n*Built with ❤️ using Python, Playwright, Behave, and Allure*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprashant1507%2Fplaywright-behave-allure-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprashant1507%2Fplaywright-behave-allure-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprashant1507%2Fplaywright-behave-allure-framework/lists"}