Optional `expect` block as a part of framework
Is your feature request related to a problem? Please describe.
We have discovered in support chat, that some users do their own blocks instead of step for making assertions after step.
I suppose it could be helpful, if such option would be part of the framework and documentation on test structure.
Adding this alternative to step can be also helpful for synchronisation of test code with TMS, like:
-
step- contains description of Action field -
expect- contains description of Checks/Expected field
The main goal of this issue is to start discussion of implementation variants.
Describe the solution you'd like Current solution we have in my project is:
fun TestContext<*>.expect(description: String, actions: (StepInfo) -> Unit) = this.step(description, actions)
This does not put any restrictions or obligations on test structure though.
Expect block can be either at the same level as step, or inside of step.
Describe alternatives you've considered №1: Use nested steps:
step { // will be enumerated like 1
// actions
step { // will be enumerated like 1.1
// asserions
}
}
(to be continued)
Additional context