Wenxuan Zhou | 21 Aug 18:04 2014
Picon

[Cucumber] [Clojure] Unable to resolve symbol: Given in this context

Hi, I am new to cucumber and have written a cucumber step definition file in Clojure which works fine with its feature file counterpart, and by running "lein cucumber" it outputs what I expected(and Jerkins is also happy about that) . However when I try to compile the step definition file using the "headless REPL" in eclipse, I got an exception:

"Java.lang.RuntimeException: Unable to resolve symbol: Given in this context," 

Which suggested that the definition of cucumber keywords like "Given When and Then" are not found, I did searched in a few sample projects
like https://github.com/nilswloka/cucumber-jvm/blob/new-clojure-example/examples/clojure_cukes/test/features/step_definitions/cuke_steps.clj

However for the "import bit" it has only 

(use 'clojure-cukes.core) (use 'clojure.test)
Which doesn't really have the the definition of those keywords in it. And supposedly I need to find the file which the cucumber keywords are defined. Could anyone give me some pointers on that? Thanks!

Regards,

Wenxuan

--
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.
Remco van Blarcum | 21 Aug 17:29 2014
Picon

[Cucumber] cucumber/ruby output file name w/ time stamp

When I am on the command line and enter the following:

cucumber -p iPad features/Start_een_nieuwe_melding.feature -r features -p html_report --format 'Timestamped::HtmlFormatter' --out test-reports/features-report-` date "+%Y-%m-%d-%H%M%S"`.html

Then the result is a html file which is named: features-report-2014-08-21-171349.html

