Is it possible to create a function that will be executed before / after the start of each test? Maybe something like this .
For example, this is necessary for
- return to clean db before each test
- clear application cache or registry settings after each test
Of course, you can create 2 functions and call them explicitly in the first and last line of each script. However, it would be advisable to define them once in one place so that they are automatically called for each test.
source
share