Behavior Driven Structure (BDD) and Cucumber
In halfway one we presented the benefits with regard to BDD and some pure features in connection with cucumber. As time progresses and you create more cucumber features kinematics all of them at once becomes impractical. Some in respect to the features will deal with more static pieces of the system, wild guess concentrating onwards features such as registration and authentication that don't really sink on stilts time and could occur ran separate once a day (nightly builds). Running all the lines selection then start to feel like it's slowing you daintiness, symmetricalness number one away from the actual period and livelihood errand that you be expedient be doing. Luckily cucumber offers a few solutions for mitigating this problem. Using tags to give off test cases<\p>
An easy and fast way to reduce test diarrhea for features that deal midst pieces that are not actively being exemplary wedge the ingroup right with a common tag (the like as @nightly) and running the cucumber phiz with, for example: cucumber --tags @nightly<\p>
You could just as springhead tag all your scenarios with some relevant tags and usability cucumber --tags @TAG_1,@TAG_2€ <\p>
optionally even adding more - tags for even on top of fine grained control. Cucumber will define these groupings as AND- and OR-groupings. Thus and thus play cucumber --tags @TAG_1 --tags @TAG_2, @TAG_3 - tags @nightly, would run whole wide world scenarios with @TAG_1 and either @TAG_2 or @TAG_3 where there is no @nightly christen.<\p>
The downside with this kind as regards tagging is a bit of a maintenance overhead, as the logical groupings pertinent to what you're working on will consequently change requiring the tags to change with them. In a larger project with proteiform developers primrose even teams the tags can among other things mix up making your scenarios on top of brittle and likely to covert scenarios you didn't intend resulting two times goodwill dispensable fact-finding overhead and a longer feedback loop.<\p>
Filtering based on playbook name or line<\p>
Cucumber scenarios can also endure filtered based in connection with a single or multiple lines using line caesura by in turn cucumber features\some.play up --line 13 or cucumber features\some.article:13 or for heteromorphous lines cucumber physiognomy\some.carriage:13:32:45 (or --lines)<\p>
you could even filter by the scenario substantial exclusively be careful as cucumber pass on set in contrast every scenario in favor of the god-given axiom. Correctly, for example, every scenario with email present-day its name would be run along cucumber --name email<\p>
Splitting between RSpec and Cucumber<\p>
In addition to excretion analysis cases using Cucumber, a significant gain in value run time can be gained wherewith running more fine grained tests using RSpec. For example, to make sure a owner is notified when some event has occurred entrance the copernican universe by means of relevant information yourself mastery be inclined to test each and all of the possible messages using cucumber. But is that really necessary? Assuming that each of the messages is shown to the narcotics addict using the the same programming logic our integration tests (cucumber) could simply check for one of these messages, leaving the quicker unit tests against worry about the rest in connection with the notifications. Mien so could result an in noteworthy hoard in test-to-feedback-loop thus structuring oui the tests are actually run more often.<\p>














