Skip to main content

Framework E2E para testing de APIs REST con Playwright

Project description

๐ŸŒฑ socialseed-e2e

PyPI Python Docs License Downloads

The ultimate E2E testing framework for REST APIs - Built for developers and AI agents

โšก๏ธ NEW v2.0: AI-First design with automatic error prevention, camelCase serialization support, and zero-config setup for Java backends

One-liner: Test your REST APIs with 10x less code using intelligent scaffolding, automatic test discovery, and stateful test chaining. Perfect for both manual testing and AI-generated test suites.

๐Ÿ“š Full Documentation | ๐Ÿš€ Quick Start | ๐Ÿ“– Installation


๐ŸŽฏ What is socialseed-e2e?

socialseed-e2e is a service-agnostic End-to-End (E2E) testing framework designed to make API testing effortless, scalable, and maintainable. Built with an hexagonal architecture that decouples the core engine from service logic, it enables both developers and AI agents to write reliable tests with minimal boilerplate.

Key Differentiators

  • ๐Ÿค– AI-Native Architecture: Structured protocols (IServicePage, ITestModule) designed for automated test generation
  • ๐Ÿง  .agent Awareness: Automatically generates AI documentation (.agent/) for self-guided test generation by LLMs
  • โšก 10x Less Code: Stateful test chaining and automatic discovery eliminate boilerplate
  • ๐Ÿงช Built-in Mocking: Flask-based mock API for testing without external dependencies
  • ๐Ÿ”ง Zero Configuration: Sensible defaults with YAML/JSON override support

๐Ÿš€ Quick Start

# Install
pip install socialseed-e2e
playwright install chromium

# Initialize project
e2e init my-api-tests
cd my-api-tests

# Create service and test
e2e new-service users-api
e2e new-test login --service users-api

# Run tests
e2e run

๐Ÿ“š Complete Quick Start Guide โ†’


๐Ÿค– Workflow with AI Agents

socialseed-e2e is designed to be the first AI-Native Testing Framework. When you initialize a project with e2e init, a .agent/ folder is created with specific instructions for LLMs (Claude, GPT-4, etc.).

How to use it:

  1. Initialize: Run e2e init in your project root.
  2. Prompt your Agent:

    "Read the documentation in the .agent/ folder to understand the testing framework. Then, scan my API controllers in ../src/controllers/ and generate the corresponding E2E tests following the framework patterns."

  3. Execute: Run e2e run to verify the generated tests.

The .agent folder contains:

  • AGENT_GUIDE.md: โญ START HERE - Complete guide with error prevention patterns, camelCase serialization, and common pitfalls to avoid
  • FRAMEWORK_CONTEXT.md: Architecture and core concepts.
  • WORKFLOW_GENERATION.md: Step-by-step guide for generating tests.
  • EXAMPLE_TEST.md: Gold standard code examples.

๐Ÿ›ก๏ธ AI-First Error Prevention (v2.0)

The framework now includes automatic safeguards for AI-generated code:

  • โœ… Absolute imports only - No more ImportError from relative imports
  • โœ… CamelCase serialization - Automatic Pydantic aliases for Java backends
  • โœ… Dependency management - requirements.txt includes email-validator
  • โœ… Method naming - do_* prefix prevents attribute/method conflicts
  • โœ… Header handling - Manual authentication management (no missing methods)
  • โœ… Verification script - Run python verify_installation.py to check setup

Result: AI agents can generate working E2E tests with minimal or no human intervention.


๐Ÿ—๏ธ Architecture

Hexagonal Design

socialseed-e2e/
โ”œโ”€โ”€ core/                    # Service-agnostic engine (stable, tested)
โ”‚   โ”œโ”€โ”€ base_page.py        # HTTP abstraction layer (Playwright)
โ”‚   โ”œโ”€โ”€ config_loader.py    # Configuration management
โ”‚   โ”œโ”€โ”€ test_orchestrator.py # Test discovery & execution
โ”‚   โ”œโ”€โ”€ interfaces.py       # Protocols for AI/codegen
โ”‚   โ””โ”€โ”€ loaders.py          # Dynamic module loading
โ”œโ”€โ”€ services/               # Your service implementations
โ”‚   โ””โ”€โ”€ users-api/
โ”‚       โ”œโ”€โ”€ users_api_page.py
โ”‚       โ”œโ”€โ”€ data_schema.py
โ”‚       โ””โ”€โ”€ modules/
โ”‚           โ”œโ”€โ”€ 01_login_flow.py
โ”‚           โ”œโ”€โ”€ 02_register_flow.py
โ”‚           โ””โ”€โ”€ 03_profile_flow.py
โ””โ”€โ”€ templates/              # Scaffolding templates

High-Level Flow

graph TD;
    subgraph "AI Agent Layer"
        A[AI Agent / LLM] -- "Generates/Heals" --> B[Test Modules]
    end

    subgraph "SocialSeed E2E Framework"
        B -- "Uses" --> C[Service Page Classes]
        C -- "Extends" --> D[Core BasePage]
        D -- "Orchestrates" --> E[Playwright Engine]
    end

    subgraph "Target Infrastructure"
        E -- "REST / JSON" --> F[Microservices]
    end

    G[YAML/JSON Config] -.-> D

