Antony Vaysberg | 31 Jan 21:54 2015
Picon

[Cucumber] [JVM] Using DB for test with multiple scenarios

Hi,
I have cucumber automation test written in Java that is running from Jenkins. The purpose of test is to check the same flow with a big number of scenarios (250-300). I have DB with parameters for all test cases/scenarios. But I can't find way to run my test in loop with for all test cases. I've tried to do it with <at> after class, but it's not works, the test report in Jenkins displays result for single test (I think that the results were rewritten because the same test was running).
So I would like to ask if there is any way to run the same test with multiple scenarios and to retrieve their parameters from DB? Is the Cucumber framework is possible to do it? If not maybe there is another framework that do it?
Thanks for help.

--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
dan.kohn | 31 Jan 23:06 2015

[Cucumber] Scenario Outlines for Backgrounds

My colleague posted a request for Scenario Outlines for Backgrounds and was asked to move the request to the mailing list. mattwynne said that he was personally against the idea because "readability trumps DRY". I wanted to include the actual feature we're using so you can see how needing to repeat ourselves makes the feature much less readable. The context for the feature is that there is a set of functionality that is being tested to act the same for 4 different user roles. A different feature tests alternative functionality for 2 other user roles, where the user is an admin.

Feature: Claims
 
In order to track Claims
 
As a Carrier User
  I
use the Claim views

 
Scenario Outline: Search Claims
   
Given I am logged in as <role>
   
And a reported searchable Claim exists
   
When I search for that Claim
   
Then I should see that Claim as a search result
   
And I can download the Report

   
Examples:
     
| role                        |
     
| adjuster                    |
     
| nurse_case_manager1         |
     
| manager                     |
     
| technical_assistant         |

 
Scenario Outline: Add a New Claim
   
Given I am logged in as <role>
   
And a Company exists
   
When I go to the new Claim page
   
And I add a new Claim
   
Then I should see the new Claim is created

   
Examples:
     
| role                        |
     
| adjuster                    |
     
| nurse_case_manager1         |
     
| manager                     |
     
| technical_assistant         |

 
Scenario Outline: Edit the Claim
   
Given I am logged in as <role>
   
And a searchable Claim exists
   
When I go to the edit page for the first Claim
   
And I edit the Claim
   
Then I should see the Claim is updated

   
Examples:
     
| role                        |
     
| adjuster                    |
     
| nurse_case_manager1         |
     
| manager                     |
     
| technical_assistant         |

 
Scenario Outline: Add a ClaimNote to the Claim
   
Given I am logged in as <role>
   
And a searchable Claim exists
   
When I visit the ClaimNotes page for the first Claim
   
And I add a new note to the Claim
   
Then I should see the note is added to the Claim

   
Examples:
     
| role                        |
     
| adjuster                    |
     
| nurse_case_manager1         |
     
| manager                     |
     
| technical_assistant         |

 
Scenario Outline: Edit an existing ClaimNote on the Claim
   
Given I am logged in as <role>
   
And a Claim with a ClaimNote exists
   
When I visit the ClaimNotes page for the Claim
   
And I edit the note on the Claim
   
Then I should see the ClaimNote is updated

   
Examples:
     
| role                        |
     
| adjuster                    |
     
| nurse_case_manager1         |
     
| manager                     |
     
| technical_assistant         |

What we would like to have is:


Feature: Claims
  In order to track Claims
  As a Carrier User
  I use the Claim views

  Background Outline:
    Given I am logged in as <role>

    Examples:
      | role                        |
      | adjuster                    |
      | nurse_case_manager1         |
      | manager                     |
      | technical_assistant         |

  Scenario: Search Claims
    And a reported searchable Claim exists
    When I search for that Claim
    Then I should see that Claim as a search result
    And I can download the Report

  Scenario: Add a New Claim
    And a Company exists
    When I go to the new Claim page
    And I add a new Claim
    Then I should see the new Claim is created

  Scenario: Edit the Claim
    And a searchable Claim exists
    When I go to the edit page for the first Claim
    And I edit the Claim
    Then I should see the Claim is updated

  Scenario: Add a ClaimNote to the Claim
    And a searchable Claim exists
    When I visit the ClaimNotes page for the first Claim
    And I add a new note to the Claim
    Then I should see the note is added to the Claim

  Scenario: Edit an existing ClaimNote on the Claim
    And a Claim with a ClaimNote exists
    When I visit the ClaimNotes page for the Claim
    And I edit the note on the Claim
    Then I should see the ClaimNote is updated

We're open to suggestions for alternative structuring, but supporting Background Scenarios seems like a huge win for both readability and DRYness. Also note that nearly the identical question was asked in 2009, but the use case remains a valid one in my mind.

--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Eric Brayet | 31 Jan 14:47 2015

