Token导航 LogoToken导航

Agent Skill · 开发

pest-testing(害虫检测)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

pest-testing 是开发类 Agent Skill,可用宿主为 Local Agent,通过unknown获取,权限为操作浏览器;许可证信息还不明确,暂无第三方扫描结果,按安装量在开发类的 21,746 个 Skill 里排第 17,869。

总安装 374周安装 15下载 121核验 2026-05-01
开发操作浏览器unknown未标认证来源可访问许可证需确认审计未展示Local Agent

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pest-testing(害虫检测)
来源仓库:https://smithery.ai
仓库路径:pest-testing
安装命令:
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。当前暂无明确安装命令,请以来源页面说明为准。

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于辅助测试设计、自动化测试、用例整理和回归验证。适合编写单元测试、端到端测试或根据日志定位问题。需确认项目测试框架、运行命令和夹具数据后使用。pest-testing 属于开发类 Skill,可作为该场景下的辅助能力补充。避免为通过测试而修改真实逻辑,区分模拟与生产环境。

涉及浏览器或服务时,应明确本地、测试和生产环境边界。

来源仓库内路径:pest-testing

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Local Agent;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    没有现成安装命令,按unknown的说明从来源页面获取,仓库路径是 pest-testing。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

pest-testing 怎么安装?

公开资料没有给出可以直接复制的命令,需要按来源页面说明手动安装,仓库内路径为 pest-testing。

pest-testing 支持哪些 AI 工具?

公开资料标注支持 Local Agent。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

pest-testing 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

pest-testing 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

pest-testing 用的人多吗?

公开数据是累计安装 374 次,近一周安装 15 次,下载 121 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

pest-testing 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 Local Agent 一种宿主,触发方式和使用习惯不用来回切换。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Local Agent,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
pest-testing

害虫检测 · 本页

374—操作浏览器未明确未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Pest Testing Skill

This skill provides expert guidance for writing high-quality tests with Pest v4 in Laravel applications, covering feature tests, unit tests, browser tests, and testing best practices.

Purpose

Provide comprehensive Pest v4 testing guidance covering:

  • Core Pest syntax and expectations API
  • Feature and unit testing in Laravel
  • Browser testing with Pest v4 (new feature)
  • HTTP testing, authentication, and authorization
  • Database testing and factories
  • Mocking and faking Laravel services
  • Testing best practices and patterns
  • Datasets for efficient test organization

When to Use

Use this skill when:

  • Writing or updating tests
  • Implementing test-driven development (TDD)
  • Testing APIs and HTTP endpoints
  • Testing authentication and authorization
  • Creating browser automation tests
  • Testing with model factories
  • Using datasets to avoid duplicate tests
  • Mocking services or external dependencies
  • Verifying features work correctly
  • Ensuring code quality and preventing regressions

Core Principles

1. Most Tests Should Be Feature Tests

Focus on feature tests that verify complete workflows:

// ✅ GOOD - Feature test testing full workflow
it('creates a post', function () {
    $user = User::factory()->create();

    $response = $this->actingAs($user)->post('/posts', [
        'title' => 'My Post',
        'body' => 'Content',
    ]);

    $response->assertCreated();

    $this->assertDatabaseHas('posts', [
        'title' => 'My Post',
        'user_id' => $user->id,
    ]);
});

// Unit tests are for isolated logic
it('calculates total correctly', function () {
    $calculator = new Calculator();

    expect($calculator->add(2, 2))->toBe(4);
});

2. Always Use Model Factories

Never manually create models - use factories:

// ✅ CORRECT - Use factories
$user = User::factory()->create();
$posts = Post::factory()->count(3)->create();

// Check for factory states
$admin = User::factory()->admin()->create();
$publishedPost = Post::factory()->published()->create();

// ❌ WRONG - Manual creation
$user = User::create([
    'name' => 'Test',
    'email' => 'test@example.com',
    // ... many fields
]);

3. Use Datasets to Avoid Duplication

When testing similar scenarios with different data, use datasets:

// ✅ GOOD - Using dataset
it('validates email format', function (string $email, bool $valid) {
    $validator = validator(['email' => $email], ['email' => 'email']);

    expect($validator->passes())->toBe($valid);
})->with([
    ['valid@example.com', true],
    ['invalid', false],
    ['test@test.co', true],
    ['@example.com', false],
]);

