testform validate
testform [global options] validate [options]The testform validate command validates the syntax and consistency of your configuration files (both .feature files and main.yml). It verifies that all steps conform to the Gherkin grammar, custom fields match declared schemas, and no policy violations exist.
Validation runs locally and does not access remote APIs or verify credentials.
Command Options
Section titled “Command Options”| Option | Default | Description |
|---|---|---|
-target=target |
None | Targets a specific .feature file or resource for validation (e.g. -target=tests/smoke.run.feature or -target="auth/login.case.feature.@tc-1"). |
-scope=scope |
all |
Restricts validation to a given scope (testcase, testrun, testplan, or all). |
-json |
false |
Emits validation diagnostics as a JSON object, ideal for CI linters and GitHub Checks. |
-no-tests |
false |
Skips running registered quality policies. |
-test-directory=dir |
tests |
Directory containing test feature files. |
-query=text |
None | Filters scenarios matching a text query. |
-no-color |
false |
Disables colored console output. |
Real Execution Examples
Section titled “Real Execution Examples”Full Workspace Validation (All Scopes)
Section titled “Full Workspace Validation (All Scopes)”$ testform validateValidating configuration...Success! The configuration is valid.
Scenarios: 8 Scope: all (testcase: 6, testrun: 1, testplan: 1)Scope-Restricted Validation
Section titled “Scope-Restricted Validation”$ testform validate -scope=testcaseValidating configuration...Success! The configuration is valid.
Scenarios: 6 Scope: testcaseTargeted File or Resource Validation (-target)
Section titled “Targeted File or Resource Validation (-target)”$ testform validate -target=tests/testrun/smoke.run.featureValidating configuration...Success! The configuration is valid.
Scenarios: 1 Scope: testrunWarning Diagnostics (Schema Warnings)
Section titled “Warning Diagnostics (Schema Warnings)”$ testform validate╷│ Warning: Undeclared field 'type_of_test'││ in tests/cart.case.feature:│ The field 'type_of_test' is used but not declared in main.yml schema.╵Success! The configuration is valid, but there were some warnings.Error Output (Syntax or Required Policy Failure)
Section titled “Error Output (Syntax or Required Policy Failure)”$ testform validate╷│ Error: Every scenario must have an identity tag matching the configured identity pattern.││ in tests/login.case.feature:14│ Add the identity tag (e.g. @tc-1) to each scenario.╵Error: The configuration contains errors.Integration in CI/CD Pre-Commit & PR Checks
Section titled “Integration in CI/CD Pre-Commit & PR Checks”Add testform validate -json to your GitHub Actions pull request checks to prevent invalid Gherkin syntax from being merged into main branches:
- name: Validate Test-as-Code Configuration run: testform validate -jsonExit Codes
Section titled “Exit Codes”0: Configuration is valid (warnings may be present).1: Configuration contains validation errors.