We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am running the serenity using java command (not maven) however, the artefact has the missing index.html
I create a file with the code snippet package demo.report;
import net.thucydides.core.Thucydides; import net.thucydides.core.reports.html.HtmlAggregateStoryReporter;
import java.io.File; import java.io.IOException;
import io.cucumber.plugin.ConcurrentEventListener; import io.cucumber.plugin.event.EventHandler; import io.cucumber.plugin.event.EventPublisher; import io.cucumber.plugin.event.TestRunFinished; import io.cucumber.plugin.event.TestRunStarted;
public class Initialization implements ConcurrentEventListener { private EventHandler setup = event -> { // System.out.println("setup!!"); };
private EventHandler<TestRunFinished> teardown = event -> { File sourceDirectory = new File("target/site/serenity/"); HtmlAggregateStoryReporter reporter = new HtmlAggregateStoryReporter(Thucydides.getDefaultProjectKey()); reporter.setOutputDirectory(sourceDirectory); try { reporter.generateReportsForTestResultsFrom(sourceDirectory); } catch (IOException e) { System.out.println("generateReportsForTestResultsFrom exception "); e.printStackTrace(); } }; @Override public void setEventPublisher(EventPublisher publisher) { publisher.registerHandlerFor(TestRunStarted.class, setup); publisher.registerHandlerFor(TestRunFinished.class, teardown); }
}
and in my Cucumber test runner: package demo;
import io.cucumber.junit.CucumberOptions; import net.serenitybdd.cucumber.CucumberWithSerenity; import org.junit.runner.RunWith; @RunWith(CucumberWithSerenity.class) @CucumberOptions( plugin = {"pretty", "demo.report.Initialization"}, features = "classpath:features", strict = true, snippets = CucumberOptions.SnippetType.CAMELCASE ) public class CucumberTestSuite {
in the java command
but artefact didn't generate any serenity report, that is the target/site/serenity is not even generated
is there a system system properties that I can set to achieve mvn serenity:aggregrate?
The text was updated successfully, but these errors were encountered:
It's doable but you would need to look at the internal Serenity APIs to find a way. Why don't you just use maven or gradle?
Sorry, something went wrong.
@LayMui
Here is what I use:
private static ResultChecker generateHtmlStoryReports() throws IOException { HtmlAggregateStoryReporter htmlAggregateStoryReporter = new HtmlAggregateStoryReporter("reportName"); htmlAggregateStoryReporter.setSourceDirectory(new File("build/site/report")); htmlAggregateStoryReporter.setOutputDirectory(new File("build/site/report")); htmlAggregateStoryReporter.generateReportsForTestResultsFrom(new File("build/site/report")); return new ResultChecker(htmlAggregateStoryReporter.getOutputDirectory()); }
No branches or pull requests
I am running the serenity using java command (not maven)
however, the artefact has the missing index.html
I create a file with the code snippet
package demo.report;
import net.thucydides.core.Thucydides;
import net.thucydides.core.reports.html.HtmlAggregateStoryReporter;
import java.io.File;
import java.io.IOException;
import io.cucumber.plugin.ConcurrentEventListener;
import io.cucumber.plugin.event.EventHandler;
import io.cucumber.plugin.event.EventPublisher;
import io.cucumber.plugin.event.TestRunFinished;
import io.cucumber.plugin.event.TestRunStarted;
public class Initialization implements ConcurrentEventListener {
private EventHandler setup = event -> {
// System.out.println("setup!!");
};
}
and in my Cucumber test runner:
package demo;
import io.cucumber.junit.CucumberOptions;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
plugin = {"pretty", "demo.report.Initialization"},
features = "classpath:features",
strict = true,
snippets = CucumberOptions.SnippetType.CAMELCASE
)
public class CucumberTestSuite {
}
in the java command
but artefact didn't generate any serenity report, that is the target/site/serenity is not even generated
is there a system system properties that I can set to achieve mvn serenity:aggregrate?
The text was updated successfully, but these errors were encountered: