Marcel Overdijk | 31 Oct 21:32 2014
Picon

[Cucumber] [Java, Spring] How to junit test custom stepdefs classes

I'm writing a public library containing Cucumber stepdefs.
Those <at> Given <at> When <at> Then stepdefs interact with objects shared between classes (using the cucumber-spring module).

As any good library I want to write junit test for my stepdef classes.
Are there any examples or best practices to unit test my stepdefs?

Basically I want to test the regexp's in the <at> Given <at> When <at> Then annotations and that the actual code is being executed.

Any help appreciated.


Marcel 

--
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.
Srisowrabha Kumar | 31 Oct 08:32 2014
Picon

[Cucumber] Unable to find cucumber annotations

Hi All,

I'm new to Cucumber and this group ;). Currently working on learning Cucumber for test automation on Selenium on Java. I have query with regards to importing cucumber annotations. Below is the POM and i'm unable to use annotations. Please help. Please point out any issue :)

<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>org.xxxx.cucumber</groupId>
  <artifactId>xxxx</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <dependencies>
      <dependency>
          <groupId>org.seleniumhq.selenium</groupId>
         <artifactId>selenium-java</artifactId>
         <version>2.43.1</version>
      </dependency>
      <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>1.1.8</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.1.8</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.1.8</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.4</version>
    </dependency>
  </dependencies>
</project>

Using Ctrl+Space isn't giving any suggestions in my step definition file. However, able to import cucumber.* or cucumber.api.*

Thanks in advance

Sowrabha

--
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.
aslak hellesoy | 30 Oct 14:53 2014
Picon

[Cucumber] [ANN] Cucumber-JVM 1.2.0

I'm pleased to annouce Cucumber-JVM 1.2.0!

This release contains 30 bugfixes and improvements. I have decided to bump the minor version number from 1.1 to 1.2 since there are some minor backwards incompatible changes. I don't think any of them are big enough to warrant a major release bump to 2.0.

I'd like to thank everyone who has contributed to this release - keep those great pull requests coming!


Cheers,
Aslak

--
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.
Andrew Premdas | 30 Oct 12:32 2014
Picon

[Cucumber] [ruby] Pollution of global namespace - no more?

It looks like defining methods in step definitions (without wrapping them in a module and adding that module to world) no longer pollutes the global namespace. Is there any reason for still using modules and adding them to World?

Cheers

Andrew

--
------------------------
Andrew Premdas

--
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.
renan.michaud | 29 Oct 15:13 2014
Picon

[Cucumber] [JVM] Datatables and transform

Hello,

i tried to use a Scenario Outline with Examples, and i need to apply a transformation the generated DataTables (data type convertion and mapping with data technical ids from an external placeholder).

According to the documentation (https://github.com/cucumber/cucumber/wiki/Step-Argument-Transforms), it seems possible in Ruby :
Transform /^table:user,followers$/ do |table| table.map_headers! {|header| header.downcase.to_sym } table.map_column!(:user) {|user| User.find_by_name(user) } table.map_column!(:followers) {|count| count.to_i } table end
I wasn't able to find a way to do it in Groovy. Is there any?

Thanks.

--
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.
Gabriel Klappenbach | 29 Oct 14:52 2014
Picon

[Cucumber] [JVM] Need to match your specification against an Enum? Try <at> GenerateCucumberString!

Just thought I'd share an annotation I wrote and open sourced.
It let's me annotate an enum class, and then match a specification against it.

For example:
Given a customer selects the service LAN BROADBAND 100 100 and clicks submit

Here, the "service" is actually matched against the enum:

<at> GenerateCucumberString
public enum BroadbandService implements Service {
    LAN_BROADBAND_100_100("L100BB100"),
    COAX_BROADBAND_50_50("C50BB50"),
    COAX_BROADBAND_250_10("C250BB10"),
    ;
    private final String serviceId;
    BroadbandService(String serviceId) {
        this.serviceId = serviceId;
    }
    <at> Override
    public String getServiceId() {
        return serviceId;
    }
}

If this seems useful to you too, you can read more on
https://github.com/ComHem/EnumToStringForCucumber

Available in the Maven Central Repository.



Cheers,
Gabriel Klappenbach

--
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.
Mrunal Parikh | 27 Oct 23:57 2014
Picon

[Cucumber] Share common cucumber steps files and common page objects between separate application projects

Has anybody found out a way to do this?
Basically I am looking to share common steps and page objects between different projects/applications. Is there a way to do that?

Thanks
Mrunal

--
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.
David García | 27 Oct 17:19 2014
Picon

[Cucumber] Problems with namespaces inside World

I wanted to use Cucumber + Capybara together with Calabash in a project where we test both an Android app and a web app. I'm having some problems because some methods loaded in the World have the same name. For instance, 'page' or 'click_button' are both defined in Calabash and Capybara, so if I do page.visit for capybara, the method from calabash is called. I understand that this setup is quite concrete, but I guess this can happen to other people that want to use different gems inside the World.

Is there any solution or workaround for that? I could use for instance Capybara.current_session.visit instead of simply 'visit', but given that the steps and helpers used for capybara and calabash are separated, I would like a cleaner solution, so Capybara modules cannot see methods from Calabash.

--
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.
Javix | 26 Oct 00:01 2014
Picon

[Cucumber] [JVM]Scenario Outline to test different regular expressions

I met with a strange behaviour of generating steps when running the following scenario to test a Regex:


Scenario Outline: Assign the matched group values
    Given the following <group>
    When it match to the <pattern>
    Then the <attribute> should have the <value> set up

    Examples:
    |     group            |   pattern          |   attribute   |   value       |
    | [META]-              | (\\[\w+\\]-?)    |     meta      |   toto          |

When running 'mV clean test' I got the following steps code proposal:

You can implement missing steps with the snippets below:


<at> Given("^the following \\[META\\]-$")

public void the_following_META() throws Throwable {

    // Write code here that turns the phrase above into concrete actions

    throw new PendingException();

}


<at> When("^it match to the \\(\\\\[\\w\\+\\\\]-\\?\\)$")

public void it_match_to_the_w() throws Throwable {

    // Write code here that turns the phrase above into concrete actions

    throw new PendingException();

}


<at> Then("^the meta should have the toto set up$")

public void the_meta_should_have_the_toto_set_up() throws Throwable {

    // Write code here that turns the phrase above into concrete actions

    throw new PendingException();

}


Is it normal those 'strange' methods names, especially when they are coupled to each table value ? Or I missed something ?

Reproduced at 
OS Yosemite 10.10
JDK 1.7
cucumber 1.1.7

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.
John Smart | 24 Oct 22:00 2014

[Cucumber] Thucydides/Cucumber integration

Hi all,

We have been working on integrating Cucumber-JVM with Thucydides for a few months now, but we need a minor enhancement to be integrated into the Cucumber-JVM code base for it to work properly (see https://github.com/cucumber/cucumber-jvm/pull/765). Is there any way we could fast-track this change into the next release?

Thanks

John Smart
Lead Developer, Thucydides.


--
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.
Marcel Overdijk | 24 Oct 16:51 2014
Picon

[Cucumber] [Spring] Sharing MockMvc ResultActions between stepdef classes

In https://github.com/cucumber/cucumber-jvm/blob/master/examples/spring-txn/src/test/java/cucumber/examples/spring/txn/SeeMessagesStepdefs.java I can see the MockMvc instance is shared between various stepdef classes via <at> Autowire

I would also like to share the ResultActions (retrieved after mockMvc.perform(..)) between different stepdef classes.

I think the best way to do this is to introduce some MockMvcContext class that I will autowire in my stepdef classes.

This Context class will contain a instance ResultAction which can than be set/retrieved by stepdef classes that need it.


Would this be the best approach, or is there some other way to this?



Br,
Marcel

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