Skip to main content

๐Ÿ“ Templated Test Cases (Rules)

Rules allow you to create multiple test cases at once using parameterized SQL templates. When you need to apply the same validation pattern across many tables, columns, or schemas, rules eliminate repetitive manual work and ensure consistency.


๐Ÿง  Why Use Rules?โ€‹

Many test cases follow the same pattern โ€” only the target table, column, or schema changes. Instead of creating each test case individually, rules let you:

  • โœ… Define a template once with placeholders
  • ๐Ÿ” Generate multiple test cases by providing different parameter sets
  • โšก Speed up test creation significantly for large-scale projects
๐Ÿ’ก Analogy

A Rule is like a cookie cutter โ€” you define the shape once, and stamp out as many cookies (test cases) as you need with different flavors (parameters).


๐Ÿ”— Rules and Test Approachesโ€‹

Rules are connected to Test Approaches. When you select a test approach during test creation, the rules associated with that approach are automatically available.

Rule Selected Approach


๐Ÿ›  Parameterized Syntaxโ€‹

Rules use a clear parameterized syntax with double curly braces {{ }} as placeholders:

SELECT * FROM {{schema}}.{{table}} WHERE {{column_under_test}} IS NULL

In this example:

  • {{schema}} โ€” the database schema
  • {{table}} โ€” the target table
  • {{column_under_test}} โ€” the column to validate

You can modify rules freely โ€” add or remove parameters, adjust the SQL logic, or save your changes as a new rule for future use.

Rule Edited


๐Ÿ“‹ Parameter Setsโ€‹

You can specify as many parameter groups as you need โ€” each group generates a separate test case from the same rule template.

Rule Parameter Sets


โœ… Creating Tests from Rulesโ€‹

Once your rule and parameter sets are configured, press the Submit button. X-AutoMate generates all the corresponding test cases automatically.

Rule Tests Created


๐Ÿ“Œ Summaryโ€‹

FeatureDescription
Template syntax{{parameter}} placeholders in SQL
Linked toTest Approaches
Parameter setsMultiple groups per rule โ€” each produces a test case
EditableModify rules or save as new
OutputBatch-created test cases on submit