John Goodsen
2009-Apr-09 18:19 UTC
[rspec-users] [cucumber, jruby] Same steps are being added multiple times?
Hi all, I''m not quite sure I understand how env.rb is loaded in the cucumber/jruby world. I have a directory structure like this: stories/fulfillment_status_tracking stories/fulfillment_status_tracking/main_success.feature stories/fulfillment_status_tracking/test.feature stories/regular_billme_single_title_subscription stories/regular_billme_single_title_subscription/form_validation.feature stories/regular_billme_single_title_subscription/main_success.feature stories/support stories/support/env.rb My env.rb file simply loads my Java step class and adds it, here''s what it looks like: ----------- env.rb ----------- require ''cucumber/java'' import ''com.timeinc.ecommerce.storytests.cucumber.NavigationSteps'' register_steps(NavigationSteps) SeleniumController.markStepsLoaded() ----------- but when I run my tests with: jruby -S cucumber -r stories/support/env.rb I am getting Ambiguous match of my steps - but I only have a single class of steps, NavigationSteps. any ideas what''s going on? -- John Goodsen RADSoft / Better Software Faster jgoodsen at radsoft.com Lean/Agile/XP/Scrum Coaching and Training http://www.radsoft.com Ruby on Rails and Java Solutions -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090409/e65b248c/attachment.html>
James Byrne
2009-Apr-09 18:52 UTC
[rspec-users] [cucumber, jruby] Same steps are being added multiple times?
John Goodsen wrote:> > but when I run my tests with: jruby -S cucumber -r > stories/support/env.rb > > I am getting Ambiguous match of my steps - but I only have a single > class of steps, NavigationSteps. > > any ideas what''s going on?You have two (or more) step matchers that match a single clause in a scenario. The error message usually tells you exactly which steps in which files collide, for the MRI anyway -- Posted via http://www.ruby-forum.com/.
John Goodsen
2009-Apr-09 20:09 UTC
[rspec-users] [cucumber, jruby] Same steps are being added multiple times?
I understand how this happens when I *really do* have ambiguous steps, but in my simple case, I don''t. I only have a single class which contains steps (attached below). I can run a single scenario just fin, but when I try to run multiple scenarios in one run, I get Ambiguous step errors. It''s like the steps are getting added again before each scenario runs - I''ve got to be missing something really basic here. thanks in advance, John PS: Here''s the one, and only one, step class that I''m using (implementation removed for shortness): package com.timeinc.ecommerce.storytests.cucumber; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.thoughtworks.selenium.Selenium; import com.timeinc.ecommerce.KickOffFulfillment; import com.timeinc.ecommerce.domain.FulfillmentTransaction; import com.timeinc.ecommerce.domain.Order; import com.timeinc.ecommerce.domain.PersistenceService; import com.timeinc.ecommerce.storytests.StoryTestProperties; import com.timeinc.ecommerce.storytests.checkers.OrderChecker; import com.timeinc.ecommerce.storytests.selenium.Page; import com.timeinc.ecommerce.storytests.selenium.ReceiptPage; import com.timeinc.ecommerce.storytests.selenium.SeleniumController; import cucumber.Given; import cucumber.Table; import cucumber.Then; import cucumber.When; public class NavigationSteps { @Given("the microsite with") public void givenTheMicrosite(Table table) { } @When("I navigate to the microsite") public void whenTheUserNavigatesToTheMicrosite() { } @When("I submit the form with") } @Then("I see a receipt page") public void theUserIsPresentedWithAReceiptPage() { } @Then("a new order is created with") public void aNewOrderIsCreatedWith(Table table) { } @Then("the following error messages are displayed") public void theFollowingErrorsShouldBeDisplayed(Table table) { Page.ensureErrorsAreDisplayed(selenium, table); } @When("fulfillment runs") public void fulfillmentRuns() throws Exception { } @Given("an order exists in the system") public void anOrderExistsInTheSystem() { } @When("the user navigates to the status tracking page for the order") public void navigatesToStatusTrackingPage() { } @Then("the transaction is displayed as succeeded") public void theTransactionIsDisplayedAsSucceeded() { } } On Thu, Apr 9, 2009 at 2:52 PM, James Byrne <lists at ruby-forum.com> wrote:> John Goodsen wrote: > > > > > but when I run my tests with: jruby -S cucumber -r > > stories/support/env.rb > > > > I am getting Ambiguous match of my steps - but I only have a single > > class of steps, NavigationSteps. > > > > any ideas what''s going on? > > You have two (or more) step matchers that match a single clause in a > scenario. The error message usually tells you exactly which steps in > which files collide, for the MRI anyway > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- John Goodsen RADSoft / Better Software Faster jgoodsen at radsoft.com Lean/Agile/XP/Scrum Coaching and Training http://www.radsoft.com Ruby on Rails and Java Solutions -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090409/f69c3703/attachment.html>
Neema Cheriyath
2009-Apr-18 06:23 UTC
[rspec-users] [cucumber, jruby] Same steps are being added multiple t
Aslak Helles?y wrote:> On Tue, Apr 14, 2009 at 12:08 AM, John Goodsen <jgoodsen at radsoft.com> > wrote: > >> OK, I''ll reproduce in a simple example and create a ticket... >> >> > Excellent - I''ll get to it ASAPI am also having the same issue with cucumber-java. please refer - http://www.ruby-forum.com/topic/184342#new With cucumber-java , it seems that we would be able to run only one feature file and one scenario in that file. Is there any way by which we can execute multiple feature files that will invoke seperate scenarios? Thanks, Neema -- Posted via http://www.ruby-forum.com/.
Aslak Hellesøy
2009-Apr-18 07:50 UTC
[rspec-users] [cucumber, jruby] Same steps are being added multiple t
> Aslak Helles?y wrote: >> On Tue, Apr 14, 2009 at 12:08 AM, John Goodsen <jgoodsen at radsoft.com> >> wrote: >> >>> OK, I''ll reproduce in a simple example and create a ticket... >>> >>> >> Excellent - I''ll get to it ASAP > > I am also having the same issue with cucumber-java. > > please refer - http://www.ruby-forum.com/topic/184342#new > > With cucumber-java , it seems that we would be able to run only one > feature file and one scenario in that file. >Sounds like a bug then.> Is there any way by which we can execute multiple feature files that > will invoke seperate scenarios? >Someone fixes the bug ;-) Aslak> Thanks, > Neema > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users