4.6. Tag Expressions

Tag expressions are boolean expressions with the operators !, & and |. In addition, ( and ) can be used to adjust for operator precedence.

Two special expressions are supported, any() and none(), which select all tests with any tags at all, and all tests without any tags, respectively. These special expressions may be combined with other expressions just like normal tags.

Table 2. Operators (in descending order of precedence)
OperatorMeaningAssociativity

!

not

right

&

and

left

|

or

left

If you are tagging your tests across multiple dimensions, tag expressions help you to select which tests to execute. When tagging by test type (e.g., micro, integration, end-to-end) and feature (e.g., product, catalog, shipping), the following tag expressions can be useful.

Tag ExpressionSelection

product

all tests for product

catalog | shipping

all tests for catalog plus all tests for shipping

catalog & shipping

all tests for the intersection between catalog and shipping

product & !end-to-end

all tests for product, but not the end-to-end tests

(micro | integration) & (product | shipping)

all micro or integration tests for product or shipping