Allure Query Language
In some sections of Allure TestOps like Widgets, analytics or when using Allure TestOps API calls, you can use a query to get a subset of test cases, results, or launches. This query (aka AQL – Allure Query Language) mainly consists of two things: the name of the field and the required value for that field.
For example, to find all test cases with the name "My Test", you can use the following query:
name = "My Test"
Or, to find all test cases that have the word "test" in their name, use the following query:
name ~= "test"
You can specify multiple conditions in the same query. For example, to find all test cases with the word "test" that were created by the user named John, you can type in the following:
name ~= "test" and createdBy = "John"
Alternatively, if you need to match just one of the specified conditions, you can use the or
keyword. You can combine both and
and or
in the same query, but be mindful of the order of operations.
name ~= "test" or createdBy = "John"
If the field has a numeric value, you don't need quotes, and you can use additional comparison operations (>
, <
, <=
, and >=
):
id >= 100
If the field has a Boolean value (i.e., it either is or it isn't), its value is represented by two keywords: true
and false
. For example, to find all muted test cases, you can use the following query:
muted = true
Finally, you can use the not
keyword to reverse a query condition. For example, to find all test cases that do not contain the word "test" and are not created by John:
not name ~= "test" and not createdBy = "John"
You can also use !=
as an alternate form of "not equals":
name != "My Test" and createdBy != "John"
You can find the full list of available fields in the next section.
Available fields
Test results AQL can be used in API calls only, for the time being there is no option to use Test results AQL in Allure TestOps UI/widgets.
Name | Description | Example |
---|---|---|
id |
Test case identifier. | id = 17 |
name |
Test case name. | name = "First test" name ~= "test" name != "My Test" not name = "My Test" |
tag |
Test case tags. Condition will match if at least one tag matches the value. Can be referenced by name or it's system id |
tag = "smoke" tag = "web" and tag = "smoke" tag = 12 |
issue |
Issues linked to the test case. Can be referenced by name or it's system id |
issue in ["AS-1", "AS-3"] issue = 123 |
role |
Users assigned to the test case in a specific role. If role is empty, the value is null. Can be referenced by name or it's system id |
role["Owner"] = "user1" role["Manager"] = "user2" role = 123 |
member |
All users assigned to the test case. | member in ["user1", "user2"] |
cf |
Custom fields of the test case. If field is empty, the value is null. Can be referenced by name or its system id |
cf["Epic"] = "Auth" cf["Story"] = "Story 2" cf = 123 |
cfv |
All custom field values. Can be referenced by name or it's system id |
cfv in ["Auth", "Story 2"] cfv = 123 |
layer |
Test case layer. If layer is not set, the value is null. Can be referenced by name or it's system id |
layer = "API" layer = 123 |
status |
Workflow status. Can be referenced by name or it's system id |
status = "Active" status = 123 |
workflow |
Name of the workflow. Can be referenced by name or it's system id |
workflow = "Default Manual" workflow = 123 |
testPlan |
Test plan where a test case appears. Can be referenced by name or it's system id |
testPlan = "smoke tests" testPlan = 123 |
automation |
If test case is automated. | automation = true |
muted |
If test case is muted. | muted = true |
mutedDate |
Date when the test case was muted. | mutedDate < 1569430502709 |
createdDate |
Date when the test case was created. | createdDate < 1569430502709 |
createdBy |
User who created the test case. | createdBy = "user1" |
lastModifiedDate |
Date when the test case was last modified. | lastModifiedDate < 1569430502709 |
lastModifiedBy |
User who last modified the test case. | lastModifiedBy = "user1" |
Name | Description | Example |
---|---|---|
id |
Test result identifier. | id = 17 |
name |
Test result name. | name = "First test result name" |
fullName |
Test result full name. | fullName = "First test result full_name" |
testCase |
Test case name. | testCase = "First test" |
status |
Test result's execution status. | status = "failed" |
category |
Test result category. | category = "IO Exception" |
tag |
Test case tags. Condition will match if at least one tag matches the value. | tag = "smoke" tag = "web" and tag = "smoke" tag in ["smoke", "regress"] |
issue |
Issues linked to the test case. | issue in ["AS-1", "AS-3"] |
role |
Users assigned to the test case in a specific role. If role is empty, the value is null. | role["Owner"] = "user1" role["Manager"] = "user2" |
member |
All users assigned to the test case. | member in ["user1", "user2"] |
testedBy |
User who passed the test. | testedBy = "John Vinchester" |
cf |
Custom fields of the test case. If field is empty, the value is null. | cf["Epic"] = "Auth" cf["Story"] = "Story 2" |
cfv |
Search across all custom field values. | cfv in ["Auth", "Story 2"] |
ev |
Environment variables. If variable does not exist, the value is null. | ev["OS"] = "Linux" ev["Browser"] = "Opera" |
evv |
All environment variables values. | evv in ["Linux", "Opera"] |
layer |
Test case layer. If layer is not set, the value is null. | layer = "API" |
muted |
If test case is muted. | muted = true |
hidden |
If test result is hidden*. | hidden = true |
launch |
Launch name. | launch = "release-1.0" launch ~= "release" |
createdDate |
Date when the test case was created. | createdDate < 1569430502709 |
createdBy |
User who created the test case. | createdBy = "user1" |
lastModifiedDate |
Date when the test case was last modified. | lastModifiedDate < 1569430502709 |
lastModifiedBy |
User who last modified the test case. | lastModifiedBy = "user1" |
Name | Description | Example |
---|---|---|
id |
Launch identifier. | id = 17 |
name |
Launch name. | name = "release-1.0" name ~= "release" |
tag |
Launch tags. Condition will match if at least one tag matches the value. | tag = "regular" tag = "regular" and tag = "resident" tag in ["release", "pre-release"] tag = 123 |
issue |
Issues linked to a launch. | issue in ["AS-1", "AS-3"] issue = 123 |
job |
Build job name. | job = "jenkins_master" job = 123 |
ev |
Environment variables. If variable does not exist, the value is null. | ev["OS"] = "Linux" ev["Browser"] = "Opera" |
evv |
Environment variables values. Condition will match if at least one variable matches the value. | evv = "https://demo.testops.cloud" evv = 123 |
closed |
If launch is closed. | closed = true |
createdDate |
Date when the test case was created. | createdDate < 1569430502709 |
createdBy |
User who created the test case. | createdBy = "user1" |
lastModifiedDate |
Date when the test case was last modified. | lastModifiedDate < 1569430502709 |
lastModifiedBy |
User who last modified the test case. | lastModifiedBy = "user1" |
*
- a test result can have hidden
attribute in the following cases:
- test result is retried and it is not the most recent result for a test
- test result was intentionally hidden by an end user
Filtering date fields
AQL uses a 13-digit time value (with milliseconds), for example: 'createdDate = 1569430502' would be wrong, you need to use 'createdDate < 1569430502709'
Date fields are represented as Unix time (number of seconds since 1 January 1970), therefore you need to handle them as numeric values. To convert date to Unix time or vice versa, you can use online tools such as unixtimestamp.com.
For example, to find all test cases created in 2023, you can use the following query:
createdDate > 1672531200000 and createdDate < 1704067200000
Filtering subfields
Some fields' values are objects that contain other fields. You can specify the required subfield using square brackets.
cf["Story"] = "Built-in authentication"
Empty field values
Some fields may not have a value. To check whether a field has a value, you can use the null
keyword.
For example, you can use the following query to find test cases that don't have an owner:
role["Owner"] = null
or
role["Owner"] is null
Specifying multiple values
If you need to compare a field against multiple values, you can list them in square brackets and use the in
keyword.
For example, the following query
name in ["Test 1", "Test 2", "Test 3"]
is equal to this query
name = "Test 1" or name = "Test 2" or name = "Test 3"
Using parentheses
Sometimes using the keywords and
and or
in the same query can lead to an undesired result.
For example, the following query will find all test cases created by John and only those test cases by Jane that have "test" in their name.
createdBy = "John" or createdBy = "Jane" and name ~= "test"
This is because the and
operation has a higher priority than the or
operation. Therefore, as the first step, we find all test cases created by Jane that contain the word "test". After that, we find all test cases by John and append them to the result from the first step.
If this is not what you wanted to do, you can change the order of operations by using parentheses. In this example, if we first want to find all test cases by either John or Jane and then filter them by the word "test", we can modify the query as follows:
(createdBy = "John" or createdBy = "Jane") and name ~= "test"
Negative filters
If you want to get the negative results of the applied AQL, you need to use not
in your query.
not tag in ["nighlty", "devbuild"]
the query above will result in the list of Allure TestOps entities which don't have tag
nightly or don't have tag
devbuild.