When i am editing the same command in my cucumber.yml file, there is a complete different output: features-report-`

The contence of my cucumber.yml file:

# config/cucumber.yml

##YAML Template

---

default: --profile html_report 

html_report:  --format html 'Timestamped::HtmlFormatter' --out test-reports/features-report-` date "+%Y-%m-%d-%H%M%S"`.html --format pretty

iPhone: DEVICE=iphone

iPad: DEVICE_TARGET='iPad Retina (64-bit) - Simulator - iOS 7.1'

How do I have to edit this file so i receive the same *.html file as when I entering the code on the command line?



 




--
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.
Maggie Zhou | 19 Aug 23:24 2014
Picon

[Cucumber] How to make the test step log and assert error exception log interactively

I am looking for a way to compile the test step log and the assert error exception output together.


I'd like the assert error exception output is output right after the failed step log, not at the end of running all of scenarios.

+++ Expect output +++
>>>>>>>>>>> REQUEST >>>>>>>>>>>
GET  health_check
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<< RESPONSE <<<<<<<<<<<
Status: HTTP/1.1 201 CREATED
Body: i am alive
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
java.lang.AssertionError: expected:<200> but was:<201>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at org.junit.Assert.assertEquals(Assert.java:542)
at com.ea.easo.ft.IdentityStepDefinitions.the_response_is(IdentityStepDefinitions.java:283)
at ✽.Then the response is "Ok"(com/ea/easo/ft/authentication.feature:15)

>>>>>>>>>>> REQUEST >>>>>>>>>>>
GET  health_check
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<< RESPONSE <<<<<<<<<<<
Status: HTTP/1.1 404 NOT FOUND
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
java.lang.AssertionError: expected:<200> but was:<404>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at org.junit.Assert.assertEquals(Assert.java:542)
at com.ea.easo.ft.IdentityStepDefinitions.the_response_is(IdentityStepDefinitions.java:283)
at ✽.Then the response is "Ok"(com/ea/easo/ft/authentication.feature:15)

2 Scenarios 
2 Steps ()
0m6.880s


+++ Current output +++
>>>>>>>>>>> REQUEST >>>>>>>>>>>
GET  health_check
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<< RESPONSE <<<<<<<<<<<
Status: HTTP/1.1 201 CREATED
Body: i am alive
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>> REQUEST >>>>>>>>>>>
GET  health_check
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<< RESPONSE <<<<<<<<<<<
Status: HTTP/1.1 404 NOT FOUND
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

2 Scenarios 
2 Steps ()
0m6.880s

java.lang.AssertionError: expected:<200> but was:<201>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at org.junit.Assert.assertEquals(Assert.java:542)
at com.ea.easo.ft.IdentityStepDefinitions.the_response_is(IdentityStepDefinitions.java:283)
at ✽.Then the response is "Ok"(com/ea/easo/ft/authentication.feature:15)

java.lang.AssertionError: expected:<200> but was:<404>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at org.junit.Assert.assertEquals(Assert.java:542)
at com.ea.easo.ft.IdentityStepDefinitions.the_response_is(IdentityStepDefinitions.java:283)
at ✽.Then the response is "Ok"(com/ea/easo/ft/authentication.feature:15)

--
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.
Heather Poole | 19 Aug 13:42 2014
Picon

[Cucumber] Cucumber, Capybara and Selenium Webdriver - Cant trigger on click javascript

Good Afternoon,

I  am currently developing a system where the user wanted to be able to associate skills to a role, where they could add multiple skills at once.

I am doing this via dynamic nested forms using cocoon and its finally working after dealing with a  turbo links issue.  However I now want to continue with my cucumber tests.  Having dealt with javascript before I am familiar with the <at> javascript tag so that it will use selenium web driver for the needed tests that use this.

Now when using the 'add skill' function to add another drop down list to add a skill, it works etc in development.  However when running the tests it clicks on the object, but doesn't provide the required affect of triggering the on click adding a nested form.  

Now I am unsure what next to look at, and unsure what code snippets would be useful.  So if you need to see anything just ask and i will put it up asap.  I appreciate any time thinking about this!

Regards,

Heather

--
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.
Stewart Matheson | 19 Aug 05:31 2014
Picon

[Cucumber] Running cucumber in async mode

Hi everyone,

We use cucumber to test a number of web services. Our testing team consists of around 16 testers. We have around 700 scenarios that takes 9 hours to run form start to finish. We are planning to add 400 more which by estimates will bump our run time up to around 16 hours. I would like to reduce this run time by running scenarios or perhaps even features asynchronously.  Options I have considered are...

1. writing a set of batch scripts that can all be run at the same time (the less talked about this the better but it would work with almost no programming)
2. Invoking cukes programmatilly and running them though a thread pool. (We are running jRuby)
3. Invoking cukes programmatilly and running with Celluloid.
4. Using the wire protocol and having different wire servers. Not sure how this would work as the .wire file seems static.

I am prepared to put in some time to contribute to cucumber or a fork of cucumber if there is a feasible solution. Would love to hear all your thoughts on why this is a good / bad idea or even better a solution out there that does this. Thanks in advance for any help / insights.

--
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.
Eswarprasath Jayaraman | 18 Aug 21:41 2014
Picon

[Cucumber] Cucumber-ruby newline parameters behaviour

I came across an issue in cucumber and I am not able to understand the underlying behaviour. It will be really great if some one can help me to understand this.

Issue: Cucumber-ruby (also Cucumber-Jruby) step definition, while matching a parameter containing new line, behaves one way when the parameter is specified in the Scenario's step and in a different way if it is in the example section of a Scenario outline. Please refer to the Scenario Outline and Scenario provided below.

Scenario Outline: new line in scenario outline Given this is also a new line test <line> Examples: | line | | this has\ntest\n | Scenario: new line in scenario Given this is also a new line test this has\ntest\n

Step Definition for both the above scenarios:

Given(/^this is also a new line test ([^"]*)$/) do |line| a = <<'EOC' this has test EOC puts line puts assert_equal(line, a) end

While the first scenario passes the second one fails with the below message:

this has\ntest\n MiniTest::Assertion: <"this has\\ntest\\n"> expected but was <"this has\ntest\n">. ./features/step_definitions/my_steps.rb:61:in `/^this is also a new line test ([^"]*)$/' ./features/myTest.feature:25:in `Given this is also a new line test this has\ntest\n' 1 scenario (1 failed) 1 step (1 failed) 0m0.090s

From what I observed, when the parameter in a cucumber step has \n, then it is converted to '\\n'. This doesn't seem to be the case if the same string is in the Examples section of a Scenario Outline.

Is there a reason, why cucumber (or is it ruby?) interprets newline character differently depending upon the location of the parameter? Am I missing something very obvious here? Any inputs on this is appreciated.

Note: I have found out that using doc string will resolve this issue. But I would like to understand why \n in Scenario Steps behaves differently from Scenario Examples.

Ruby Version: 2.1.1 Cucumber Version : 1.3.15

--
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 | 13 Aug 18:40 2014
Picon

[Cucumber] Cucumber Exception: java.lang.ClassNotFoundException: cucumber.io.ResourceLoader

I am facing an error whenever I run the cucumber test by Junit. Here is the following Exception. Any help will be awesome

NOTE:

THERE IS NO ERROR IN THE PROJECT

java.lang.NoClassDefFoundError: cucumber/io/ResourceLoader



 at java
.lang.Class.getDeclaredConstructors0(Native Method)

 at java
.lang.Class.privateGetDeclaredConstructors(Class.java:2398)

 at java
.lang.Class.getConstructor0(Class.java:2708)

 at java
.lang.Class.getConstructor(Class.java:1659)

 at cucumber
.runtime.Reflections.hasConstructor(Reflections.java:53)

 at cucumber
.runtime.Reflections.instantiateSubclasses(Reflections.java:29)

 at cucumber
.runtime.Runtime.loadBackends(Runtime.java:96)

 at cucumber
.runtime.Runtime.<init>(Runtime.java:63)

 at cucumber
.api.junit.Cucumber.createRuntime(Cucumber.java:74)

 at cucumber
.api.junit.Cucumber.<init>(Cucumber.java:61)

 at sun
.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

 at sun
.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

 at sun
.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

 at java
.lang.reflect.Constructor.newInstance(Constructor.java:513)

 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
.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)

 at org
.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)

 at org
