Anyone could you please suggest me, In Cucumber options by using 'plugin' or 'format'. How to create a separate test result folder for every run we do.
As the below line of code creates the common folder for result and the results which are currently present will be replaced with the new results/reports if we run the script. So I want new folder to be created with date and time for every run for the results to be stored.
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resources/feature/",
tags="@AppLaunch",
glue = "com.org.frameworkFiles.stepDefinitions",
plugin = {"pretty", "html:target/site/cucumber-pretty1","html:target/Masterthought"},
monochrome = true,
dryRun = true)
It doesn't work like that. Using the @RunWith(Cucumber.class)
annotation allows JUnit to run the cucumber scenarios like if they were regular unit tests.
Assuming you're using Maven, test results end up in a module's target directory which is deleted and recreated on every clean build.
What are you trying to achieve by creating separate report folders in the target directory? Test results will be the same for each run unless sources are changed, but that requires a new build and thereby deleting all the reports.