Closed testronic closed 6 years ago
Can you create a sample project and share with us?
Here is the feature file:
@tag Feature: Title of your feature I want to use this template for my feature file
@tag Scenario: Title of your scenario Given I want to write a step with precondition And some other precondition When I complete action And some other action And yet another action Then I validate the outcomes And check more outcomes
@tag
Scenario Outline: Title of your scenario outline
Given I want to write a step with
Examples: | name |value | status | | name1 | 5 | success| | name2 | 7 | Fail |
Here is the step implementation java class:
package outline;
import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When;
public class ReportTest {
@Given("^I want to write a step with precondition$")
public void i_want_to_write_a_step_with_precondition() throws Throwable {
}
@Given("^some other precondition$")
public void some_other_precondition() throws Throwable {
}
@When("^I complete action$")
public void i_complete_action() throws Throwable {
}
@When("^some other action$")
public void some_other_action() throws Throwable {
}
@When("^yet another action$")
public void yet_another_action() throws Throwable {
}
@Then("^I validate the outcomes$")
public void i_validate_the_outcomes() throws Throwable {
}
@Then("^check more outcomes$")
public void check_more_outcomes() throws Throwable {
}
@Given("^I want to write a step with name(\\d+)$")
public void i_want_to_write_a_step_with_name(int arg1) throws Throwable {
}
@When("^I check for the (\\d+) in step$")
public void i_check_for_the_in_step(int arg1) throws Throwable {
}
@Then("^I verify the success in step$")
public void i_verify_the_success_in_step() throws Throwable {
}
@Then("^I verify the Fail in step$")
public void i_verify_the_Fail_in_step() throws Throwable {
}
}
@testronic : This issue should be reported directly to the extent report. However, regarding your 3rd issue that I see the @tag
is tagged in all the levels. So it is as expected.
Kindly re-open in case you need further help.
OK. I think this issue cannot be reported directly to the extent report because it is used not the same way as they recommend. I used the Extent Reports for standard tests (not BDD) with no problem. Unfortunately their documentation for a BDD-style report is very limited and I do not understand how to use it Here is only what they have:
// gherkin classes
// feature
ExtentTest feature = extent.createTest("Refund item");
// scenario
ExtentTest scenario = feature.createNode(Scenario.class, "Jeff returns a faulty microwave");
scenario.createNode(Given.class, "Jeff has bought a microwave for $100").pass("pass");
scenario.createNode(And.class, "he has a receipt").pass("pass");
scenario.createNode(When.class, "he returns the microwave").pass("pass");
scenario.createNode(Then.class, "Jeff should be refunded $100").fail("fail");
Regarding 3rd issue you are maybe right, but why "Title of your feature" is repeated 4 times and "Title of your feature outline" is repeated twice on two lines? it makes absolutely no sense... Any user or a manager would expect to see just a list of executed scenarios. I hope you will be able to fix it...
Please open #1 and #3 in the extent repo, both can be taken up for the upcoming release.
The current version has a number of formatting issues.