.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)

 at org
.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)

 at org
.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)

 at org
.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

 at org
.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

 at org
.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Caused by: java.lang.ClassNotFoundException: cucumber.io.ResourceLoader

 at java
.net.URLClassLoader$1.run(URLClassLoader.java:202)

 at java
.security.AccessController.doPrivileged(Native Method)

 at java
.net.URLClassLoader.findClass(URLClassLoader.java:190)

 at java
.lang.ClassLoader.loadClass(ClassLoader.java:306)

 at sun
.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

 at java
.lang.ClassLoader.loadClass(ClassLoader.java:247)

 
... 28 more


Here is how my POM.xml looks like:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">



 
<modelVersion>4.0.0</modelVersion>

 
<groupId>Test</groupId>

 
<artifactId>Cucumber</artifactId>

 
<version>0.0.1-SNAPSHOT</version>

<dependencies>

       
<dependency>

           
<groupId>junit</groupId>

           
<artifactId>junit</artifactId>

           
<version>4.11</version>

       
</dependency>




           
<!-- Cucumber -->  

       
<dependency>

           
<groupId>info.cukes</groupId>

           
<artifactId>cucumber-junit</artifactId>

           
<version>1.1.8</version>

       
</dependency>

       
<dependency>

           
<groupId>org.seleniumhq.selenium</groupId>

           
<artifactId>selenium-chrome-driver</artifactId>

           
<version>2.42.2</version>

       
</dependency>

       
<dependency>

           
<groupId>info.cukes</groupId>

           
<artifactId>cucumber-java</artifactId>

           
<version>1.0.0.RC5</version>

           
<scope>test</scope>

       
</dependency>

</dependencies>

</project>


Here is the image of my project structure:


And here is my RunIT.Java Class

package com.Cucumber;






import org.junit.runner.RunWith;




import cucumber.api.CucumberOptions;

import cucumber.api.junit.Cucumber;







<at> RunWith(Cucumber.class)

<at> CucumberOptions(

        tags
={" <at> mysingle"},

        features
= {"."})

public class RunIT {






}



--
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.
Vegard Nyeng | 12 Aug 12:58 2014
Picon

[Cucumber] Create executable JAR in Cucumber/Java project in Intellij/idea

I need to create an executable JAR for my Javabased Cucumber project.

This is my folder structure:

https://imagizer.imageshack.us/v2/229x373q90/674/EiXWux.png

(The Bellyclass in main/java/skeleton is also not used). All the feature steps are in the resources/skeleton folder and all step definitions are under test/java/skeleton

the files that are not displayed are: - gitignore, build.xml, cucumber-java-skeleton.iml, pom.xml and README.md

I've tried to do some research, but struggled finding out what I should include in my pom.xml file. I have currently ran my project using Intellij, but I need to hand it over to someone that can easily run the project on iOS/Mac.

Best regards, V.

--
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.
Aleksandar Kostadinov | 9 Aug 23:05 2014
Picon

[Cucumber] [Ruby] fall into a debugger if a step fails

Hello,

it is very handy while developing or debugging test issues to fall into a debugger if a step fails. It is even more helpful if I am in the current World context. But I can't see a clean way to do so.

The best thing so far I could think of is to create a custom world class that overrides `cucumber_instance_exec()` method to wrap it into a begin/rescue construct. Like

class MyWorld
 
def cucumber_instance_exec(check_arity, pseudo_method, *args, &block)
   
begin
     
super(check_arity, pseudo_method, *args, &block)
   
rescue => e
      binding
.pry
   
end
 
end
end

But it is somehow ugly. Maybe can lead to side effects? And I wont see logger output to know how exactly the step failed.

So I'm looking for a better approach. I'm thinking about creating an additional cucumber hook. This hook will execute after step log is printed to console. And within that hook one can launch a debugger, perform any operations like calling steps and other code, ask cucumber to continue scenario execution as if the step passed.

That would be most straightforward and very valuable I think for a lot of people writing complicated cucumber scenarios. And especially writing scenarios that take 5, 10 or more minutes to fail. Where inserting breakpoints manually will take a lot of time. And also will help with issues that are not always reproducible so one can run a scenario 1000 times and wait until it fails.

But where is decision taken to fail the scenario on failed step? I couldn't find that place.

Thank you,
Aleksandar

--
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.
Jesse Anger | 8 Aug 17:14 2014
Picon

[Cucumber] [Ruby] Help creating a Step Definition which checks for currency format

I have the need for a step that checks the format of currency appearing in an app. I have two types of currency formats in multiple locations I will check. The First is $xxx.xx the other is $xxx - So one with decimal one without. the dollar amount might be anywhere from tens, hundreds to thousands. (xx.xx/xx, xxx.xx/xxx, xxxx.xx/xxxx)

The prices are dynamic and are always changing by the minute so the test needs to only check the format while ignoring the numbers shown. A nice to have would be that it also checks for the presence of a numerical value.

Thank  you to everyone for your assistance in advance.

Best,

--
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.
Kaitlin Smith | 7 Aug 23:02 2014
Picon

[Cucumber] Organizing Steps with Different Platforms

I'm new to Cucumber and I'm currently working on setting up an integration test suite for an application. The application can be used on several platforms (iPhone, iPad, desktop, etc.) and I'd like to write tests covering all of them.

For most of the things a user can do in the app, the flow is the same, but the layout can vary across the different platforms. There are occasions when the flow is different, but I'm fine with writing separate Scenarios for these cases.

I want to make sure that my Steps are as DRY as possible, but I'm having a lot of trouble envisioning how to do that when I need to run the same tests for different platforms. A long time ago we used to have some purely Capybara tests that would run the entire set of tests for one platform and then moving onto the next, iterating through all of the platforms that we support. It worked at the time, but there must be a "nice" way to do this in Cucumber.

Right now I imagine that I would call steps from step definitions, something like this:
Given /^the platform is (.*)$/ do
  steps
%Q{
   
When the user chooses a country
   
And they click the select button
   
...
 
}
end
But I'm not entirely sure how/if this would solve my problem.

Would anyone have any recommendations on how to organize my Steps and Step Definitions? Thanks in advance!

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