This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name := "sample-with-cucumber" | |
version := "1.0-SNAPSHOT" | |
libraryDependencies ++= Seq( | |
javaJdbc, | |
javaEbean, | |
cache | |
"info.cukes" % "cucumber-java" % "1.1.5" % "test", | |
"info.cukes" % "cucumber-junit" % "1.1.5" % "test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Testing Cucumber Integration | |
Scenario: Cucumber Integration | |
Given I have setup Play | |
When I go to the landing page | |
Then the title should be "Cucumber" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cucumber.api.junit.Cucumber; | |
import org.junit.runner.RunWith; | |
@RunWith(Cucumber.class) | |
@Cucumber.Options(format = {"pretty"}) | |
public class RunCucumber { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ play test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
You can implement missing steps with the snippets below: | |
@Given("^I have setup Play$") | |
public void I_have_setup_Play() throws Throwable { | |
// Express the Regexp above with the code you wish you had | |
throw new PendingException(); | |
} | |
@When("^I go to the landing page$") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cucumber.api.java.Before; | |
import play.test.TestBrowser; | |
import play.test.TestServer; | |
import static play.test.Helpers.*; | |
public class GlobalHooks { | |
public static int PORT = 3333; | |
public static TestBrowser TEST_BROWSER; | |
private static TestServer TEST_SERVER; | |
private static boolean initialised = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cucumber.api.java.Before; | |
import play.test.TestBrowser; | |
import play.test.TestServer; | |
import static play.test.Helpers.*; | |
public class GlobalHooks { | |
public static int PORT = 3333; | |
public static TestBrowser TEST_BROWSER; | |
private static TestServer TEST_SERVER; | |
private static boolean initialised = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cucumber.api.java.en.Given; | |
import cucumber.api.java.en.Then; | |
import cucumber.api.java.en.When; | |
import static org.fest.assertions.Assertions.assertThat; | |
public class Steps { | |
@Given("^I have setup Play$") | |
public void I_have_setup_Play() throws Throwable { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
0m[error] Test Scenario: Cucumber Integration failed: expected:<'[Cucumber]'> but was:<'[Welcome to Play]'> | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@(message: String) | |
@main("Cucumber") { | |
@play20.welcome(message, style = "Java") | |
} |