JBehave supports data by steps specified / when / then during script

I have been trying JBehave for a while, and I need to find out if there is a way to maintain data through steps while running one specific script? I mean, is it possible to maintain state / data during a script through "Given / When / Then" using any state variable under the Step class.

+6
source share
1 answer

Yes, you can pass an object that maintains a general state to different stages.

An example of Noughts And Crosses in jbehave core demonstrates this. There is some general state between the stories that are supported in the WindowControl class.

See that the NoughtsAndCrossesStory class, which sets up the environment, introduces an instance of WindowControl at all stages.

+4
source

Source: https://habr.com/ru/post/909043/


All Articles