Automation-Winx is a comprehensive terminal-based testing and validation framework for ONDC (Open Network for Digital Commerce) protocol implementations. It simulates the complete ONDC workbench experience directly in your terminal, enabling automated end-to-end flow testing with multi-layered validation.
This tool provides a "workbench in a box" solution that:
- Validates config: Validates the schema of configuration files
- Api Service Simulation: Performs L0 (Schema), L1 (Business Logic), and l1- Custom validations
- Mock Service Simulation: Generates realistic API responses for comprehensive flow testing
- Reporting: Generates detailed CLI and file-based reports with validation results
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Automation-Winx β
βββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββββββ€
β Config Validation β Flow Execution β API Validation β
β ββ YAML Schemas β ββ Mock Service β ββ L0 (Schema) β
β ββ Flow Config β ββ API Service β ββ L1 (Business) β
β ββ Factory Config β ββ Session Mgmt β ββ Custom Rules β
βββββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β β
β Reporting System β
β ββ CLI Report β
β ββ JSON Artifacts β
β ββ Flow Traces β
β ββ Error Analysis β
βββββββββββββββββββββββββββ
- L0 Validations: JSON Schema compliance checks
- L1 Validations: Business logic rule validation
- L1 Custom Validations: Domain-specific validation rules
- Context Validations: Protocol context and timing validations
- Complete Journey Simulation: End-to-end transaction flow execution
- Mock Response Generation: Intelligent API response simulation
- Session Management: Redis-based session state management
- Error Handling: Comprehensive error capture and reporting
- CLI Reports: Color-coded terminal output with status indicators
- Detailed File Reports: JSON artifacts with complete execution traces
- Flow Visualization: Step-by-step flow execution breakdown
- Error Analytics: Comprehensive error categorization and analysis
- Node.js 18+
- TypeScript
-
Clone the repository
git clone https://github.com/ONDC-Official/automation-winx.git cd automation-winx -
Install dependencies
npm install
-
Set environment variables
export DOMAIN=ONDC:TRV14 export VERSION=2.0.0 export NODE_ENV=development
-
Replace config files with your own in
src/config/ -
Run the workbench
npm run workbench
# Run complete workbench with all validations
npm run workbench
# Run with specific configuration
DOMAIN=ONDC:TRV14 VERSION=2.0.0 npm run workbenchThe runner supports various configuration options via the runner-config-manager:
// Customize validation behavior
setRunnerConfig({
runFlows: true,
runConfigValidations: true,
runApiService: {
L0Validations: true,
L1Validations: true,
L1CustomValidations: true,
ContextValidations: true,
},
});π ONDC VALIDATION REPORT
ββββββββββββββββββββββββββββββββββββββββββββββββββ
Status: PASSED | Errors: 0 | Warnings: 2
Report ID: 1726325400000
β οΈ Context validations skipped as per configuration
β
All protocol flows executed successfully
Full report: ./winx-report/
ββββββββββββββββββββββββββββββββββββββββββββββββββ
VALIDATION PASSED
winx-report/
βββ flows/ # Flow execution details
β βββ incremental-pull-journey/
β βββ purchase-journey-without-form/
β βββ user-cancellation-full/
βββ redis/ # Session cache data
βββ errors.json # Detailed error logs
βββ warnings.json # Warning details
βββ meta.json # Report metadata
-
Environment Variables Missing check .env file or set manually:
DOMAIN=ONDC:TRV14 VERSION=2.0.0 NODE_ENV=development
-
Validation Module Not Found
- Run code generation if validation modules are missing
- Check
generated/directories for required files
-
Configuration Validation Failures
- Validate YAML syntax in configuration files
- Check schema compliance using provided validators
type MainRunnerConfigType = {
createApiService: boolean;
runFlows: boolean;
runConfigValidations: boolean;
runApiService: {
skipAll: boolean;
L0Validations: boolean;
L1Validations: boolean;
L1CustomValidations: boolean;
ContextValidations: boolean;
};
runMockService: {
skipAll: boolean;
};
};- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
-
Issues: GitHub Issues
-
ONDC Community: Official ONDC Portal
Automation-Winx - Bringing the power of ONDC workbench testing to your terminal! π