data_driven_engine

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Data Driven Engine (pkg/core/tools/data_driven_engine)

The Data Driven Engine executes test scenarios using external data sources.

Key Tool: run_data_driven

This tool iterates over a dataset (CSV, JSON) and injects values into a test scenario template.

Features
  • Data Sources: Supports CSV and JSON files, or simulated "fake" data.
  • Variable Mapping: Maps column names to request templates (e.g., {{email}} -> user@example.com).
  • Batch Processing: Executes the scenario for every row in the dataset.

Reports

After every run, run_data_driven automatically writes a Markdown report to .falcon/reports/. Pass report_name to set the filename (e.g. data_driven_report_users). If omitted, the filename defaults to data_driven_report_<timestamp>.md. A validator confirms the file has content before the tool returns success.

Usage

Ideal for testing bulk creation endpoints or checking how an API handles a wide variety of inputs.

Example Prompts

Trigger this tool by asking:

  • "Test the registration endpoint using the user data in users.csv."
  • "Run data-driven tests on the login API using the provided JSON dataset."
  • "Verify valid and invalid email formats by iterating through emails.csv."

Documentation

Overview

Package data_driven_engine provides template-based parameterized test execution for ZAP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataDrivenEngineTool

type DataDrivenEngineTool struct {
	// contains filtered or unexported fields
}

DataDrivenEngineTool executes test scenarios using data from external sources.

func NewDataDrivenEngineTool

func NewDataDrivenEngineTool(falconDir string, httpTool *shared.HTTPTool, testExecutor *shared.TestExecutor, reportWriter *shared.ReportWriter) *DataDrivenEngineTool

NewDataDrivenEngineTool creates a new data-driven engine tool.

func (*DataDrivenEngineTool) Description

func (t *DataDrivenEngineTool) Description() string

func (*DataDrivenEngineTool) Execute

func (t *DataDrivenEngineTool) Execute(args string) (string, error)

func (*DataDrivenEngineTool) Name

func (t *DataDrivenEngineTool) Name() string

func (*DataDrivenEngineTool) Parameters

func (t *DataDrivenEngineTool) Parameters() string

type DataDrivenParams

type DataDrivenParams struct {
	Scenario   shared.TestScenario `json:"scenario"`              // Base scenario template
	DataSource string              `json:"data_source"`           // Path to CSV/JSON file or 'fake'
	Variables  []string            `json:"variables"`             // Variable names to map
	MaxRows    int                 `json:"max_rows,omitempty"`    // Limit number of rows to process
	ReportName string              `json:"report_name,omitempty"` // e.g. "data_driven_report_users"
}

DataDrivenParams defines parameters for data-driven testing.

type DataDrivenResult

type DataDrivenResult struct {
	TotalRows  int                 `json:"total_rows"`
	PassedRows int                 `json:"passed_rows"`
	FailedRows int                 `json:"failed_rows"`
	Results    []shared.TestResult `json:"results"`
	Summary    string              `json:"summary"`
}

DataDrivenResult represents the outcome of the data-driven test run.

type DataLoader

type DataLoader struct {
	Source string
}

DataLoader loads data from files or generates fake data.

func (*DataLoader) Load

func (l *DataLoader) Load(variables []string, maxRows int) ([]map[string]interface{}, error)

Load retrieves rows of data as maps.

type TemplateEngine

type TemplateEngine struct{}

TemplateEngine replaces placeholders in test scenarios with actual data.

func (*TemplateEngine) Populate

func (e *TemplateEngine) Populate(template shared.TestScenario, data map[string]interface{}) shared.TestScenario

Populate replaces {{var}} placeholders in the scenario with values from the data row.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL