create-functional-test

Generate functional tests for HTTP controllers and LiveComponents using Foundry.

Updated Dec 16, 2019
One-click install
npx skills add https://github.com/Dev-Int/tests --skill create-functional-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-functional-test
Source: https://github.com/Dev-Int/tests/tree/main/.claude/skills/create-functional-test
Command: npx skills add https://github.com/Dev-Int/tests --skill create-functional-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the manual effort of writing boilerplate test code for web applications, saving developers hours of repetitive coding.

Core Features & Use Cases

  • HTTP Endpoint Testing: Automatically generate tests for GET/POST/PUT/DELETE endpoints.
  • LiveComponent Testing: Create tests for interactive LiveComponents with automatic DOM assertions.
  • Use Case: When you add a new admin panel endpoint at /admin/articles, use this Skill to instantly create a complete functional test with request handling and response validation.

Quick Start

Create a functional test for the GetArticlesController with GET method testing the /admin/articles route.

Frequently Asked Questions about create-functional-test

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

FAQPage Schema
How do I automatically generate functional tests for HTTP controllers?

Functional test generation creates complete test code for HTTP endpoints by analyzing your controller routes and methods. The Skill generates tests for GET, POST, PUT, and DELETE requests, handling request setup, response validation, and assertions automatically so you avoid writing boilerplate code manually.

Can I generate tests for LiveComponents with DOM assertions?

Yes, the Skill generates functional tests for LiveComponents with automatic DOM assertions. It creates tests that validate component behavior, form submissions, and state changes using prescribed assertions that verify both HTTP responses and rendered output.

What testing framework and patterns does this Skill use?

The Skill generates tests that extend BaseFunctionalTestCase, incorporate the Factories trait, and use Foundry with auto-persistence for database handling. Tests execute HTTP requests through the client and avoid manual repository saves or flushes, meeting a performance target of approximately 550ms per test.

Do I need to manually set up test fixtures and database state?

No, the Skill handles database setup automatically through Foundry's auto-persistence feature. Generated tests use the Factories trait to create test data without requiring manual repository flushes or save operations, reducing setup overhead.

What HTTP methods and endpoints can this Skill test?

The Skill generates tests for HTTP endpoints supporting GET, POST, PUT, and DELETE methods, form submissions, API responses, and LiveComponent interactions. It handles any web route and validates both the HTTP status and response content through prescribed assertions.

How much time does this Skill save compared to writing tests manually?

By automating boilerplate test code generation, the Skill eliminates hours of repetitive coding for web application testing. Generated tests run at approximately 550ms per test and include complete request handling and response validation without manual coding.