Csaba Bejan | 1 Oct 05:58 2014
Picon

[Cucumber] [JVM] Cucumber json generation results in OutOfMemoryError: Java heap space

Hello,

Recently as we were adding new tests to our suite we noticed that after the test execution finished we got an exception regarding Java heap space from GSON when it was trying to create the json report abut the test execution.
The obvious solution would be to change the jvm memory setting but this is only a temporary solution as the number of tests added to our suite is constantly growing. Also splittting the suite in smaller sets should solve the problem as it would result in smaller separate jsons but at the moment we don't have control over this aspect.

As I understand streaming should address this issue: https://sites.google.com/site/gson/streaming

My question is that whether anyone knows a workaround for this or will this be addressed in the future?

Thanks in advance,
Csaba

--
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.
Murilo Machado | 30 Sep 18:41 2014
Picon

[Cucumber] [Any help?] with read and call a step from a table value

Hello guys,

Im having some problem to call a step from a table value.

I have an feature like:

|value    |field           |type    |
|test       |test_field   |combo|
|test

So.... my idea its call a navigation step accordly to the type, as a combo i mean a combobox its gonna cal a step like:

When /^I select "([^\"]*)" from "([^\"]*)"$/ do |value, field|
    select(value, :from => field)
end

When its text

--
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.
Kyle Moore | 30 Sep 10:31 2014
Picon

[Cucumber] [JVM] Combining <at> Delimiter and <at> Transform

Hi. I'm trying to combine the <at> Delimiter and <at> Transform annotations to read a comma-separated list of values from a DataTable but am having trouble.

I'll try to provide the briefest example possible:

DelimiterTransform.feature
Feature: Use Delimiter and Transform at the same time

  Scenario Outline:
    Given I have these Longs <values>

  Examples:
    | values         | 
    | 1, 3, 5, 7, 11 |

LongTransformer.java
import cucumber.api.Transformer;

import java.math.BigDecimal;

public class LongTransformer extends Transformer<Long> {

  <at> Override
  public Long transform(String value) {
    return Long.valueOf(value);
  }
}

DelimiterTransformSteps.java
import cucumber.api.Delimiter;
import cucumber.api.Transform;
import cucumber.api.java.en.Given;

import java.util.List;

public class DelimiterTransformSteps {
  
  <at> Given("^I have these Longs (\\d+(?:, \\d+)*)$")
  public void getListOfBD( <at> Delimiter(", ")
                          <at> Transform(LongTransformer.class)
                          List<Long> values) throws Throwable {
    for(Long l : values) {
      System.out.println(l);
    }
  }


DelimiterTransformTest.java
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

<at> RunWith(Cucumber.class)
<at> CucumberOptions(features = {"."},
                 format = {"pretty"},
                 monochrome = true,
                 strict = true)
public class DelimiterTransformTest {
}

Unfortunately this fails with:
java.lang.NumberFormatException: For input string: "1, 3, 5, 7, 11"

It seems I can use <at> Delimiter on its own to get a List<String>, or use LongTransformer to convert a single object. Is it possible to combine them as shown here?

--
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.
Struan Kerr-Liddell | 29 Sep 15:52 2014

[Cucumber] [JS] Cannot attach an image to report

Hi,

I'm trying to attach screenshots to my cucumber reports, but the always seem to be base64 encoded twice. I've raised this issue for it and  <at> simondean, says I should attach a buffer (or presumably a stream) instead of base64 encoding the image myself. But both a buffer and steam get toString called on them, so cannot contain binary data.

Apologies if I'm completely missing something

Struan

--
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.
Stephen Abrams | 27 Sep 01:02 2014
Picon

[Cucumber] Difference between story and feature?

Many times I have a difficult time distinguishing stories from features, and I find many of what I believe to be contradictory explanations of the differences when reading various descriptions of B.D.D. 

I'm hoping that by pointing out one of these seemingly contradictory cases, I can get some resolution.

In Matt Wynne's post describing the difference:


He describes some user stories written in the form:
In order to <blank>
As a <blank>
I want <blank>

And goes on to say that a user story, once implemented, is "absorbed into our features and becomes invisible". 

Now, on the flip side: On the http://cukes.info/ page, we see:

Feature: Addition
In order to...
As a...
I want

Scenario: ...

----------

Given Matt's explanation, why does the feature description look like a story? 

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.
Zain Jamshaid | 26 Sep 13:35 2014
Picon

[Cucumber] How to set the ChromeDriver path on MAC

I have downloaded the Google Chrome binary version(2.9) and placed it under the location

