How to call/run an assertion in a Groovy Script?
For maintenance purposes I'm trying to centralize test steps in one single test case as much as possible. Usually this test case has an XQuery Match Assertion which checks some nodes for a given id. I'd like though implementing a conditional assertion script which would allow me calling specific assertions according to a given control property, so that I do not need 2 different test cases due to assertion points.
For instance that's more or less the structure I'd like to implement:
--------------------
- MainTestCase: JDBC Connection executing a simple Select
--------------------
- NotContainsAssertion (disabled)
check if the sql does not return a given ID
- XQueryAssertion (disabled)
check the sql results for a given ID
- Script Assertion:
if control=0, calls NotContainsAssertion
if control=1, calls XQueryAssertion
--------------------
- PositiveTestCase:
--------------------
- control=1
- Run_MainTestCase
it will run the XQueryAssertion
--------------------
- NegativeTestCase:
--------------------
- control=0
- Run_MainTestCase
it will run the NotContainsAssertion
Is it somehow possible calling/running an assertion from a script? Any suggestions?