gherkin.formatter.model.ScenarioOutline Java Examples

The following examples show how to use gherkin.formatter.model.ScenarioOutline. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GherkinKeyWordProvider.java    From xframium-java with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void scenarioOutline(ScenarioOutline xTest) {
	currentSection = Section.OUTLINE;
       String tagNames = null;
       if ( xTest.getTags() != null && !xTest.getTags().isEmpty() )
       {
           tagNames = "";
           for ( Tag tagName : xTest.getTags() )
               tagNames = tagNames + tagName.getName() + ",";
           
           tagNames = tagNames.substring( 0, tagNames.length() - 1 );
       }
       
       this.currentScenario = new KeyWordTest( xTest.getName(), true, null, xTest.getName(), false, null, null, 0, xTest.getDescription(), tagNames, null, null, null, 0, null, null, null, null, 0, 0, TRACE.OFF.name() );

       for ( KeyWordStep xStep : backgroundSteps )
           this.currentScenario.addStep( xStep );
       
       log.info( "Adding " + xTest.getName() );
       scenarioList.add( currentScenario );
	
}
 
Example #2
Source File: XMLFormatter.java    From xframium-java with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void scenarioOutline( ScenarioOutline xTest )
{
    
    currentSection = Section.OUTLINE;
    String tagNames = null;
    if ( xTest.getTags() != null && !xTest.getTags().isEmpty() )
    {
        tagNames = "";
        for ( Tag tagName : xTest.getTags() )
            tagNames = tagNames + tagName.getName() + ",";
        
        tagNames = tagNames.substring( 0, tagNames.length() - 1 );
    }
    
    this.currentScenario = new KeyWordTest( xTest.getName(), true, null, xTest.getName(), false, null, null, 0, xTest.getDescription(), tagNames, null, null, configProperties, 0, null, null, null, null, 0, 0, TRACE.OFF.name() );

    for ( KeyWordStep xStep : backgroundSteps )
        this.currentScenario.addStep( xStep );

    scenarioList.add( currentScenario );
}
 
Example #3
Source File: AllureRunListener.java    From allure-cucumberjvm with Apache License 2.0 5 votes vote down vote up
/**
 * Find feature and story for given scenario
 *
 * @param scenarioName
 * @return {@link String[]} of ["<FEATURE_NAME>", "<STORY_NAME>"]s
 * @throws IllegalAccessException
 */
private String[] findFeatureByScenarioName(String scenarioName) throws IllegalAccessException {
    List<Description> testClasses = findTestClassesLevel(parentDescription.getChildren());

    for (Description testClass : testClasses) {

        List<Description> features = findFeaturesLevel(testClass.getChildren());
        //Feature cycle
        for (Description feature : features) {
            //Story cycle
            for (Description story : feature.getChildren()) {
                Object scenarioType = getTestEntityType(story);

                //Scenario
                if (scenarioType instanceof Scenario
                        && story.getDisplayName().equals(scenarioName)) {
                    return new String[]{feature.getDisplayName(), scenarioName};

                    //Scenario Outline
                } else if (scenarioType instanceof ScenarioOutline) {
                    List<Description> examples = story.getChildren().get(0).getChildren();
                    // we need to go deeper :)
                    for (Description example : examples) {
                        if (example.getDisplayName().equals(scenarioName)) {
                            return new String[]{feature.getDisplayName(), story.getDisplayName()};
                        }
                    }
                }
            }
        }
    }
    return new String[]{"Feature: Undefined Feature", scenarioName};
}
 
Example #4
Source File: AllureCucumberJvm.java    From allure-java with Apache License 2.0 4 votes vote down vote up
@Override
public void scenarioOutline(final ScenarioOutline so) {
    //Nothing to do with Allure
}
 
Example #5
Source File: WrappedJSONFormatter.java    From senbot with MIT License 4 votes vote down vote up
@Override
public void scenarioOutline(ScenarioOutline arg0) {
	wrapped.scenarioOutline(arg0);
}
 
Example #6
Source File: ParameterizedCucumber.java    From senbot with MIT License 4 votes vote down vote up
@Override
public void scenarioOutline(ScenarioOutline arg0) {
	getWrapped().scenarioOutline(arg0);
	
}