Skip to main content

Testing Overview

Testing pieces ensures they work correctly before contributing them to the community. Activepieces provides multiple ways to test:

Local Testing

Test in development environment

Unit Tests

Automated test suites

Integration Tests

End-to-end testing

Local Testing with Hot Reload

The fastest way to test during development is using hot reload.
1

Start Development Server

This starts:
  • Frontend on http://localhost:4200
  • Backend on http://localhost:3000
  • Engine for flow execution
2

Open Activepieces

Navigate to http://localhost:4200 in your browser
3

Create a Test Flow

  1. Click “Create Flow”
  2. Add your piece as a trigger or action
  3. Configure the properties
  4. Click “Test” to execute
4

Make Changes

Edit your piece code - changes are reflected immediately without restart!
Save and test again - no rebuild needed.
Hot reloading is enabled by default in development mode. Changes to actions, triggers, properties, and authentication are all hot-reloaded.

Testing Actions

Manual Testing

Test actions directly in the flow builder:

Test Function

Provide a test function that uses safe test data:

Testing Triggers

Polling Triggers

Polling triggers can be tested by clicking the “Test” button:

Webhook Triggers

Test webhook triggers by:
  1. Enable the trigger in a flow
  2. Trigger the actual event in the external service
  3. Verify webhook was called and flow executed
For webhook testing, you’ll need to use a tool like ngrok or deploy to a public URL to receive webhooks during development.

Unit Tests

Write automated tests using Vitest:

Test File Structure

Example: Action Test

send-message.test.ts

Example: Trigger Test

new-message.test.ts

Running Tests

Integration Tests

End-to-end tests that run actual flows:
e2e/my-piece.spec.ts
Run integration tests:

Testing Best Practices

Don’t just test the happy path:
Never make real API calls in tests:
Provide realistic sample data for testing:
For triggers, test state storage:

Debugging

Console Logging

Use console.log during development:

VS Code Debugger

Set breakpoints and debug:
  1. Add launch configuration:
.vscode/launch.json
  1. Set breakpoints in your code
  2. Press F5 to start debugging

Network Debugging

Inspect HTTP requests:

Testing Checklist

Before contributing your piece:
  • All actions work correctly with valid inputs
  • Error messages are clear and helpful
  • Authentication works and validates properly
  • Dropdowns load options correctly
  • Dynamic properties refresh as expected
  • Triggers receive and process events
  • Webhook registration/cleanup works
  • Unit tests pass
  • No console errors or warnings
  • Sample data is realistic
  • Documentation is complete

Next Steps

Contribute Your Piece

Submit your piece to the community

Versioning

Learn about piece versioning