BETTERZON-21: Adding Cucumber Framework

This commit is contained in:
Patrick 2020-10-30 13:29:07 +01:00
parent 6ba24ac986
commit 3b606f1156
7 changed files with 107 additions and 0 deletions

1
.gitignore vendored
View File

@ -45,3 +45,4 @@ testem.log
# System Files # System Files
.DS_Store .DS_Store
Thumbs.db Thumbs.db
/CucumberTests/target/

33
CucumberTests/pom.xml Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>de.taskhub</groupId>
<artifactId>CucumberTests</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>2.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>2.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,11 @@
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
features = {"src/test/resource/demo.feature"}
)
public class RunTest {
}

View File

@ -0,0 +1,49 @@
package stepdefs;
import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class DemoDefinitions {
@Given("^I have a configured cucumber-jvm project$")
public void i_have_a_configured_cucumber_jvm_project() throws Exception {
// Write code here that turns the phrase above into concrete actions
//throw new PendingException();
}
@When("^I run it within my IDE$")
public void i_run_it_within_my_IDE() throws Exception {
// Write code here that turns the phrase above into concrete actions
//throw new PendingException();
}
@Then("^I will be able to run connected step definitions$")
public void i_will_be_able_to_run_connected_step_definitions() throws Exception {
// Write code here that turns the phrase above into concrete actions
//throw new PendingException();
}
@When("^the Maker starts a game$")
public void theMakerStartsAGame() {
}
@Then("^the Maker waits for a Breaker to join$")
public void theMakerWaitsForABreakerToJoin() {
}
@Given("^the Maker has started a game with the word \"([^\"]*)\"$")
public void theMakerHasStartedAGameWithTheWord(String arg0) throws Throwable {
// Write code here that turns the phrase above into concrete actions
//throw new PendingException();
}
@When("^the Breaker joins the Maker's game$")
public void theBreakerJoinsTheMakerSGame() {
}
@Then("^the Breaker must guess a word with (\\d+) characters$")
public void theBreakerMustGuessAWordWithCharacters(int arg0) {
}
}

View File

@ -0,0 +1,12 @@
Feature: Guess the word
# The first example has two steps
Scenario: Maker starts a game
When the Maker starts a game
Then the Maker waits for a Breaker to join
# The second example has three steps
Scenario: Breaker joins a game
Given the Maker has started a game with the word "silky"
When the Breaker joins the Maker's game
Then the Breaker must guess a word with 5 characters

1
res/Betterzon.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

BIN
res/Betterzon_3840.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 KiB