integration-testing

Write E2E, API, and database integration tests with pytest, Playwright, and Docker.

Updated Sep 2, 2026
Ready to run
npx skills add https://github.com/Dazlarus/karl-code --skill integration-testing-dazlarus
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: integration-testing
Source: https://github.com/Dazlarus/karl-code/tree/main/.agents/skills/integration-testing
Command: npx skills add https://github.com/Dazlarus/karl-code --skill integration-testing-dazlarus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Verifying that components work together correctly is harder than unit testing: you need test databases, mocked external services, isolated transactions, and realistic multi-step workflows. This Skill provides proven patterns for building reliable integration and end-to-end test suites. ## Core Features & Use Cases - API Integration Testing: Test HTTP endpoints with FastAPI TestClient and mock external API dependencies with unittest.mock. - Database Integration: Set up in-memory test databases with SQLAlchemy fixtures and use transaction rollback for test isolation. - End-to-End Workflows: Automate browser flows with Playwright and test multi-step API workflows like order creation. - Test Environments: Spin up full environments with Docker Compose including PostgreSQL and Redis services. - Use Case: You are building a REST API and need to verify the complete order workflow — creating a user, adding a product, and placing an order — against a real test database with external payment APIs mocked. ## Quick Start Write an integration test for my FastAPI user registration endpoint using a test database with transaction rollback.

Frequently Asked Questions about integration-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write integration tests for a FastAPI application?▼

Use FastAPI's TestClient to send HTTP requests against your app in tests. Override dependencies like database sessions with test fixtures, then assert on response status codes and JSON payloads for each endpoint.

How to mock external API calls in Python integration tests?▼

Use unittest.mock.patch to replace the external API client with a Mock object inside a pytest fixture. Configure return values for the mocked methods and assert they were called with the expected arguments.

How do I isolate database integration tests with pytest?▼

Create an in-memory SQLite database via SQLAlchemy fixtures, then wrap each test in a transaction that rolls back after completion. This keeps tests independent without manual cleanup between runs.

Can I use Playwright for end-to-end testing of web apps?▼

Yes, Playwright automates real browser interactions like navigation, form filling, and clicks. Use expect assertions to verify URLs and page content after each step of a complete user workflow.

When should I not use integration testing?▼

Avoid integration tests for single-function logic, which belongs in unit tests, and for property-based scenarios. Integration tests are also unsuitable against production data or when tests depend on execution order.