// ❌ WRONG - Duplicate tests
it('accepts valid email', function () {
    $validator = validator(['email' => 'valid@example.com'], ['email' => 'email']);
    expect($validator->passes())->toBeTrue();
});

it('rejects invalid email', function () {
    $validator = validator(['email' => 'invalid'], ['email' => 'email']);
    expect($validator->passes())->toBeFalse();
});

4. Use Specific Assertions

Prefer specific assertions over generic ones:

// ✅ GOOD - Specific assertions
$response->assertOk();           // 200
$response->assertCreated();      // 201
$response->assertNoContent();    // 204
$response->assertNotFound();     // 404
$response->assertForbidden();    // 403
$response->assertUnprocessable();// 422

// ❌ AVOID - Generic assertions
$response->assertStatus(200);
$response->assertStatus(404);

5. Import Mock Function When Needed

Always import the mock function before using it:

use function Pest\Laravel\mock;

it('mocks a service', function () {
    $mock = mock(PaymentService::class);

    $mock->shouldReceive('charge')
        ->once()
        ->andReturn(true);

    // Test code
});

Read references/core.md for complete Pest syntax and expectations API.

Running Tests

Run All Tests

php artisan test

Run Specific File

php artisan test tests/Feature/PostTest.php

Run with Filter

php artisan test --filter=login
php artisan test --filter="can create posts"

Run Specific Group

php artisan test --group=integration

Best Practice: Run the minimal number of tests using an appropriate filter when developing, then run the full suite before committing.

Feature Testing Patterns

Basic HTTP Testing

it('displays homepage', function () {
    $response = $this->get('/');

    $response->assertOk()
        ->assertSee('Welcome');
});

it('creates resource', function () {
    $user = User::factory()->create();

    $response = $this->actingAs($user)->post('/posts', [
        'title' => 'My Post',
        'body' => 'Content',
    ]);

    $response->assertCreated()
        ->assertJson(['title' => 'My Post']);
});

Authentication Testing

it('requires authentication', function () {
    $response = $this->get('/dashboard');

    $response->assertRedirect('/login');
});

it('allows authenticated users', function () {
    $user = User::factory()->create();

    $response = $this->actingAs($user)->get('/dashboard');

    $response->assertOk();
});

Validation Testing

it('validates required fields', function () {
    $user = User::factory()->create();

    $response = $this->actingAs($user)->post('/posts', []);

    $response->assertUnprocessable()
        ->assertJsonValidationErrors(['title', 'body']);
});

Read references/laravel.md for comprehensive Laravel testing patterns.

Pest v4 Browser Testing

Pest v4 introduces powerful browser testing capabilities:

use function Pest\Laravel\visit;

it('can login', function () {
    $user = User::factory()->create([
        'password' => bcrypt('password'),
    ]);

    $page = visit('/login');

    $page->fill('email', $user->email)
        ->fill('password', 'password')
        ->click('Login')
        ->assertPath('/dashboard')
        ->assertSee("Welcome, {$user->name}");
});

Browser Testing Features

  • Real browser testing - Chrome, Firefox, Safari
  • JavaScript support - Full JS execution
  • Multiple devices - Test on different viewports/devices
  • Dark mode testing - Test light and dark color schemes
  • Screenshots - Capture on failure or manually
  • Touch gestures - Test mobile interactions
  • Wait utilities - Wait for dynamic content

Browser Test Best Practices

it('has no JavaScript errors', function () {
    $pages = visit(['/', '/about', '/contact']);

    $pages->assertNoJavascriptErrors()
        ->assertNoConsoleLogs();
});

it('works in dark mode', function () {
    $page = visit('/', colorScheme: 'dark');

    $page->assertSee('Welcome')
        ->assertNoJavascriptErrors();
});

it('works on mobile', function () {
    $page = visit('/', device: 'iPhone 14 Pro');

    $page->assertSee('Welcome')
        ->assertVisible('.mobile-menu');
});

Read references/browser.md for comprehensive browser testing guide.

Using Model Factories

Basic Factory Usage

// Single model
$user = User::factory()->create();

// Multiple models
$users = User::factory()->count(5)->create();

// With specific attributes
$user = User::factory()->create([
    'name' => 'John Doe',
    'email' => 'john@example.com',
]);

// With relationships
$user = User::factory()
    ->has(Post::factory()->count(3))
    ->create();

Using Factory States

Check if factories have custom states before manually setting attributes:

// Check factory for states like:
$admin = User::factory()->admin()->create();
$publishedPost = Post::factory()->published()->create();
$verifiedUser = User::factory()->verified()->create();

Testing with RefreshDatabase

Clean database state between tests:

use Illuminate\Foundation\Testing\RefreshDatabase;

uses(RefreshDatabase::class);

it('creates user', function () {
    $user = User::factory()->create();

    expect(User::count())->toBe(1);
});

Mocking and Faking

Faking Laravel Services

use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Storage;

it('sends email', function () {
    Mail::fake();

    // Trigger email

    Mail::assertSent(WelcomeEmail::class);
});

it('dispatches job', function () {
    Queue::fake();

    // Trigger job

    Queue::assertPushed(ProcessPodcast::class);
});

it('dispatches event', function () {
    Event::fake();

    // Trigger event

    Event::assertDispatched(UserCreated::class);
});

Mocking Classes

use function Pest\Laravel\mock;

it('mocks external service', function () {
    $mock = mock(PaymentGateway::class);

    $mock->shouldReceive('charge')
        ->once()
        ->with(100)
        ->andReturn(['status' => 'success']);

    // Test code that uses PaymentGateway
});

Test Organization

Grouping Related Tests

describe('User Management', function () {
    it('creates users', function () {
        //
    });

    it('updates users', function () {
        //
    });

    it('deletes users', function () {
        //
    });
});

Using Tags/Groups

it('is an integration test', function () {
    //
})->group('integration');

it('is slow', function () {
    //
})->group('slow', 'integration');

// Run: php artisan test --group=integration

Reference Files

This skill includes detailed reference files:

  • references/core.md - Pest syntax, expectations API, assertions, datasets, mocking, lifecycle hooks
  • references/browser.md - Browser testing, interactions, waiting, device testing, screenshots, smoke testing
  • references/laravel.md - HTTP testing, authentication, validation, database testing, faking services

Read the appropriate reference file(s) when working on specific testing tasks.

Testing Workflow

Test-Driven Development (TDD)

  1. Write failing test - Define expected behavior
  2. Write minimal code - Make test pass
  3. Refactor - Improve code while keeping tests green
  4. Repeat - For next feature or behavior

Testing Existing Features

  1. Write test for happy path - Normal, successful flow
  2. Write test for failure paths - Error cases, validation failures
  3. Write test for edge cases - Empty data, null values, boundaries
  4. Run tests - Verify all pass
  5. Refactor if needed - Improve while keeping tests green

Best Practices Summary

  1. ✅ Write feature tests - Most tests should test complete workflows
  2. ✅ Use factories - Always use model factories for test data
  3. ✅ Use datasets - Avoid duplicate tests with different data
  4. ✅ Use specific assertions - assertOk() not assertStatus(200)
  5. ✅ Import mock function - use function Pest\Laravel\mock;
  6. ✅ Use RefreshDatabase - Clean database between tests
  7. ✅ Check factory states - Use existing states before manual setup
  8. ✅ Test all paths - Happy, failure, and edge cases
  9. ✅ Run minimal tests - Use filters when developing
  10. ✅ Run full suite - Before committing changes
  11. ✅ Use browser tests - For JavaScript-heavy features
  12. ✅ Check for JS errors - Use assertNoJavascriptErrors()
  13. ✅ Test both themes - Verify light and dark modes
  14. ✅ Keep tests isolated - Each test should be independent
  15. ✅ Use descriptive names - Tests should read like specifications

Common Testing Tasks

Testing a New Feature

  1. Create test file: php artisan make:test FeatureTest --pest
  2. Write test for expected behavior
  3. Run test: php artisan test --filter=FeatureName
  4. Implement feature
  5. Verify test passes
  6. Add tests for edge cases
  7. Run full suite: php artisan test

Testing API Endpoints

  1. Test successful requests (2xx status)
  2. Test validation errors (422 status)
  3. Test authentication (401/403 status)
  4. Test not found (404 status)
  5. Verify JSON structure and data
  6. Test with different user permissions

Testing Browser Interactions

  1. Create browser test in tests/Browser/
  2. Visit the page
  3. Interact with elements (click, type, select)
  4. Assert expected results
  5. Check for JavaScript errors
  6. Test on different devices/viewports
  7. Test both color schemes

This skill ensures tests are comprehensive, maintainable, and follow Pest v4 best practices for Laravel applications.

平台分布

Local Agent

73.81%
按下载量换算89

安全审计

暂无安全审计结果可展示。

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills