Multiple levels of action words and BDD


#1

Hi
I am looking for advice on the following problem. If I have multiple levels of action words in BDD mode then it becomes unclear which syntax word to use for lower level action word calls. For example
Given a file is uploaded
When the file is clicked in the UI
Then the file should be processed
(sub action word) <xxx> the file should appear in the database
(sub action word) <xxx> the database status of the file should be READY
And the file is updated in the UI

In this example, the represents BDD syntax (given, when, then, and etc) which I need to apply. But when I run the test I want these two sub-steps to appear as “result” rather than “action” which means I must use “Then” for syntax word. But this makes the BDD read badly because I end up with a repeated “Then” in the test:
Given a file is uploaded
When the file is clicked in the UI
Then the file should be processed
Then the file should appear in the database
Then the database status of the file should be READY
And the file is updated in the UI

Do you have any advice?
Thanks
Jim


#2

Hi Jim,

One solution (or more a workaround) for that would be to populate the content of your action words that performs checks with “result” steps having the same content than the action word name.
That’s not ideal but at least it generates tests where the steps are marked as results and not actions.

To take your example:

37

One of the sub action words:

13

And the corresponding test:

That may not be ideal but at least this reflects the true state of the steps.

Would this solution meet your needs ?

Best regards,
Vincent


#3

Hi Vincent
Sorry for my late reply.
That is basically what I’ve been doing but I wondered if there’s a more elegant solution or whether there’s something wrong in my basic scripting that means this shouldn’t happen normally.
Thanks
Jim