0
0
Testing Fundamentalstesting~8 mins

Regression testing in Testing Fundamentals - Framework Patterns

Choose your learning style9 modes available
Framework Mode - Regression testing
Folder Structure for Regression Testing Framework
regression-testing-framework/
├── tests/
│   ├── regression/
│   │   ├── test_login.py
│   │   ├── test_checkout.py
│   │   └── test_profile_update.py
│   └── __init__.py
├── pages/
│   ├── login_page.py
│   ├── checkout_page.py
│   └── profile_page.py
├── utils/
│   ├── helpers.py
│   └── data_loader.py
├── config/
│   ├── config.yaml
│   └── credentials.yaml
├── reports/
│   └── latest_report.html
├── conftest.py
└── pytest.ini
  
Test Framework Layers
  • Test Layer: Contains regression test scripts that verify existing features still work after changes.
  • Page Object Layer: Encapsulates page elements and actions for reusability and easy maintenance.
  • Utility Layer: Helper functions for data handling, common actions, and test support.
  • Configuration Layer: Stores environment settings, credentials, and test parameters.
  • Reporting Layer: Generates readable test reports showing pass/fail results.
Configuration Patterns

Use YAML files to store environment URLs, browser types, and user credentials separately.

Example config.yaml:

environment:
  base_url: "https://staging.example.com"
  browser: "chrome"

logging:
  level: "INFO"
  

Use conftest.py to load configs and provide fixtures for tests to access settings dynamically.

Test Reporting and CI/CD Integration
  • Use pytest-html plugin to generate HTML reports after test runs.
  • Reports show which regression tests passed or failed with details.
  • Integrate with CI/CD pipelines (e.g., GitHub Actions, Jenkins) to run regression tests automatically on code changes.
  • Fail builds if critical regression tests fail to prevent broken releases.
Best Practices for Regression Testing Framework
  1. Maintain Test Independence: Each regression test should run independently to avoid false failures.
  2. Use Page Object Model: Keep UI locators and actions separate from test logic for easier updates.
  3. Automate Test Data Setup: Prepare consistent test data to ensure reliable regression results.
  4. Run Tests Frequently: Schedule regression tests to run on every code commit or nightly builds.
  5. Keep Tests Focused: Regression tests should cover critical existing features without testing new functionality.
Self Check

Where in this folder structure would you add a new regression test for the "Forgot Password" feature?

Key Result
Organize regression tests with clear layers: tests, page objects, utilities, config, and reporting for maintainable and reliable automation.