Allure TestOps - Query language

Query language

Query language format

Allure TestOps has custom query language (AQL) which allows users to create flexible searches through their test cases, test results, and test launches.

AQL allows writing logical expressions to filter only the required results.

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 value attribute operand value

Checking the attribute value is the main query unit.

The list of available attributes depends on the user query type.

Queries are supported for searching TestCase , TestResult and Launch.

Query example for 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 operations

Currently, the following operands are supported in AQL:

Operand meaning
< less than
<= less than or equal to
> greater than
>= greater than or equal to
=, is equal to
!= not equal to
~= includes (string)
in includes (array)

Some of these operations are applicable only to attributes that are numbers, and some are applicable only to string attributes.

Supported value format

AQL supports a few different value types:

  • number — a number, e.g., id = 123
  • booleantrue or false : deleted is false
  • string — a string, should be in double quote marks: name = "some test case name"
  • array — an array or a list, used with square brackets [ ] .

Values in the array are separated with commas: name in ["first", "second"] or id in [123, 124]

  • function in the query context, extra functions are available, e.g.:

    1. now() — the current moment
    2. dayStartUtc() — start of the day in the UTC time zone
    3. weekAgo() — a week ago (exactly 168 hours)
    4. currentUser() — the current system user
these functions are unavailable for the test plans

All dates use the UNIX TIMESTAMP format in milliseconds.

Attribute types

Attributes can be simple (for example value id or name ) and composite (related to other objects, e.g., status , cf — custom filed).

Composite attributes can use the name or the ID of any 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.

Using the ID makes the writing and reading more complicated but guarantees that renaming an object won’t invalidate the query.