[Cucumber] [CPP] How to deal with a scenario that needs several apps interacting

Hi,

We are creating a multiplayer game. Each player has her own computer and runs an instance of our app. In order
to test interactions within a game, we need a scenario that dispatches steps on several instances of the
same app.

Using several .wire files, we can get all the instances under control. But since they are all identical they
all match the same steps regexp. And the scenario stops due to the match ambiguity.

For example, considering we have 2 nodes called nide1 and node2 and 2 files node1.wire and node2.wire, we
would like to write a scenario like this:
Given I create a game "Game1" on node1
Then I see the game "Game1" on node2

Is there a way to achieve this? Is there a way to specify hints to resolve the ambiguity at the step level?

Eric B.

--

-- 
Posting rules: http://cukes.info/posting-rules.html
--- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.
Javix | 29 Jan 17:38 2015
Picon

[Cucumber] [JVM] Use before and after hooks

I wonder how to reuse correctly the values initialized in a <at> Before hook and stay the DRYer possible ? So, imagine I have a trivial scenario:

Feature: Let's try some hooking

Scenario: Fill the box
Given I have an empty box
When I put a toy in the box
Then the box should have 1 toy
And the implemented steps:

public class ToyStepdefs {

private HookyBox box;

<at> Given("^I have an empty box$")
public void i_have_an_empty_box() throws Throwable {
box = new HookyBox();
assertThat(box.getToys()).isEmpty();
}

<at> When("^I put a toy in the box$")
public void i_put_a_toy_in_the_box() throws Throwable {
Toy toy = new Toy();
box.getToys().add(toy);
}

<at> Then("^the box should have (\\d+) toy$")
public void the_box_should_have_toy(int toys) throws Throwable {
assertThat(box.getToys().size()).isEqualTo(toys);
}
}
where HookyBox and Toy are just POJOs, HookuBox has a list of Toys.
What I'd like is to run a <at> Before Hook that would initialize HookyBox (like it does in the Given step and reuse in other steps. So even if I define a method in the ToyStepdefs:

<at> Before(" <at> initBox")
private void initHookyBox() {
box = new HookyBox();
}

how can I reuse the empty box in features tagged <at> initBox ? I believed that the real need was exactly to be able to access some variables initialized in <at> Before hooks.

Thank you

--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Rich Crook | 29 Jan 02:11 2015
Picon

[Cucumber] DataTable asMap List Map Row Order

Given I have the following DataTable:

    Then the List of Film grid details for this Film should be:

      | Film Title              | Banner                          | Status   |

      | Z MY TEST FILM | My Great Film Company | Pending |


I would have expected after transforming it via: 

Then(~'^the List of Film grid details for this Film should be:$') { DataTable expectedFilmGridTable ->

List<Map<String,String>> FilmGridData  = expectedFilmGridTable.asMaps(String.class, String.class)

…that an inspection of the 'expectedFilmGridTable' Object would be something like:

[0] = {java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry <at> xxxx}"Film Title" -> "Z MY TEST FILM"

[1] = {java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry <at> xxxx}"Status" -> "Pending"

[2] = {java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry <at> xxxx}"Banner" -> "My Great Film Company"

But in fact it is:

[0] = {java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry <at> xxxx}"Status" -> "Pending"

[1] = {java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry <at> xxxx}"Film Title" -> "Z MY TEST FILM"

[2] = {java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry <at> xxxx}"Banner" -> "My Great Film Company"


In fact for every DataTable I create the first two items are “flipped” and the rest remain in order.

I am doing something wrong or might this be a bug in Cucumber? Should I somehow be using a LinkedHashMap instead?

  

Thanks,

Rich

--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
shankar garg | 27 Jan 14:13 2015
Picon

[Cucumber] gherkin.lexer.LexingError: Lexing error on line 2:

I am trying to implement Feature file in french. This is the feature file:

# language: fr
Fonctionnalité: Exemple bonjour

Scénario: Exemple bonjours
Soit: utilisateur est sur demande page d'atterrissage

PS: translation is from google translator and from https://github.com/cucumber/gherkin/blob/master/lib/gherkin/i18n.json

But i keep on getting this error:
Running com.CucumberOptions.RunCukeTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.532 sec <<< FAILURE!
initializationError(com.CucumberOptions.RunCukeTest)  Time elapsed: 0.014 sec  <<< ERROR!
cucumber.runtime.CucumberException: Error parsing feature file language.feature
        at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:133)
        at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:102)
        at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:54)
        at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:34)
        at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:201)
        at cucumber.api.junit.Cucumber.<init>(Cucumber.java:60)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
        at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
        at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
        at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
        at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
        at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:250)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: gherkin.lexer.LexingError: Lexing error on line 2: 'Fonctionnalit?: Exemple bonjour

