Search in sources :

Example 6 with Step

use of com.trivago.rta.vo.Step in project cucable-plugin by trivago.

the class FeatureFileContentRendererTest method formatDataTableStringTest.

@Test
public void formatDataTableStringTest() {
    String expectedOutput = "Feature: featureName\n" + "featureDescription\n" + "\n" + "Scenario: scenarioName\n" + "scenarioDescription\n" + "\n" + "Step 1\n" + "|cell11|cell12|cell13|\n" + "|cell21|cell22|cell23|\n" + "\n# Source feature: TESTPATH\n" + "# Generated by Cucable\n";
    String featureName = "Feature: featureName";
    String featureLanguage = "";
    String featureDescription = "featureDescription";
    String scenarioName = "Scenario: scenarioName";
    String scenarioDescription = "scenarioDescription";
    DataTable dataTable = new DataTable();
    dataTable.addRow(Arrays.asList("cell11", "cell12", "cell13"));
    dataTable.addRow(Arrays.asList("cell21", "cell22", "cell23"));
    List<Step> steps = Collections.singletonList(new Step("Step 1", dataTable, null));
    String featureFilePath = "TESTPATH";
    SingleScenario singleScenario = new SingleScenario(featureName, featureFilePath, featureLanguage, featureDescription, scenarioName, scenarioDescription, new ArrayList<>(), new ArrayList<>());
    singleScenario.setSteps(steps);
    String renderedFeatureFileContent = featureFileContentRenderer.getRenderedFeatureFileContent(singleScenario);
    assertThat(renderedFeatureFileContent, is(expectedOutput));
}
Also used : DataTable(com.trivago.rta.vo.DataTable) SingleScenario(com.trivago.rta.vo.SingleScenario) Step(com.trivago.rta.vo.Step) Test(org.junit.Test)

Example 7 with Step

use of com.trivago.rta.vo.Step in project cucable-plugin by trivago.

the class FeatureFileContentRendererTest method getRenderedFeatureFileContentTest.

@Test
public void getRenderedFeatureFileContentTest() {
    String expectedOutput = "@featureTag1\n" + "@featureTag2\n" + "Feature: featureName\n" + "featureDescription\n" + "\n" + "@scenarioTag1\n" + "@scenarioTag2\n" + "Scenario: scenarioName\n" + "scenarioDescription\n" + "\n" + "Step 1\n" + "Step 2\n" + "\n# Source feature: TESTPATH\n" + "# Generated by Cucable\n";
    String featureName = "Feature: featureName";
    String featureDescription = "featureDescription";
    String featureLanguage = "";
    List<String> featureTags = Arrays.asList("@featureTag1", "@featureTag2");
    String scenarioName = "Scenario: scenarioName";
    String scenarioDescription = "scenarioDescription";
    List<Step> backgroundSteps = Arrays.asList(new Step("Step 1", null, null), new Step("Step 2", null, null));
    List<String> scenarioTags = Arrays.asList("@scenarioTag1", "@scenarioTag2");
    String featureFilePath = "TESTPATH";
    SingleScenario singleScenario = new SingleScenario(featureName, featureFilePath, featureLanguage, featureDescription, scenarioName, scenarioDescription, featureTags, backgroundSteps);
    singleScenario.setScenarioTags(scenarioTags);
    String renderedFeatureFileContent = featureFileContentRenderer.getRenderedFeatureFileContent(singleScenario);
    assertThat(renderedFeatureFileContent, is(expectedOutput));
}
Also used : SingleScenario(com.trivago.rta.vo.SingleScenario) Step(com.trivago.rta.vo.Step) Test(org.junit.Test)

Aggregations

Step (com.trivago.rta.vo.Step)7 SingleScenario (com.trivago.rta.vo.SingleScenario)5 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 DataTable (com.trivago.rta.vo.DataTable)2 CucablePluginException (com.trivago.rta.exceptions.CucablePluginException)1 Background (gherkin.ast.Background)1 Examples (gherkin.ast.Examples)1 Feature (gherkin.ast.Feature)1 GherkinDocument (gherkin.ast.GherkinDocument)1 Scenario (gherkin.ast.Scenario)1 ScenarioDefinition (gherkin.ast.ScenarioDefinition)1 ScenarioOutline (gherkin.ast.ScenarioOutline)1 List (java.util.List)1