From 9bb570b0c3f11a87851ac198e2c4538657a9eeb4 Mon Sep 17 00:00:00 2001 From: Dipanjan Bhowmik Date: Mon, 11 Oct 2021 11:12:27 +0530 Subject: [PATCH] Updated README --- Java-Cucumber/README.md | 42 +++++------------------------------------ 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/Java-Cucumber/README.md b/Java-Cucumber/README.md index 33ac0ff9..24d68214 100644 --- a/Java-Cucumber/README.md +++ b/Java-Cucumber/README.md @@ -1,39 +1,7 @@ -Added cucumber for running the tests and -added the lines written in the specification as is in this. +### How to do the BDD -The cucumber feature file example is somewhat like: +1. Write a test scenario in Feature file: **src/test/resources/GildedRose.feature** +2. Modify the StepDefinitions file to match the Feature description in: **src/test/java/com/gildedrose/StepDefinitions.java** +3. Run: **./gradlew cucumber** from project dir -**src/test/resources/GildedRose.feature** -```gherkin -Feature: Gilded Rose quality - I want to know if the quality is updated properly - - Scenario: Sellin and Quality decreasing - Given for "+5 Dexterity Vest" initial sellin is 20 and quality is 30 - When I update the quality - Then I should get sellin as 19 and quality as 29 - ... -``` - -And the result is shown as: - -``` -$ ./gradlew cucumber - -> Task :cucumber - -Scenario: Sellin and Quality decreasing # src/test/resources/GildedRose.feature:4 - Given for "+5 Dexterity Vest" initial sellin is 20 and quality is 30 # com.gildedrose.StepDefinitions.initial_sellin_is_and_quality_is(java.lang.String,int,int) - When I update the quality # com.gildedrose.StepDefinitions.i_update_the_quality() - Then I should get sellin as 19 and quality as 29 # com.gildedrose.StepDefinitions.i_should_get_sellin_as_and_quality_as(int,int) - -1 Scenarios (1 passed) -3 Steps (3 passed) -0m0.376s - - - -BUILD SUCCESSFUL in 2s -``` - -Note: If you want to decrease update the quality twice, just repeat the line "When I update the quality" twice in the feature file. +Note: Please check https://cucumber.io for syntax references. \ No newline at end of file