Allure TestOps Query Language
Allure TestOps has its own query language (AQL) allowing you to create flexible searches through the test cases, test results, and launches.
Use cases
Here is how you can use the AQL:
- In a project's analytics.
- In widgets to narrow down the results to needed details.
- When performing API requests to filter out the results returned from Allure TestOps back-end.
Supported expressions
Currently, AQL supports six expression types. They are listed here in the decreasing priority order:
Expression type | example |
---|---|
Parenthesis | ( expression ) |
Negation | not expression |
Logical expression | true or false |
Logical AND | expression and expression |
Logical OR | expression or expression |
Checking the attribute's value | attribute operand value |
Checking the attribute's value is the main query unit.
Queries' attributes
The list of available attributes available for a query depends on the query target.
Queries are supported for searching in following targets:
Target | Link |
---|---|
Test case | Description and examples |
Test result | Description and examples |
Launch | Description and examples |
Attribute types
Attributes can be simple like value id
or name
and composite - related to other objects like status
or cf
(custom filed).
Composite attributes could use either the names or the IDs of a related object.
Every approach has its own pros and cons. Using the object name makes the query easier to read, but if the name changes, the query becomes invalid and you will need to rewrite it.
Example
Using the ID makes the writing and reading more complicated but guarantees that renaming an object won’t invalidate the query.
A query example
Query example for a TestCase search:
(name ~= "first" or name ~= "second") and createdBy = "user1"
This query returns all test cases that include first
or second
substring in their name, and created by the user with the user1
username.
Supported operands
Currently, the following operands are supported in AQL:
Operand | meaning | applicable to |
---|---|---|
< |
less than | numbers |
<= |
less than or equal to | numbers |
> |
greater than | numbers |
>= |
greater than or equal to | numbers |
= , is |
equal to | numbers, strings, boolean |
!= |
not equal to | numbers, strings, boolean |
~= |
contains (string) | strings |
in |
is present in (array) | numbers, strings |
Wildcards aren't supported.
Supported value types
AQL supports following value types:
- number - a number, e.g.,
id = 123
- boolean - values
true
orfalse
, e.g.deleted is false
ormuted is true
- string - a set of characters, should be enclosed within double quotation marks:
name = "some test case name"
- array - an array (a list), should be enclosed within square brackets
[ ]
.- Values in arrays to be separated by commas:
name in ["first", "second"]
orid in [123, 124]
- Values in arrays to be separated by commas: