Skip to content

Why does my dashboard query throw an error?

Tests and Runs use different TQL variables. A query written for tests won’t work on runs. Check which one your widget uses, then use that entity’s variables.

Most common mistake, status. Tests use an operator, runs use a bare keyword:

# Tests
status == 'passed'
# Runs
passed

Writing status == 'passed' in a runs query is the usual cause of the error.

Second mistake, has_ variables. In runs queries, has_ filters runs by the tests inside them. Without it, you filter the run’s own attributes:

# Runs tagged 'slow'
tag == 'slow'
# Runs CONTAINING tests tagged 'regression'
has_test_tag == 'regression'
What you want Tests query Runs query
By status status == 'failed' failed
By tag tag == 'regression' has_test_tag == 'regression'
By suite suite % 'Checkout' has_suite % 'Checkout'
By test title test % 'User login' has_test % 'User login'
By priority priority == 'critical' has_priority == 'critical'
# Tests: failed tests with the smoke tag
status == 'failed' and tag == 'smoke'
# Runs: failed runs containing tests tagged regression
failed and has_test_tag == 'regression'