@Override public void beforeExamples(List<String> steps, ExamplesTable table) { logger.debug("beforeExamples {} {}", steps, table); if (givenStoryMonitor.isInGivenStory()) { return; } exampleCount = 0; StepEventBus.getEventBus().useExamplesFrom(serenityTableFrom(table)); }
public void beforeExamples(List<String> steps, ExamplesTable table) { exampleCount = 0; exampleData = ImmutableList.copyOf(table.getRows()); StepEventBus.getEventBus().useExamplesFrom(thucydidesTableFrom(table)); }
@SuppressWarnings("unchecked") public <T> T run(final T steps) throws IOException { useDefaultStepFactoryIfUnassigned(); StepEventBus.getEventBus().useExamplesFrom(dataTable(testdata)); Class<?> scenarioStepsClass = steps.getClass().getSuperclass(); List<T> instanciatedSteps = (List<T>) testdata.getInstanciatedInstancesFrom(scenarioStepsClass, factory); DataDrivenStepFactory dataDrivenStepFactory = new DataDrivenStepFactory(factory); T stepsProxy = (T) dataDrivenStepFactory.newDataDrivenSteps(scenarioStepsClass, instanciatedSteps); return stepsProxy; }
@SuppressWarnings("unchecked") public <T> T run(final T steps) throws IOException { useDefaultStepFactoryIfUnassigned(); TestDataSource testdata = new CSVTestDataSource(testDataSource, separator); StepEventBus.getEventBus().useExamplesFrom(dataTable(testdata)); Class<?> scenarioStepsClass = steps.getClass().getSuperclass(); List<T> instanciatedSteps = (List<T>) testdata.getInstanciatedInstancesFrom(scenarioStepsClass, factory); DataDrivenStepFactory dataDrivenStepFactory = new DataDrivenStepFactory(factory); T stepsProxy = (T) dataDrivenStepFactory.newDataDrivenSteps(scenarioStepsClass, instanciatedSteps); return stepsProxy; }
@SuppressWarnings("unchecked") public <T> T run(final T steps) throws IOException { useDefaultStepFactoryIfUnassigned(); TestDataSource testdata = new CSVTestDataSource(testDataSource, separator); StepEventBus.getEventBus().useExamplesFrom(dataTable(testdata)); Class<?> scenarioStepsClass = steps.getClass().getSuperclass(); List<T> instanciatedSteps = (List<T>) testdata.getInstanciatedInstancesFrom(scenarioStepsClass, factory); DataDrivenStepFactory dataDrivenStepFactory = new DataDrivenStepFactory(factory); T stepsProxy = (T) dataDrivenStepFactory.newDataDrivenSteps(scenarioStepsClass, instanciatedSteps); return stepsProxy; }
public void start() { DataTable table = DataTable.withHeaders(this.headers) .andTitle(this.title).build(); StepEventBus.getEventBus().useExamplesFrom(table); StepEventBus.getEventBus().enableSoftAsserts(); TestLifecycleEvents.register(this); }
@Override public void testStarted(final Description description) { if (testingThisDataSet(description)) { super.testStarted(description); StepEventBus.getEventBus().useExamplesFrom(dataTableRow()); //StepEventBus.getEventBus().useExamplesFrom(dataTable()); if (!ignoredOrPending(description)) StepEventBus.getEventBus().exampleStarted(parametersTable.row(parameterSetNumber).toStringMap()); } }
private void startOfScenarioLifeCycle(Feature feature, String scenarioName, ScenarioDefinition scenario, Integer currentLine) { boolean newScenario = !scenarioIdFrom(TestSourcesModel.convertToId(feature.getName()), TestSourcesModel.convertToId(scenario.getName())).equals(currentScenario); currentScenario = scenarioIdFrom(TestSourcesModel.convertToId(feature.getName()), TestSourcesModel.convertToId(scenario.getName())); if (examplesRunning) { if (newScenario) { startScenario(feature, scenario, scenarioName); getStepEventBus(currentFeaturePath()).useExamplesFrom(table); getStepEventBus(currentFeaturePath()).useScenarioOutline(ScenarioOutlineDescription.from(scenario).getDescription()); } else { getStepEventBus(currentFeaturePath()).addNewExamplesFrom(table); } startExample(currentLine); } else { startScenario(feature, scenario, scenarioName); } }
private void startOfScenarioLifeCycle(Feature feature, String scenarioName, ScenarioDefinition scenario, Integer currentLine) { boolean newScenario = !scenarioIdFrom(TestSourcesModel.convertToId(feature.getName()), TestSourcesModel.convertToId(scenario.getName())).equals(currentScenario); currentScenario = scenarioIdFrom(TestSourcesModel.convertToId(feature.getName()), TestSourcesModel.convertToId(scenario.getName())); if (examplesRunning) { if (newScenario) { startScenario(feature, scenario, scenarioName); getStepEventBus(currentFeaturePath()).useExamplesFrom(table); getStepEventBus(currentFeaturePath()).useScenarioOutline(ScenarioOutlineDescription.from(scenario).getDescription()); } else { getStepEventBus(currentFeaturePath()).addNewExamplesFrom(table); } startExample(currentLine); } else { startScenario(feature, scenario, scenarioName); } }