Skip to content

Data-Driven Testing

Data-driven testing in xyva separates test logic from test data. Instead of hardcoding values in your specs, you define Variables and Datasets in the Test Hub and bind them to test runs.

Core Concepts

ConceptPurposeExample
VariableSingle key-value pair injected at runtimeBASE_URL = https://staging.example.com
DatasetTabular collection of rows, each row is a test iterationUser table with name, email, role columns
Run MatrixCartesian product of selected tests and dataset rows5 tests x 10 user rows = 50 executions

How It Works

text
1. Define Variables (env URLs, credentials, flags)
2. Create or import a Dataset (CSV, JSON, or manual entry)
3. Select tests in the Catalog
4. Bind Variables + Dataset to generate a Run Matrix
5. Launch — the Runner iterates through every combination

No Code Changes Needed

Variables are exposed as process.env entries. Your existing process.env.BASE_URL references work without modification.

Variables vs. Datasets

Variables are scalar — one key, one value per run. Use them for environment configuration:

  • BASE_URL — target environment
  • TEST_USER_EMAIL — login credentials
  • FEATURE_FLAG_DARK_MODE — toggle a feature on/off

Datasets are tabular — multiple rows, each creating a separate test iteration. Use them for input variation:

  • Login with 20 different user roles
  • Form submission with valid and invalid field combinations
  • Search queries across multiple languages

Parameterized Execution

When you bind a Dataset to a test selection, xyva generates a Run Matrix:

text
Dataset "checkout-users" (3 rows) x 2 selected specs
= 6 total test executions

  checkout.spec.ts — row 1 (admin)
  checkout.spec.ts — row 2 (guest)
  checkout.spec.ts — row 3 (blocked-user)
  payment.spec.ts  — row 1 (admin)
  payment.spec.ts  — row 2 (guest)
  payment.spec.ts  — row 3 (blocked-user)

Execution Time

Large matrices multiply execution time. A 50-row dataset bound to 20 specs produces 1,000 runs. Use the Preview Matrix button to review before launching.

Storage

All Variables and Datasets live in .xyva/test-data/ inside your project directory. They are excluded from version control by the default .gitignore entry that xyva creates.

For team sharing, export as JSON and distribute through your preferred channel, or commit the .xyva/test-data/ folder explicitly.

Local-first QA orchestration.