Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion [Gherkin] How to test for same feature with multiple backgrounds

Received: by 10.224.105.205 with SMTP id u13mr7140043qao.6.1352587859388;
        Sat, 10 Nov 2012 14:50:59 -0800 (PST)
X-BeenThere: cukes@googlegroups.com
Received: by 10.229.197.162 with SMTP id ek34ls8270705qcb.1.gmail; Sat, 10 Nov
 2012 14:50:53 -0800 (PST)
Received: by 10.224.105.205 with SMTP id u13mr7140015qao.6.1352587853241;
        Sat, 10 Nov 2012 14:50:53 -0800 (PST)
Received: by 10.224.105.205 with SMTP id u13mr7140014qao.6.1352587853232;
        Sat, 10 Nov 2012 14:50:53 -0800 (PST)
Return-Path: <li...@idiacomputing.com>
Received: from homiemail-a28.g.dreamhost.com (caiajhbdccac.dreamhost.com. [208.97.132.202])
        by gmr-mx.google.com with ESMTP id f17si110293qck.1.2012.11.10.14.50.52;
        Sat, 10 Nov 2012 14:50:53 -0800 (PST)
Received-SPF: neutral (google.com: 208.97.132.202 is neither permitted nor denied by best guess record for domain of li...@idiacomputing.com) client-ip=208.97.132.202;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 208.97.132.202 is neither permitted nor denied by best guess record for domain of li...@idiacomputing.com) smtp.mail=li...@idiacomputing.com; dkim=pass (test mode) header...@iDIAcomputing.com
Received: from homiemail-a28.g.dreamhost.com (localhost [127.0.0.1])
	by homiemail-a28.g.dreamhost.com (Postfix) with ESMTP id 9290A1B4058
	for <cukes@googlegroups.com>; Sat, 10 Nov 2012 14:50:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=iDIAcomputing.com; h=
	message-id:date:from:mime-version:to:subject:references
	:in-reply-to:content-type:content-transfer-encoding; s=
	idiacomputing.com; bh=GMUmUDw6+9QxxDRwxDLX4102zJI=; b=HZsvZ/n0CC
	54lWj8toE5LaLHEZEnViQ+JdUGuIRvzxF7WxVU5NFrzTOLWvL62jryXznm7Nn6uc
	SJQ3W3Mbip5HHgg/nxj++GhL5HdCE/O6Ar2RQdhZlPY+GdSNGsLZRjVqObQhNf7s
	h0fTOp14W+01jRfK91GHItffnqLR9S+G4=
Received: from wildebeest.home (pool-173-67-43-86.bltmmd.fios.verizon.net [173.67.43.86])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: gdinwid...@gdinwiddie.com)
	by homiemail-a28.g.dreamhost.com (Postfix) with ESMTPSA id 2712E1B4057
	for <cukes@googlegroups.com>; Sat, 10 Nov 2012 14:50:51 -0800 (PST)
Message-ID: <509EDA4A.6000...@iDIAcomputing.com>
Date: Sat, 10 Nov 2012 15:50:50 -0700
From: George Dinwiddie <li...@iDIAcomputing.com>
Organization: iDIA Computing, LLC
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: cukes@googlegroups.com
Subject: Re: [Cucumber] [Gherkin] How to test for same feature with multiple
 backgrounds
References: <25215a70-ac77-425b-b9e4-72caaaa41d34@googlegroups.com>
In-Reply-To: <25215a70-ac77-425b-b9e4-72caaaa41d34@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Tim,

On 11/9/12 6:39 AM, Tim Diggins wrote:
> I've got a feature which was written for one user group (and explicitly
> excluded from another) and now times (and requirements) have changed and
> we need to make the same feature available to another user group. So
> ideally I'd like to run the same set of Scenarios with two different
> backgrounds. I can imagine doing this by writing a "Background Outline"
> with a table of specifics (parallel to how Scenario outlines work).
> Alternatively I could abstract a list of Scenarios into a separate file
> and 'include' the scenarios into two different features (each with their
> own background).
>
> Is there any way of supporting this in Gherkin? Or failing that where
> would I start (and at least not-totally-inadvisable) to extend Gherkin
> to do either of these?
>
> I've written this up in more detail
> in http://stackoverflow.com/questions/13141894/how-to-test-for-same-feature-with-multiple-backgrounds-in-cucumber.
> Feel free to reply in either place.

The stackoverflow posting shows the syntax you imagine, but doesn't 
really show the need for it.

I can't really imagine the need for running every scenario with every 
user role. That sort of exhaustive testing smells mechanical to me, and 
suggests not thinking deeply about the need. For the scenarios that 
don't change based on role, why is testing each role necessary? Is it 
highly likely that a mistake will be made such that one role will work 
and another will not? And, if so, is this something that is being worked 
out in conversation with the representative from the business? Or 
perhaps you'd do better using a code-based tool to check all permutations.

I can envision some scenarios where the role is varied in the Given and 
the expectation is sometimes the same and sometimes different in the 
Then part of a scenario outline. That seems reasonable for checking the 
role-based behavior.

I guess I'd have to see the scenarios to understand your need.

  - George

-- 
  ----------------------------------------------------------------------
   * George Dinwiddie *                      http://blog.gdinwiddie.com
   Software Development                    http://www.idiacomputing.com
   Consultant and Coach                    http://www.agilemaryland.org
  ----------------------------------------------------------------------