Vajda
Vajda

Reputation: 1794

Specflow scenarion description to long

I used to create scenarios where in scenario name I explain what is scenario. For example:

Scenario: When during context switch, context doesn't match and list of facts for delete are shown to user, facts should be deleted if user has selected them in the list.

But problem is that scenarios getting more and more complicated and scenario names longer and longer. Should I keep writing long names or do you have some better suggestion?

Upvotes: 0

Views: 555

Answers (2)

SaxonMatt
SaxonMatt

Reputation: 959

The scenario outlined in the question sounds highly coupled with the system. What is the behaviour you're specifying?

However, to roll with what you've got, I think this is just a language issue.

I Think personally I would just rename it to something like:

Scenario: Should be able to delete non-matching facts

It's more generic but still tells you what's going on when somebody reads the scenario (given the context of the feature and other associated scenarios).

At the end of the day, the length of the scenario name shouldn't matter - just as long as those involved in the development (think the 3 amigos, developer, tester and business stakeholder); all know what it means. But obviously, the easier it is for somebody else to understand, the better.

Upvotes: 1

perfectionist
perfectionist

Reputation: 4346

Well it sounds like you are repeating yourself.

The test below probably doesn't match up to what you mean. But pretend it does.

If your scenario looks like this:

Given the current context is Green
And the following list of facts for delete are selected
   | Fact | Checkboxstate |
   | A    | checked       |
   | B    |               |
   | C    | checked       |
   | D    |               |
When I perform a context switch to Orange
Then the following facts should be deleted
   | Fact |
   | A    |
   | C    |
And the following facts should not be deleted
   | Fact |
   | B    |
   | D    |

Then the test is barely more complicated than the scenario title you suggested. (if the test is much more complex than this, then that might be another problem)

Instead try and keep the feature and scenario titles brief and meaningful: e.g.

Feature: Context Switching

    Scenario: New Context should be enabled
    Scenario: Selected facts should be deleted
    etc.

Upvotes: 1

Related Questions