[QA] Best practices for long scenarios in Cucumber?

Vernon vernon at virtesting.com
Wed Dec 18 16:12:36 UTC 2013


My understanding of feature files tallies up with Zeljko.

Assuming you haven't looked into this already but I'm sure there's a Cucumber feature called a Background that might help? (Travelling at the moment otherwise I'd check this out for you - sorry).


Sent from Samsung Mobile

-------- Original message --------
From: Nikolas Everett <neverett at wikimedia.org> 
Date: 18/12/2013  15:49  (GMT+00:00) 
To: "QA (software quality assurance) for Wikimedia projects." <qa at lists.wikimedia.org> 
Subject: Re: [QA] Best practices for long scenarios in Cucumber? 
 



On Wed, Dec 18, 2013 at 10:41 AM, Željko Filipin <zfilipin at wikimedia.org> wrote:
On Tue, Dec 17, 2013 at 10:26 PM, Jeff Hall <jhall at wikimedia.org> wrote:
This works just fine, but it seems like a violation of the Don't Repeat Yourself (DRY) philosophy1].  Does anyone know if there is a more elegant way to construct a long Scenario in Cucumber?

I have already commented in the commit[1], but I will repeat here:

"The goal of feature file is communication. Lines 17-32 should be replaced with something like "given I have edited the page three times"."

Like I said, I don't like looping constructs in steps because they make failures harder to read.  Something like
Given I have edited the page to add foo
And I have edited the page to add bar
And I have edited the page to add splat

is longer, has more repetition, but will at least tell you which edit failed if one did.  Even if you don't expect the edits to fail, stuff happens, and knowing more is important.  Especially if the tests take a long time to fun.

Nik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/qa/attachments/20131218/1cee404b/attachment.html>


More information about the QA mailing list