โœจ Key Features

  • ๐Ÿ”ฅ Service-Agnostic Core: Test any REST API without framework modifications
  • ๐ŸŽฏ Playwright Integration: Rock-solid HTTP testing with browser-like reliability
  • ๐Ÿ“ Smart Scaffolding: e2e new-service and e2e new-test commands
  • ๐Ÿ” Auto-Discovery: Tests automatically found and executed
  • ๐ŸŽจ Rich CLI Output: Beautiful terminal reports with tables and progress
  • ๐Ÿ”ง Environment Support: Dev, staging, production configurations
  • ๐Ÿ“Š Test Orchestration: Run tests in logical order with state sharing
  • ๐Ÿ—๏ธ Hexagonal Architecture: Clean separation of concerns
  • ๐Ÿค– AI-Ready: Perfect for automated test generation workflows
  • ๐Ÿงช Built-in Mock API: Flask-based mock server for testing without dependencies
  • ๐Ÿ“ˆ Coverage Reports: Automatic coverage tracking with codecov.io integration
  • โšก State Chaining: Share state between tests naturally

๐Ÿ“ฆ Installation

pip install socialseed-e2e
playwright install chromium

For development:

git clone https://github.com/daironpf/socialseed-e2e.git
cd socialseed-e2e
pip install -e ".[dev]"
playwright install chromium

๐Ÿ“– Detailed Installation โ†’


๐Ÿงช Testing

The framework includes 420+ tests organized for maintainability:

# Run all tests
pytest

# Run by type
pytest -m unit                    # Unit tests
pytest -m integration             # Integration tests
pytest -m cli                     # CLI tests

# With coverage
pytest --cov=socialseed_e2e --cov-report=html

๐Ÿ“š Testing Guide โ†’


๐Ÿšฆ Project Status

Current (v0.1.0)

  • โœ… Core Framework: Complete and tested (86.39% coverage)
  • โœ… CLI Commands: init, new-service, new-test, run, doctor, config
  • โœ… Configuration: YAML/JSON with environment variables
  • โœ… Mock API: Flask-based server for integration testing
  • โœ… CI/CD: GitHub Actions configured (CI, Release, Docs)
  • โœ… Documentation: Complete guides hosted on GitHub Pages
  • โœ… AI-Ready: Perfect for automated test generation workflows

In Progress

  • ๐Ÿšง HTML reports with detailed metrics
  • ๐Ÿšง Parallel test execution
  • ๐Ÿšง Better authentication handling
  • ๐Ÿšง WebSocket support

Planned

  • ๐Ÿ“‹ Plugin system for custom extensions
  • ๐Ÿ“‹ Docker integration
  • ๐Ÿ“‹ Visual regression testing
  • ๐Ÿ“‹ Performance testing metrics
  • ๐Ÿ“‹ GraphQL and gRPC support

๐Ÿค Contributing

We welcome contributions from developers and AI agents!

Quick Start for Contributors

git clone https://github.com/daironpf/socialseed-e2e.git
cd socialseed-e2e
pip install -e ".[dev]"
pytest  # Run tests
# Make changes
pytest  # Verify
# Submit PR

๐Ÿค– AI Contributors

This project recognizes AI agents as legitimate co-authors:

  • OpenCode AI Agent - Framework architecture, core implementation, CLI, templates, documentation
  • Claude (Anthropic) - Documentation, feature suggestions, bug fixes

See AI_CONTRIBUTORS.md for full details and contribution philosophy. this list need updates

๐Ÿ“š Documentation

All documentation is hosted on GitHub Pages and automatically deployed on every push to main:

๐Ÿ”— https://daironpf.github.io/socialseed-e2e/

Documentation Sections

Local Documentation

pip install ".[docs]"
cd docs && make html
open _build/html/index.html

๐Ÿ—บ๏ธ Roadmap

v0.2.0 (Next)

  • HTML reports with detailed metrics
  • Parallel test execution
  • Better authentication handling
  • WebSocket support

v0.3.0 (Planned)

  • Plugin system for custom extensions
  • Docker integration
  • Visual regression testing
  • Performance testing metrics

v0.4.0 (Future)

  • GraphQL support
  • gRPC testing support
  • AI-powered test healing
  • Advanced visual testing

๐Ÿ’ฌ Community


๐Ÿ“œ License

MIT License - see LICENSE file for details.


Built with โค๏ธ by Dairon Pรฉrez Frรญas (@daironpf) and AI co-authors
For developers and AI agents who believe in better testing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

socialseed_e2e-0.1.2.tar.gz (188.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

socialseed_e2e-0.1.2-py3-none-any.whl (78.4 kB view details)

Uploaded Python 3

File details

Details for the file socialseed_e2e-0.1.2.tar.gz.

File metadata

  • Download URL: socialseed_e2e-0.1.2.tar.gz
  • Upload date:
  • Size: 188.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for socialseed_e2e-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c21494250985438e416f8457c2cb4a64b3ff71a0ea56904f2765d6c9cc2a5810
MD5 f147f17ce9c50115ac7648b03cd92221
BLAKE2b-256 414c2bf4b41044e67ea756331aeb5fc925e8c6184459853ac44b18622ae55963

See more details on using hashes here.

Provenance

The following attestation bundles were made for socialseed_e2e-0.1.2.tar.gz:

Publisher: release.yml on daironpf/socialseed-e2e

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file socialseed_e2e-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: socialseed_e2e-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 78.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for socialseed_e2e-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c2aa3891ba93ce2e412e899b8f5f646f544e1372b670e119f08e781a20409b3d
MD5 b69c5d40ed6b9a86f6a6a49c1abb01c6
BLAKE2b-256 708af44a168afad5b0dd454f60be6d111204816c51ad2a78c24c75e6e348f50b

See more details on using hashes here.

Provenance

The following attestation bundles were made for socialseed_e2e-0.1.2-py3-none-any.whl:

Publisher: release.yml on daironpf/socialseed-e2e

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page