[Cucumber] - Reusing scenario outline Example data table

1,721 views
Skip to first unread message

learnw...@gmail.com

unread,
Jul 15, 2013, 5:03:19 PM7/15/13
to cu...@googlegroups.com


 Hi All ,

  I am having the following scenario outline table in feature file 

Example :
  | Environment | username                | password
  | Production     | us...@gmail.com       |  password
  | UAT              | us...@yahoo.com      | password
  | QA                | us...@facebook.com | password | 


  I want use the above scenario outline table across multiple feature file ..that is currently i am  copying and pasting the above table in multiple feature and also , some time modifying data from each feature file on need basics ..instead of that ...

1 )  will it possible reuse the scenario outline table across multiple feature file ?  or  
2 )  is there any possibility to store the above scenario outline table in config file so that i can read it from feature file ? 

Please let me know the solution for my problem statement ?

Thanks ,
SVA . 

Matt Wynne

unread,
Jul 17, 2013, 5:12:21 AM7/17/13
to cu...@googlegroups.com
Hi,

On 15 Jul 2013, at 22:03, learnw...@gmail.com wrote:



 Hi All ,

  I am having the following scenario outline table in feature file 

Example :
  | Environment | username                | password
  | Production     | us...@gmail.com       |  password
  | UAT              | us...@yahoo.com      | password
  | QA                | us...@facebook.com | password | 


  I want use the above scenario outline table across multiple feature file ..that is currently i am  copying and pasting the above table in multiple feature and also , some time modifying data from each feature file on need basics ..instead of that ...

1 )  will it possible reuse the scenario outline table across multiple feature file ?  or  

No, cucumber does not support this.

2 )  is there any possibility to store the above scenario outline table in config file so that i can read it from feature file ? 

No, cucumber does not support this either.

Please let me know the solution for my problem statement ?

See http://dannorth.net/2008/06/30/let-your-examples-flow/ for some clues as to why we've never implemented this feature.


Thanks ,
SVA . 


--
-- Rules --
 
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
 
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Paolo Ambrosio

unread,
Jul 17, 2013, 12:40:26 PM7/17/13
to cu...@googlegroups.com
Hi,

Even if this post is a duplicate of Muthu's one, I'm replying here
because he hijacked his own thread asking a totally unrelated
question.

As Matt wrote, it's not supported in Cucumber. I believe there is a
way of addressing your problem though. You never explained what
application you are working on so I can give you only a generic
advice.

If you need to test your software in different environments, in my
opinion you should NOT use Scenario Outlines but instead pass an
environment variable with the name of the environment to use (perhaps
defaulting it to some value).

Let's say your web application needs to be compatible with four
browsers. As your features should express business needs, they should
not mention what browser the test should be using. I'm sure the
business assumes that all four browsers are fully supported! It is a
constraint, that should always be satisfied, just like performance,
security, etc.

When you run the features, your step definitions or hooks will create
the correct browser depending on the environment variable (i.e. drive
Chrome if BROWSER=chrome, Internet Explorer if BROWSER=ie, ...).

During development, you want a quick response, so you might want to
use a headless browser. This might be the default environment, when
the environment variable is undefined.

Before checking in the code, probably the developers should run the
full test suite with a reference browser (pick one that is available
on all dev boxes, that the business values most and that supports all
the features of your app).

The continuous integration server would then build the application and
execute features with ALL browsers (one run each, with different
environment variables).

As Oleg wrote, if a functionality is not supported by a browser, you
can tag the scenarios unsupported with something like @no-ie and
exclude scenarios tagged like that when running your features with IE.
It should be the exception rather than the rule though.


Paolo

Aida Manna

unread,
Jul 8, 2016, 6:01:23 AM7/8/16
to Cukes
Hi Matt,

Just wanted to ask, is there any change on this topic with the latest cucumber version? (using cucumber ruby). Thanks a lot.
Reply all
Reply to author
Forward
0 new messages