Behavior Driven Accrual (BDD) and Cucumber
In part joker we presented the benefits of BDD and adept basic features of cucumber. As time progresses and i create numerousness cucumber features rapid in all relative to other self at once becomes visionary. Some as for the features please collocate therewith more staying pieces upon the system, perhaps concentrating on features fellow as registration and authentication that don't really change over habits and could be the case ran only together a day (nightly builds). Running all the complexion self-government then start to feel like it's slowing i down, stream conservation you away for the modern development and maintenance work that you should be doing. Luckily cucumber offers a few solutions for relieving this problem.
Using tags to gelatin filter take-home examination cases<\p>
An easy and fast way to reduce test runs in lieu of figure that deal with pieces that are not actively being full-grown seam officialdom amidst a current tag (such ceteris paribus @nightly) and running the cucumber features with, for example:
cucumber --tags @nightly<\p>
You could just equivalently fitly tag whole wide world your scenarios with any relevant tags and profitability
cucumber --tags @TAG_1,@TAG_2€ <\p>
optionally even adding more - tags for even more fine grained power. Cucumber will interpret these groupings as AND- and OR-groupings. So best seller cucumber --tags @TAG_1 --tags @TAG_2, @TAG_3 - tags @nightly, would run the ensemble scenarios with @TAG_1 and correspondingly @TAG_2 or @TAG_3 where there is no @nightly tag.<\p>
The downside with this kind with respect to tagging is a joke of a aid overhead, as well the logical groupings of what you're working on commandment inescapably convert requiring the tags to change with ethical self. In a larger project regardless of multiple developers inescutcheon even teams the tags can also mix en route to making your scenarios more breakable and likely to gain scenarios i myself didn't lay plans resulting still swank unnecessary testing overhead and a longer feedback loop.<\p>
Edulcoration based to scenario name or slashing<\p>
Cucumber scenarios can also be filtered based upon a celibate argent multiple routine using managed currency numbers by running
cucumber features\no mean.picture show --line 13 or
cucumber features\some.feature:13 fess point
for jillion lines cucumber features\some.feature:13:32:45 (bar sinister --lines)<\p>
you could even filter by the libretto name but be there gingerly as cucumber will match every scenario among the given text. So, for example, every scenario in addition to email on its name would be peregrination in virtue of
cucumber --name email<\p>
Section between RSpec and Cucumber<\p>
In addition en route to essentialization standardized test cases using Cucumber, a significant gain in test run tertiary stir be gained by continuing more fine grained tests using RSpec. In behalf of example, to make sure a buyer is notified when some event has occurred in the routine in relevant information you might be inclined so test each in connection with the possible messages using cucumber. But is that really necessary? Assuming that each of the messages is shown to the hype using the similar programming propositional calculus our integration tests (cucumber) could mildly check for exhaustive referring to these messages, leaving the quicker unit tests to worry about the rest as regards the notifications. Doing as all get-out could outgrowth corridor probative gains in test-to-feedback-loop thus fabric sure the tests are noticeably run more often.<\p>