@Given("the numbers: $numbersTable") public void theNumbers(ExamplesTable numbersTable) { List numbers = new ArrayList(); for (Map<String,String> row : numbersTable.getRows()) { String combination = row.get("combinations"); numbers.add(combination); } }
private DataTable thucydidesTableFrom(ExamplesTable table) { return DataTable.withHeaders(table.getHeaders()).andMappedRows(table.getRows()).build(); }
@Given("that I sell the following fruit $exampleTable") public void thatISellTheFollowingFruit(ExamplesTable exampleTable) { System.out.println("MyTable: "+exampleTable.asString()); }
private boolean isParameterized(Scenario scenario) { ExamplesTable examplesTable = scenario.getExamplesTable(); boolean isParameterized1 = examplesTable != null && examplesTable.getRowCount() > 0; return isParameterized1; }
@AsParameterConverter public ExamplesTable getTableValueIfVariable(String variable) { String tableWithSubstitutedVariables = SessionVariablesUtils .substituteVariableByValue(variable); return new ExamplesTable(tableWithSubstitutedVariables); }
@Given("data insert in DemoSheet $parameterTable") public void setDataToSheet(ExamplesTable parametersTable) throws RowsExceededException, WriteException, IOException { List<String> demonum = new ArrayList<String>(); List<String> demoname = new ArrayList<String>(); for (Map<String, String> row : parametersTable.getRows()) { Iterator it = row.entrySet().iterator(); while (it.hasNext()) { Map.Entry pairs = (Map.Entry) it.next(); if (pairs.getKey().equals("demoNumber")) { demonum.add((String) pairs.getValue()); } else if (pairs.getKey().equals("demoName")) { demoname.add((String) pairs.getValue()); } } } for(String s:demonum) { System.out.println(s.getDemonum); System.out.println(s.getDemoname); } }
private DataTable serenityTableFrom(ExamplesTable table) { String scenarioOutline = scenarioOutlineFrom(currentScenario()); return DataTable.withHeaders(table.getHeaders()) .andScenarioOutline(scenarioOutline) .andMappedRows(table.getRows()) .build(); }
@When("informo: $table") @Given("informo: $table") public void setDataProvideTable(ExamplesTable table) { for (Map<String, String> row : table.getRows()) { Iterator<String> it = row.keySet().iterator(); while (it.hasNext()) { String key = it.next(); setDataProvider(key, row.get(key)); } } }
@When("informo o campo: $table") @Alias("informo os campos: $table") public void informFields(ExamplesTable table) { for (Map<String, String> row : table.getRows()) { Iterator<String> it = row.keySet().iterator(); while (it.hasNext()) { String key = it.next(); inform(row.get(key), key); } } }
public void beforeExamples(List<String> steps, ExamplesTable table) { exampleCount = 0; exampleData = ImmutableList.copyOf(table.getRows()); StepEventBus.getEventBus().useExamplesFrom(thucydidesTableFrom(table)); }
private void insertDescriptionForExamples(Scenario scenario, Description scenarioDescription) { ExamplesTable examplesTable = scenario.getExamplesTable(); List<Map<String, String>> rows = examplesTable.getRows(); for (Map<String, String> row : rows) { Description exampleRowDescription = Description .createSuiteDescription( configuration.keywords().examplesTableRow() + " " + row, (Annotation[]) null); scenarioDescription.addChild(exampleRowDescription); addStepsToExample(scenario, exampleRowDescription); } }
if (ExamplesTable.EMPTY == filtered.getExamplesTable() || filtered.getExamplesTable().getRows().size() == 0) { for (final String step : steps) { beforeStep(step); final ExamplesTable examples = filtered.getExamplesTable(); beforeExamples(steps, examples); for (final Map<String, String> row : examples.getRows()) { example(row); for (final String step : steps) {