Skip to content

Commit

Permalink
Call & callonce bugfix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ümit Özdemir authored and umitozdemirf committed Nov 29, 2024
1 parent 5fe0738 commit f5ff87e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ public void afterStep(final StepResult result,
return;
}

final Step step = result.getStep();
if (step.getText().startsWith("call") || step.getText().startsWith("callonce")) {
return;
}

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

final Result stepResult = result.getResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,16 @@ void shouldCreateAttachments() {
.isGreaterThan(Long.parseLong(firstAttachmentDateCreated));
}

@Test
void shouldSkipCallAndCallOnceStepsInBeforeStep() {
final AllureResults results = runApi("classpath:testdata/call-callonce.feature");

assertThat(results.getTestResults())
.flatExtracting(TestResult::getSteps)
.extracting(StepResult::getName)
.doesNotContain("call", "callonce");
}

@Test
void buildTest() {
Runner.builder()
Expand Down
13 changes: 13 additions & 0 deletions allure-karate/src/test/resources/testdata/call-callonce.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: Call & Call once Feature
This feature calls another feature and demonstrates Allure reporting issue.

@smoke
Scenario: Main Scenario with a call
Given url 'https://jsonplaceholder.typicode.com'
When method GET
Then status 200

* call read('classpath:testdata/apiResponse.feature')
* callonce read('classpath:testdata/api.feature')

Then print 'Main scenario completed.'

0 comments on commit f5ff87e

Please sign in to comment.