|
33 | 33 | import gherkin.ast.Feature; |
34 | 34 | import gherkin.ast.ScenarioDefinition; |
35 | 35 | import gherkin.ast.ScenarioOutline; |
36 | | -import gherkin.ast.TableRow; |
37 | 36 | import gherkin.pickles.PickleCell; |
38 | 37 | import gherkin.pickles.PickleRow; |
39 | 38 | import gherkin.pickles.PickleTable; |
|
50 | 49 |
|
51 | 50 | import java.io.ByteArrayInputStream; |
52 | 51 | import java.nio.charset.Charset; |
| 52 | +import java.util.ArrayList; |
53 | 53 | import java.util.Deque; |
54 | 54 | import java.util.HashMap; |
55 | 55 | import java.util.LinkedList; |
|
60 | 60 | import java.util.stream.Collectors; |
61 | 61 | import java.util.stream.IntStream; |
62 | 62 |
|
63 | | -import static io.qameta.allure.util.ResultsUtils.createParameter; |
64 | 63 | import static io.qameta.allure.util.ResultsUtils.getStatus; |
65 | 64 | import static io.qameta.allure.util.ResultsUtils.getStatusDetails; |
66 | 65 | import static io.qameta.allure.util.ResultsUtils.md5; |
@@ -266,15 +265,21 @@ private Status translateTestCaseStatus(final Result testCaseResult) { |
266 | 265 | } |
267 | 266 |
|
268 | 267 | private List<Parameter> getExamplesAsParameters(final ScenarioOutline scenarioOutline) { |
269 | | - final Examples examples = scenarioOutline.getExamples().get(0); |
270 | | - final TableRow row = examples.getTableBody().stream() |
271 | | - .filter(example -> example.getLocation().getLine() == currentTestCase.getLine()) |
272 | | - .findFirst().get(); |
273 | | - return IntStream.range(0, examples.getTableHeader().getCells().size()).mapToObj(index -> { |
274 | | - final String name = examples.getTableHeader().getCells().get(index).getValue(); |
275 | | - final String value = row.getCells().get(index).getValue(); |
276 | | - return createParameter(name, value); |
277 | | - }).collect(Collectors.toList()); |
| 268 | + final List<Parameter> parameterList = new ArrayList<>(); |
| 269 | + final List<Examples> scenarioOutlineList = scenarioOutline.getExamples().stream() |
| 270 | + .filter(examples -> examples.getLocation().getLine() + 2 == currentTestCase.getLine()) |
| 271 | + .collect(Collectors.toList()); |
| 272 | + |
| 273 | + scenarioOutlineList.forEach(examples -> examples.getTableBody() |
| 274 | + .forEach(tableRow -> { |
| 275 | + IntStream.range(0, examples.getTableHeader().getCells().size()) |
| 276 | + .forEach(consumer -> { |
| 277 | + final String name = examples.getTableHeader().getCells().get(consumer).getValue(); |
| 278 | + final String value = tableRow.getCells().get(consumer).getValue(); |
| 279 | + parameterList.add(new Parameter().setName(name).setValue(value)); |
| 280 | + }); |
| 281 | + })); |
| 282 | + return parameterList; |
278 | 283 | } |
279 | 284 |
|
280 | 285 | private void createDataTableAttachment(final PickleTable pickleTable) { |
|
0 commit comments