Sc?nario: Exemple bonjours
Soit: utilisateur est sur demande page d'atterrissage
%_FEATURE_END_%'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.
        at gherkin.lexer.Fr.scan(Fr.java:918)
        at gherkin.lexer.I18nLexer.scan(I18nLexer.java:36)
        at gherkin.parser.Parser.parse(Parser.java:62)
        at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:131)
        ... 27 more


Results :

Tests in error:
  initializationError(com.CucumberOptions.RunCukeTest): Error parsing feature file language.feature

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0


Same code works for Danish language but ofcourse after translating to Danish.

--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Steve Schrock | 26 Jan 18:35 2015
Picon

[Cucumber] [CPP] Why is my cucumber-cpp so slow?

I just began using cucumber-cpp and have found that it is very slow--callgrind indicates that ~75% of the time is spent in cucumber::internal::JsonSpiritWireMessageCodec::decode() (which I would expect) and the vast majority of the time in decode() is spent deep inside boost::spirit::classic::...

I believe that cucumber-cpp can be fast because the cucumber-cpp documentation (https://github.com/cucumber/cucumber-cpp/wiki/Primer-0.3) lists the output from a run of the included Calc example. The output shows that the 16 steps in the test execute in almost no time at all ("0m0.045s") while they execute in multiple seconds when I run them ("0m3.210s"). That is a 70x difference! I don't understand why parsing the JSON is so time-consuming since the cucumber wire protocol is tiny.

What speeds are the rest of you seeing with cucumber-cpp?

Here is my set up:
Ubuntu 14.04
gcc/g++ 4.9.2 (I was using 4.8.2 originally but it made no significant difference)
cmake 2.8.12.2
cucumber-cpp 0.3 (built for Release so -O3)
boost 1.57.0 (statically linked... I also tried dynamically linked but it made no significant difference)
ruby 1.9.3p484
cucumber 1.3.18
Google Test 1.7 (so I am actually running GTestCalculatorSteps)

Thanks,
Steve

--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Enrique Matta | 26 Jan 17:17 2015
Picon

[Cucumber] Parallel Testing question (Per Scenario instead of Per Feature files

Hey all,

Here is my problem. I have a set of Feature files that have anywhere from 5 Scenarios to 100 Scenarios in each file. When we use parallel_test it separates out per feature file. Is there any way to separate these out per scenarios instead? Should we look at another tool?

--Enrique

--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
jakub.czeczotka | 25 Jan 21:57 2015
Picon

[Cucumber] [JVM] Blog posts on Cucumber JVM with Maven and step definitions

Hi guys

Some time ago I did two blog posts on setting up a Cucumber-JVM project with Maven and writing step definitions. There are links to github repos from which you can clone working code from the posts.

http://blog.czeczotka.com/2014/07/22/cucumber-jvm-with-maven-in-minutes/
http://blog.czeczotka.com/2014/08/17/writing-cucumber-jvm-step-definitions/

I hope you find it helpful.

Cheers,
Jakub

--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Matt Wynne | 26 Jan 12:35 2015
Picon

[Cucumber] [ANN] Cucumber Ruby 2.0 RC1 Released

See http://cukes.info/blog/2015/01/31/cucumber-ruby-rc-3-released.html for details.

--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Paul Williams | 25 Jan 15:45 2015
Picon

[Cucumber] [JVM] lien-cucumber returning exit code 0 with failures

My understanding of Cucumber, and Cucumber-JVM in particular is that it should return non zero exit codes for failures.


I'm just exploring a new problem domain in Clojure, and thought Cucumber-JVM would be a good way to explore it. I was a little surprised to see exit code 0 with pending steps, but I was more surprised when deliberately broken steps also produced a zero exit code:

narnia:whattodo will$ lein cucumber
Running cucumber...
Looking for features in: [features]
Looking for glue in: [features/step_definitions]

FAIL in clojure.lang.PersistentList$EmptyList <at> 1 (steps.clj:5)
expected: (= 1 2)
actual: (not (= 1 2))
.
FAIL in clojure.lang.PersistentList$EmptyList <at> 1 (steps.clj:9)
expected: (= 1 2)
actual: (not (= 1 2))
.
FAIL in clojure.lang.PersistentList$EmptyList <at> 1 (steps.clj:13)
expected: (= 1 2)
actual: (not (= 1 2))
.
FAIL in clojure.lang.PersistentList$EmptyList <at> 1 (steps.clj:17)
expected: (= 1 2)
actual: (not (= 1 2))
.

narnia:whattodo will$ echo $?
0

Am I doing something wrong? I'm using lein-cucumber for reference :-

(defproject whattodo "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]]
:plugins [[lein-cucumber "1.0.2"]])

--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane