ruby on rails - Cucumber -Run scenario only once -


i looking solution following scenario. writing cucumber-capybara tests ruby on rails application.

i have multiple cucumber feature file several scenarios (say scenario b...z) dependent on 1 particular scenario (say scenario a). want run scenario once scenarios dependent on it. if run scenarios (b....z) wanted run dependent scenario (a) once. came across before hook in cucumber run once every scenario.

i have 1 feature file , in there 1 scenario provisions server. (scenario a)

i have multiple other feature files , multiple scenarios (scenario b..z) run tests assuming server provisioned (scenario a)

so whenever runs dependent scenarios (scenario b..z ), should check if server provisioned other scenario should not try provision server. increase no.of servers.

you write feature scenario a, , write given block set initial expectation scenario about, can call before scenario b..z

so, assuming scenario sign in, write single feature signing in, , scenario b z, write given block set user signed-in, , use as:

given user signed in ... 

where given user signed in defined like:

given /^user signed in$/   # code sign user in end 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -