A CLI testing tool that sends events to Segment and verifies events are received by a webhook connected to Segment.
The tester is used as follows:
./tester -segment-write-key='...' -webhook-auth-username='...' -webhook-bucket='...' -path='...'
The tester will invoke the library CLI with some fixtures, and verify that events appeared in a connected webhook.
For a library to be tested by this tester, the library must provide a CLI interface that conforms to the contract enforced by the tester:
analytics --type=<type> --writeKey=<writeKey> --userId=<userId> [--event=<event> --properties=<properties>] # Track [--name=<name> --properties=<properties>] # Page/Screen [--traits=<traits>] # Identify [--groupId=<groupId> --traits=<traits>] # Group
The setup must be done manually:
- Create a Segment workspace and project. Note the writeKey of the project.
- Create a Webhook bucket. Note the Webhook bucket ID and Webhook auth username.
- Add the Webhook bucket as a Segment webhook destination.
The Webhook API is documented on SwaggerHub.