dotnetprofessional / LiveDoc

A Living Documentation platform for BDD (Gherkin) specifications.
MIT License
9 stars 2 forks source link

Add Warning that .only may break tests #32

Open dotnetprofessional opened 7 years ago

dotnetprofessional commented 7 years ago

As a typical Gherkin test has many parts, only executing parts of it may result in needed parts not being executed which will result in an otherwise successful test failing. Here are some examples:

In general its best to apply .only at the feature level to ensure consistency. However as it can be applied at various levels, the recommendation is to warn developers of the issue if they attempt to do it.

dotnetprofessional commented 6 years ago

54 Address the first point. Now when a scenario is marked as .only it will always execute the background if one is present. This does not resolve the issue for G/W/T however.

dotnetprofessional commented 6 years ago

For scenarios, .only doesn't make sense as running a single step is likely not useful. As such the current recommendation is to throw an exception when trying to use .only on a step.