gherkin.pickles.PickleCell Java Examples
The following examples show how to use
gherkin.pickles.PickleCell.
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: ExtentCucumberAdapter.java From extentreports-cucumber4-adapter with Apache License 2.0 | 6 votes |
private String[][] getPickleTable(List<PickleRow> rows) { String data[][] = null; int rowSize = rows.size(); for (int i = 0; i < rowSize; i++) { PickleRow row = rows.get(i); List<PickleCell> cells = row.getCells(); int cellSize = cells.size(); if (data == null) { data = new String[rowSize][cellSize]; } for (int j = 0; j < cellSize; j++) { data[i][j] = cells.get(j).getValue(); } } return data; }
Example #2
Source File: AllureCucumber2Jvm.java From allure-java with Apache License 2.0 | 6 votes |
private void createDataTableAttachment(final PickleTable pickleTable) { final List<PickleRow> rows = pickleTable.getRows(); final StringBuilder dataTableCsv = new StringBuilder(); if (!rows.isEmpty()) { rows.forEach(dataTableRow -> { dataTableCsv.append( dataTableRow.getCells().stream() .map(PickleCell::getValue) .collect(Collectors.joining("\t")) ); dataTableCsv.append('\n'); }); final String attachmentSource = lifecycle .prepareAttachment("Data table", "text/tab-separated-values", "csv"); lifecycle.writeAttachment(attachmentSource, new ByteArrayInputStream(dataTableCsv.toString().getBytes(StandardCharsets.UTF_8))); } }
Example #3
Source File: AllureCucumber4Jvm.java From allure-java with Apache License 2.0 | 6 votes |
private void createDataTableAttachment(final PickleTable pickleTable) { final List<PickleRow> rows = pickleTable.getRows(); final StringBuilder dataTableCsv = new StringBuilder(); if (!rows.isEmpty()) { rows.forEach(dataTableRow -> { dataTableCsv.append( dataTableRow.getCells().stream() .map(PickleCell::getValue) .collect(Collectors.joining("\t")) ); dataTableCsv.append('\n'); }); final String attachmentSource = lifecycle .prepareAttachment("Data table", "text/tab-separated-values", "csv"); lifecycle.writeAttachment(attachmentSource, new ByteArrayInputStream(dataTableCsv.toString().getBytes(StandardCharsets.UTF_8))); } }
Example #4
Source File: AllureCucumber3Jvm.java From allure-java with Apache License 2.0 | 6 votes |
private void createDataTableAttachment(final PickleTable pickleTable) { final List<PickleRow> rows = pickleTable.getRows(); final StringBuilder dataTableCsv = new StringBuilder(); if (!rows.isEmpty()) { rows.forEach(dataTableRow -> { dataTableCsv.append( dataTableRow.getCells().stream() .map(PickleCell::getValue) .collect(Collectors.joining("\t")) ); dataTableCsv.append('\n'); }); final String attachmentSource = lifecycle .prepareAttachment("Data table", "text/tab-separated-values", "csv"); lifecycle.writeAttachment(attachmentSource, new ByteArrayInputStream(dataTableCsv.toString().getBytes(StandardCharsets.UTF_8))); } }
Example #5
Source File: DataTableUtils.java From akita with Apache License 2.0 | 5 votes |
public static DataTable dataTableFromLists(List<List<String>> lists) { List<PickleRow> rows = new ArrayList<>(); lists.forEach(list -> { List<PickleCell> cells = new ArrayList<>(); list.forEach(string -> { cells.add(new PickleCell(null,string)); }); rows.add(new PickleRow(cells)); }); return new DataTable(new PickleTable(rows), null); }