On Friday, December 8, 2017 at 1:54:15 AM UTC-8, 江南 wrote:
>
> Thanks for your suggestion. 
>
> I'm testing a website and I have various data to test but I don't want to 
> create duplicate steps in different feature files so I want to do is put 
> the test steps e.g. Login page in one feature file and Account page in 
> another then pull the input data from a spreadsheet. 
> I think this way will make easier to maintain the feature file that is 
> all.    
>
>
While well intentioned you are heading in a direction that doesn't work 
very well..  Also your question seems to tell me you don't understand the 
basic concepts of how cucumber works (or you are not good at expressing 
your understanding) 

By design, steps are re-usable  so it is completely normal to see the same 
steps used in multiple feature files.
By design, there is only a single definition for a given step.. you can't 
have two steps with the same phrasing such as "When I login as xxxx" that 
do different things, that will result in an error.
Feature files should be created in a way that documents and describes the 
operation of the product.  Think of it like portions of a book that tells 
what your product does.
Step files, where steps are defined do not have to (and usually should not) 
parallel your feature files.   Rather the most common thing is to group 
common steps together.  For example a login_steps.rb file might have steps 
to login, self-register a new user, logout, etc.   You might have another 
step file that deals with steps that navigate around your site "when I 
click the xxx tab" for example

For anyone new to Cucumber I strongly recommend reading "the Cucumber 
Book"   it's the best way to gain an understanding of what cucumber is for, 
and how to best use it most effectively. 

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to