Skip to content

Commit 2377f60

Browse files
committed
Call & callonce bugfix test
1 parent 5fe0738 commit 2377f60

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

allure-karate/src/main/java/io/qameta/allure/karate/AllureKarate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ public void afterStep(final StepResult result,
194194
return;
195195
}
196196

197+
final Step step = result.getStep();
197198
if (step.getText().startsWith("call") || step.getText().startsWith("callonce")) {
198199
return;
199200
}
200201

201-
final Step step = result.getStep();
202202
final String uuid = parentUuid + "-" + step.getIndex();
203203

204204
final Result stepResult = result.getResult();

allure-karate/src/test/java/io/qameta/allure/karate/AllureKarateTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,16 @@ void shouldCreateAttachments() {
322322
.isGreaterThan(Long.parseLong(firstAttachmentDateCreated));
323323
}
324324

325+
@Test
326+
void shouldSkipCallAndCallOnceStepsInBeforeStep() {
327+
final AllureResults results = runApi("classpath:testdata/call-callonce.feature");
328+
329+
assertThat(results.getTestResults())
330+
.flatExtracting(TestResult::getSteps)
331+
.extracting(StepResult::getName)
332+
.doesNotContain("call", "callonce");
333+
}
334+
325335
@Test
326336
void buildTest() {
327337
Runner.builder()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Feature: Call & Call once Feature
2+
This feature calls another feature and demonstrates Allure reporting issue.
3+
4+
@smoke
5+
Scenario: Main Scenario with a call
6+
Given url 'https://jsonplaceholder.typicode.com'
7+
When method GET
8+
Then status 200
9+
10+
* call read('classpath:testdata/apiResponse.feature')
11+
* callonce read('classpath:testdata/api.feature')
12+
13+
Then print 'Main scenario completed.'

0 commit comments

Comments
 (0)