@bangstack/test
v1.0.0
Published
Transform manifest journeys into executable E2E tests with CDP support
Maintainers
Readme
@bangstack/test
Transform manifest journeys into executable E2E tests with CDP support.
Installation
npm install @bangstack/test @bangstack/core @bangstack/manifestQuick Start
import { createTestContext, runJourney } from '@bangstack/test/cdp';
import { manifest } from './manifest.js';
// Create test context with browser and mesh
const ctx = await createTestContext({
manifest,
baseUrl: 'http://localhost:3000'
});
// Run a journey from your manifest
const result = await runJourney(ctx, 'login');
console.log(result.success); // true if all steps passed
console.log(result.timeline); // step-by-step results
// Cleanup
await ctx.close();Features
- Journey-driven testing: Convert manifest journeys to executable tests
- CDP integration: Control Chrome via DevTools Protocol
- Event validation: Automatically validate events against manifest
- Coverage tracking: See which events are tested
Test Utilities
import {
journeyToActions,
assertEventFired,
assertJourneyComplete,
runDevJourney
} from '@bangstack/test';
// Convert journey to test actions
const actions = journeyToActions(manifest, 'checkout');
// Assert specific event was fired
assertEventFired(mesh, 'payment:charge:completed');
// Run developer (CLI) journeys
await runDevJourney(manifest, mesh, 'build-project');License
MIT
