frappe-testing-unit

Guide Frappe unit and integration tests with bench run-tests for v14 to v16.

Updated May 31, 2026
One-click install
npx skills add https://github.com/anonymousminati/Res-POS --skill frappe-testing-unit-anonymousminati
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-testing-unit
Source: https://github.com/anonymousminati/Res-POS/tree/main/.claude/skills/testing/frappe-testing-unit
Command: npx skills add https://github.com/anonymousminati/Res-POS --skill frappe-testing-unit-anonymousminati

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write dependable Frappe tests without falling into common traps like flaky fixtures, incorrect base classes, broken isolation, or misleading test results.

Core Features & Use Cases

  • Test base class selection: Choose the right class for isolated logic tests, database-backed integration tests, or legacy v14 compatibility.
  • Fixture and data setup: Create safe, repeatable test records with proper naming, dependency ordering, and one-time guards.
  • Test execution guidance: Use the correct bench run-tests flags for apps, doctypes, modules, single methods, profiling, and reports.
  • Use case: A developer adding validation to a Sales Order can quickly determine whether to use UnitTestCase or IntegrationTestCase, how to seed linked records, and how to structure the test file so the runner discovers it correctly.

Quick Start

Ask for the right Frappe test class, fixture pattern, and bench run-tests command for your specific DocType or module, and include whether you need unit, integration, permission, or lifecycle coverage.

Frequently Asked Questions about frappe-testing-unit

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

FAQPage Schema
How do I write reliable Frappe unit tests without flaky fixtures?

Frappe integration tests require selecting the correct base class for database-backed scenarios and seeding linked records with proper dependency ordering. This ensures your lifecycle flows and permissions are validated accurately without breaking test isolation.

How do I run tests for a specific doctype or module using bench run-tests?

You can execute bench run-tests for specific apps, doctypes, modules, or single methods by applying the correct command-line flags. This allows targeted test execution, profiling, and report generation for your Frappe v14 to v16 projects.

What is the difference between UnitTestCase and IntegrationTestCase in Frappe?

UnitTestCase handles isolated logic tests without database dependencies, while IntegrationTestCase manages database-backed integration tests. Choosing the correct base class is critical for rollback-safe setup and accurate fixture loading in Frappe v14 to v16 projects.

Do I need specific test base classes for legacy Frappe v14 compatibility?

Yes, legacy v14 compatibility requires selecting specific test base classes designed for that version. Proper base-class selection ensures your tests run correctly without broken isolation or misleading test results across different Frappe versions.