    public String ChromeDriverPath ="//Users//zainbutt//Downloads//chromedriver ";

and then I execute this binary and got the following output:

Starting ChromeDriver (v2.9.248307) on port 9515

But when I try to execute my code..

It throws the exception:

1 Scenarios ( [31m1 failed [0m)
1 Steps ( [31m1 failed [0m)
0m0.120s
code here





cucumber
.runtime.CucumberException: Failed to instantiate class com.PageStepsDefs
    at cucumber
.runtime.java.DefaultJavaObjectFactory.cacheNewInstance(DefaultJavaObjectFactory.java:44)
    at cucumber
.runtime.java.DefaultJavaObjectFactory.getInstance(DefaultJavaObjectFactory.java:30)
    at cucumber
.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:35)
    at cucumber
.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
    at cucumber
.runtime.Runtime.runStep(Runtime.java:298)
    at cucumber
.runtime.model.StepContainer.runStep(StepContainer.java:44)
    at cucumber
.runtime.model.StepContainer.runSteps(StepContainer.java:39)
    at cucumber
.runtime.model.CucumberScenario.run(CucumberScenario.java:48)
    at cucumber
.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
    at cucumber
.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
    at cucumber
.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
    at org
.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org
.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org
.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org
.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org
.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org
.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at cucumber
.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
    at cucumber
.api.junit.Cucumber.runChild(Cucumber.java:89)
    at cucumber
.api.junit.Cucumber.runChild(Cucumber.java:40)
    at org
.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org
.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org
.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org
.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org
.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org
.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at cucumber
.api.junit.Cucumber.run(Cucumber.java:94)
    at org
.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org
.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org
.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org
.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org
.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org
.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.reflect.InvocationTargetException
    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 cucumber
.runtime.java.DefaultJavaObjectFactory.cacheNewInstance(DefaultJavaObjectFactory.java:38)
   
... 32 more
Caused by: java.lang.IllegalStateException: The driver executable does not exist: /Users/zainbutt/Downloads/chromedriver
    at com
.google.common.base.Preconditions.checkState(Preconditions.java:177)
    at org
.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:117)
    at org
.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:112)
    at org
.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:89)
    at org
.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:117)
    at com
.PageStepsDefs.<init>(PageStepsDefs.java:16)
   
... 37 more


Any help will be awesome!!!

--
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.
Christian | 25 Sep 19:10 2014
Picon

[Cucumber] [cucumber-jvm] Is <at> ignore ignored?

Hi all,

The cucumber docs specify that any scenario tagged with <at> ignore should be ignored: https://github.com/cucumber/cucumber/wiki/Tags#special-tags
However, if I try that, cucumber-jvm still runs them.

Why? :)

Or is this one of these odd cases where cucumber-jvm behaves differently?

Brgrds,

Christian

--
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.
Biswajit Samal | 24 Sep 11:08 2014
Picon

[Cucumber] Can not able to run with TestNg + Selenium WebDriver

Respected All,

I am trying to run a small script using TestNg and Cucumber, but unable to do so, Please help me to resolve this. I am new to this cucumber and could not able to figure it out the issue. I have followed the example given in " https://github.com/cucumber/cucumber-jvm/tree/master/examples/java-calculator-testng".

The files are as follows:-

Step -1
public class GoogleStepdef {

private WebDriver driver;

<at> Given("^the page is open \"(.*?)\"$")
public void the_page_is_open(String page) throws Throwable {
// Write code here that turns the phrase above into concrete actions
driver.get(page);
}

<at> When("^I search for \"(.*?)\"$")
public void i_search_for(String search) throws Throwable {
// Write code here that turns the phrase above into concrete actions
WebElement element = driver.findElement(By.name("q"));
element.sendKeys(search);
Thread.sleep(1000);
driver.findElement(By.id("gbqfb")).click();

}

<at> Then("^a browser title should contains \"(.*?)\"$")
public void a_browser_title_should_contains(String contains)
throws Throwable {
// Write code here that turns the phrase above into concrete actions
System.out.println("the title is " + driver.getTitle());
Assert.assertTrue(driver.getTitle().contains(contains));

}

}


step-2

public class RunCukesByCompositionBase {

private WebDriver driver;
<at> BeforeClass
public void setUp(){
System.setProperty("webdriver.chrome.driver", "D:\\BiswajitData\\chromedriver_win32\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
<at> AfterClass
public void tearDown(){
driver.close();
driver.quit();
}

Step-3

<at> CucumberOptions(format = {"pretty", "html:target/cucumber", "json:target/cucumber.json"})
public class RunCukesByCompositionTest extends RunCukesByCompositionBase {
<at> Test(description = "Example of using TestNGCucumberRunner to invoke Cucumber")
public void runCukes() {
new TestNGCucumberRunner(getClass()).runCukes();
}

}


My Feature file is:-

Search.feature
As an user
  I want to search on Google
  So that I can see results

  Scenario: results are shown
    Given the page is open "https://www.google.co.in/"
    When I search for "Cucumber"
    Then a browser title should contains "Google"

While running this I am facing an error only the opening browser is showing, rest of the activity are not happening. Please help me.

--
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.
ashok bakthavathsalam | 24 Sep 07:07 2014
Picon

[Cucumber] [JVM] How to test different implementations using the same feature file

I am new to JVM-Cucumber-Eclipse-Maven on Windows 7. 

I have successfully managed to create calculate.feature (attached), the stepdef file (calculateStepdefs.java) and the implementation (Calculator.java) using jexl from apache.commons. 
The repo is available here - https://github.com/kgashok/cukeJava 

I now desire to test a Tokenizer-version of the Calculator. Towards that intent, I created a new copy of calculate.feature as  tokenCalc.feature (and changed the Feature name) and added it in the same src/test/resource directory in my project.
By selecting the project, I ran "Maven-Update" just to make sure things were in order. When I run the RunCukesTest.java, no new code is generated. 

How do I go about creating and testing my Token-based Calculator? 


--
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.
Attachment (calculate.feature): application/octet-stream, 710 bytes
Attachment (tokenCalc.feature): application/octet-stream, 256 bytes
'Sanda Aitonean' via Cukes | 23 Sep 20:02 2014

[Cucumber] [CPP] how to proceed after having built Cucumber-Cpp sources?

Hello,
 
I am new to the BDD world, want to try-out Cucumber-cpp in an Windows 7 environment, but don’t know how to proceed after having built its sources (how to get to the server needed to be launched in order to run the example features)
 
I understand that: in order to use Cucumber-cpp, first I need to install/build its prerequisites, then build the Cucumber-Cpp sources to a library, and ultimately create my step definition files (C++) and build them against the Cucumber-cpp library. In order to run my feature files, I should be starting a server (is this an executable resulting from the build of Cucumber-cpp sources, or is it something I should be creating myself?) that ‘talks’ to the ruby implementation of Cucumber, allowing it to interpret C++ written steps. (Hope there is some true in the above.)
 
Here’s what I did for the setup so far:

  1. Install Ruby on Windows and the Cucumber gem:
-          rubyinstaller-1.9.3-p545.exe from http://rubyinstaller.org/
-          cucumber gem 1.3.16 and its dependencies –had to install them manually (‘gem install cucumber’ command fails – proxy/firewall prevents downloads) from http://rubygems.org/gems/cucumber. Note: installation of the gherkin gem (dependency) required to install DevKit: DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe, https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
  1. Get Cucumber-cpp sources to c:\Cucumber\cucumber-cpp, from https://github.com/cucumber/cucumber-cppn(cucumber-cpp-master.zip, latest commit 515e398047)
  2. Build Boost sources, version 1.55.0, from http://www.boost.org/
                c:\Boost\boost_1_55_0>bootstrap.bat
                c:\Boost\boost_1_55_0>.\b2 --prefix=C:\Boost --build-type=complete address-model=32 install

     4.       Install Cmake, cmake-2.8.12.2-win32-x86.exe from http://www.cmake.org/cmake/resources/software.html
     5.       Obtain a solution file (.sln) for the cucumber-Cpp library and example
                cd c:\Cucumber\cucumber-cpp
                cmake -E make_directory vsprj
                c:\Cucumber\cucumber-cpp>cmake -E chdir vsprj cmake -G "Visual Studio 11" -DCUKE_ENABLE_EXAMPLES=on -DBOOST_ROOT=c:\Boost . ..

     6.   Build Cucumber-cpp.sln with VisualStudio 2012, after solving some build errors, e.g. 'cannot open include file boost\shared_ptr.hpp' - had to add to the include folders C:\Boost\include\boost-1_55

In order to run the features in the ‘Calculator’ example, I am supposed to start a server which I don’t have (there is no BoostCalculatorSteps.exe in folder vsprj\examples\Calc\Debug).
I read at https://github.com/cucumber/cucumber-cpp/wiki/Primer#compiling-and-running that I would need to configure the wire protocol; where would I have to do that in order to run the Calculator example, and how does that relate to the BoostCalculatorSteps.exe?
 
I would appreciate any help, thanks in advance,
Sanda
 
 
 

--
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.
Carl Youngblood | 23 Sep 19:02 2014
Picon

[Cucumber] Cucumber.js: Can't access world methods in AfterFeatures hook

Wondering if anyone can help me with this:

http://stackoverflow.com/questions/25984786/cant-access-world-methods-in-afterfeatures-hook

It seems strange to me that world can't be accessed from within hooks in cucumber.js. Am I doing something wrong?

Cheers,
Carl Youngblood

--
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