activitypub-testing
Testing patterns for PHPUnit and Playwright E2E tests. Use when writing tests, debugging test failures, setting up test coverage, or implementing test patterns for ActivityPub features.
Best use case
activitypub-testing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Testing patterns for PHPUnit and Playwright E2E tests. Use when writing tests, debugging test failures, setting up test coverage, or implementing test patterns for ActivityPub features.
Teams using activitypub-testing should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/activitypub-testing/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How activitypub-testing Compares
| Feature / Agent | activitypub-testing | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Testing patterns for PHPUnit and Playwright E2E tests. Use when writing tests, debugging test failures, setting up test coverage, or implementing test patterns for ActivityPub features.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# ActivityPub Testing
This skill provides guidance on writing and running tests for the WordPress ActivityPub plugin.
## Quick Reference
For complete testing commands and environment setup, see [Testing Reference](../../../tests/README.md).
### Key Commands
- **PHP:** `npm run env-test`
- **E2E:** `npm run test:e2e`
- **JavaScript:** `npm run test:unit`
## PHPUnit Testing
### Test Structure
```php
<?php
namespace Activitypub\Tests;
use WP_UnitTestCase;
class Test_Feature extends WP_UnitTestCase {
public function set_up(): void {
parent::set_up();
// Setup
}
public function tear_down(): void {
// Cleanup
parent::tear_down();
}
public function test_functionality() {
// Test implementation
}
}
```
### Common Test Patterns
For transformer and handler testing patterns, see [Testing Reference - Writing Effective Tests](../../../tests/README.md#writing-effective-tests).
For mocking HTTP requests and other utilities, see [Testing Reference - Test Utilities](../../../tests/README.md#test-utilities).
### Test Groups
Use `@group` annotations:
```php
/**
* @group activitypub
* @group federation
*/
public function test_federation_feature() {
// Test code
}
```
## E2E Testing with Playwright
### Basic E2E Test
```javascript
const { test, expect } = require('@playwright/test');
test('ActivityPub settings page loads', async ({ page }) => {
await page.goto('/wp-admin/options-general.php?page=activitypub');
await expect(page.locator('h1')).toContainText('ActivityPub');
});
```
### Testing Federation
```javascript
test('WebFinger discovery works', async ({ page }) => {
const response = await page.request.get('/.well-known/webfinger', {
params: {
resource: 'acct:admin@localhost:8888'
}
});
expect(response.ok()).toBeTruthy();
const json = await response.json();
expect(json.subject).toBe('acct:admin@localhost:8888');
});
```
## Test Data Factories
For creating test data (users, posts, comments), see [Testing Reference - Test Utilities](../../../tests/README.md#test-utilities).
## Coverage Reports
See [Testing Reference](../../../tests/README.md) for detailed coverage generation instructions.
## Debugging Tests
### Debug Output
```php
// In tests
var_dump( $data );
error_log( print_r( $result, true ) );
// Run with verbose
npm run env-test -- --verbose --debug
```
### Isolating Tests
```bash
# Run single test method
npm run env-test -- --filter=test_specific_method
# Stop on first failure
npm run env-test -- --stop-on-failure
```Related Skills
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
web3-testing
Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or validating DeFi protocols.
testing
Run and troubleshoot tests for DBHub, including unit tests, integration tests with Testcontainers, and database-specific tests. Use when asked to run tests, fix test failures, debug integration tests, or troubleshoot Docker/database container issues.
Testing Code
Write automated tests for features, validate functionality against acceptance criteria, and ensure code coverage. Use when writing test code, verifying functionality, or adding test coverage to existing code.
testing-anti-patterns
Use when writing or changing tests, adding mocks, or tempted to add test-only methods to production code - prevents testing mock behavior, production pollution with test-only methods, and mocking without understanding dependencies
temporal-python-testing
Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.
python-testing-patterns
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
javascript-testing-patterns
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.
e2e-testing-patterns
Master end-to-end testing with Playwright and Cypress to build reliable test suites that catch bugs, improve confidence, and enable fast deployment. Use when implementing E2E tests, debugging flaky tests, or establishing testing standards.
database-testing
Database schema validation, data integrity testing, migration testing, transaction isolation, and query performance. Use when testing data persistence, ensuring referential integrity, or validating database migrations.
bats-testing-patterns
Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.
zapier-workflows
Manage and trigger pre-built Zapier workflows and MCP tool orchestration. Use when user mentions workflows, Zaps, automations, daily digest, research, search, lead tracking, expenses, or asks to "run" any process. Also handles Perplexity-based research and Google Sheets data tracking.