Customizing Tests
Standard test
parameters
test
parametersThe modddels test methods (isValid
, isSanitized
...) can receive the same parameters as the test
function (Except description
and body
).
These parameters are : testOn
- timeout
- skip
- tags
- onPlatform
- retry
For example :
For more information, check out the documentation of the test
function.
Test Description
Each test's description is automatically generated. It uses the Gherkin syntax (given-when-then).
For isValid
tests :
For isSanitized
tests :
For isInvalid
tests :
Example : For this test :
The generated description is :
The maxTestInfoLength
maxTestInfoLength
As you can see, the description can contain {params}, {sanitizedParams} and {failure}. These can be quite long strings, which would cause the description to become too long and unreadable.
To keep the description short enough, each one of those strings' length is limited to maxTestInfoLength
, beyond which they are ellipsized. This maxTestInfoLength
defaults to 200
characters, but it can be modified by :
Providing it in the modddel annotation :
Providing it in the Tester's constructor. This takes priority over
maxTestInfoLength
set in@Modddel
.Providing it in the test method itself. This takes priority over
maxTestInfoLength
set in the Tester's constructor.
This "ellipsisation" can be disabled by setting maxTestInfoLength
to Modddel.noMaxLength
(which equals -1
).
Last updated