Skip to content

Data Sources

Data sources allow Testform to query read-only information from external fixtures (JSON/YAML) or inspect existing managed resources without creating new entities.


data:
# 1. Compact inline syntax with auto-detection (no wasted lines)
qa_users: "fixtures/users.json"
existing_login: "auth/login.case.feature.@tc-1"
# 2. Or explicit typed blocks matching Terraform style
local_file:
qa_catalog: "fixtures/catalog.yml"
testcase:
existing_checkout: "checkout/pay.case.feature.@tc-pay"

Use the ${data.<name>.<path>} syntax in variables, outputs, and Gherkin steps:

Scenario: Login using data source
Given user "${data.qa_users.standard_user.username}" navigates to login
When entering password "${data.qa_users.standard_user.password}"
Then user identity matches "${data.existing_login.identity}"

And in main.yml:

output:
login_remote_id:
value: "${data.existing_login.remoteId}"
default_user:
value: "${data.qa_users.standard_user.username}"