Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 readme
Octocat-spinner-32 src
Octocat-spinner-32 .classpath
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 pom.xml
Octocat-spinner-32 reports
README.md

bdd-sample-cucumber-jvm

This is a sample project of cucumber-jvm.
See Cucumber project page.

Install Cucumber-jvm

Maven installation

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
    <version>4.10</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>1.0.11</version>
</dependency>
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-junit</artifactId>
    <version>1.0.11</version>
</dependency>

Describe Scenario File

Feature: ユーザModels

Scenario: ユーザ名を指定して登録する
    Given   ユーザ名 'tajima'
    When    ユーザを登録する
    Then    ユーザ名のみのオブジェクトが登録されること
        """
        {"name":"tajima","projects":[]}
        """

sample

sample described in japanese

Compile Scenario File

  • To run the .feature using a JUnit Runner, create a blank test class.

    package sample.test;
    
    import org.junit.runner.RunWith;
    
    import cucumber.junit.Cucumber;
    
    @RunWith(Cucumber.class)
    @Cucumber.Options(format = { "pretty", "html:target/cucumber" })
    public class RunTests {
    
    }
    
  • Run Junit test, and Take a look at the output in the Console Tab in Eclipse.

    You can implement missing steps with the snippets below:
    
    @Given("^ユーザ名 'tajima'$")
    public void ユーザ名_tajima() throws Throwable {
        // Express the Regexp above with the code you wish you had
        throw new PendingException();
    }
    
    @When("^ユーザを登録する$")
    public void ユーザを登録する() throws Throwable {
        // Express the Regexp above with the code you wish you had
        throw new PendingException();
    }
    
    @Then("^ユーザ名のみのオブジェクトが登録されること$")
    public void ユーザ名のみのオブジェクトが登録されること(String arg1) throws Throwable {
        // Express the Regexp above with the code you wish you had
        throw new PendingException();
    }
    

Describe code

JUnit

image

HTML Report

image2

TODO jenkins-cucumber-jvm-reports-plugin

Something went wrong with that request. Please try again.