com.automationrockstars.bmo.junit.BddBridge Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2015, 2016 Automation RockStars Ltd.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0
* which accompanies this distribution, and is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Contributors:
* Automation RockStars - initial API and implementation
*******************************************************************************/
package com.automationrockstars.bmo.junit;
import static com.automationrockstars.bmo.JBehaveRunner.deleteTransformedFiles;
import static com.automationrockstars.bmo.JBehaveRunner.embedder;
import static com.automationrockstars.bmo.JBehaveRunner.getFeatures;
import static com.automationrockstars.bmo.JBehaveRunner.transformData;
import java.util.List;
import org.jbehave.core.junit.JUnitStories;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import com.automationrockstars.bmo.AllureStoryReporter;
import de.codecentric.jbehave.junit.monitoring.JUnitReportingRunner;
/**
* Extend this class to execute BDD scripts as JUnit tests
* Please use the code below to finish execution
*
*
*
* {@literal: @}Override
* protected List<String> storyPaths() {
* return super.features();
* }
*
*
*/
@RunWith(JUnitReportingRunner.class)
public abstract class BddBridge extends JUnitStories{
@BeforeClass
public static void prepareData(){
transformData();
}
@AfterClass
public static void cleanUp(){
deleteTransformedFiles();
AllureStoryReporter.generateReport();
}
public BddBridge() {
super();
super.useEmbedder(embedder());
super.useConfiguration(embedder().configuration());
super.useStepsFactory(embedder().stepsFactory());
JUnitReportingRunner.recommandedControls(embedder())
.doIgnoreFailureInStories(false)
.doIgnoreFailureInView(false)
.doVerboseFailures(true)
.doSkip(true);
}
/**
* Method scanning for BDD scripts and providing it for execution
* @return BDD script files
*/
public List features(){
return getFeatures();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy