Created
September 18, 2025 08:51
-
-
Save bartekpacia/79e7a61788b8914a46a02c04126aa3fd to your computer and use it in GitHub Desktop.
Cucumber demo
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
| package demo; | |
| import io.cucumber.java.ParameterType; | |
| import io.cucumber.java.en.Given; | |
| import io.cucumber.java.en.Then; | |
| import io.cucumber.java.en.When; | |
| import io.cucumber.java8.En; | |
| public class Steps implements En { | |
| @Given("I am hungry") | |
| public void i_am_hungry() { | |
| } | |
| @Then("I am not hungry") | |
| public void i_am_not_hungry() { | |
| } | |
| @When("I eat a cake") | |
| public void i_eat_a_cake() { | |
| } | |
| @ParameterType("red|green|blue") | |
| public String color(String colorStr) { | |
| return colorStr; | |
| } | |
| @Given("another thing should happen") | |
| public void anotherThingHappens() { | |
| } | |
| } |
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
| # language: en | |
| Feature: Cake consumption | |
| Scenario: Eating cake | |
| Given I am hungry | |
| When I eat a cake | |
| Then I am not hungry | |
| Scenario: Eating cake | |
| Given I am hungry | |
| When I eat a cake | |
| Then I am hungry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment