allure-python icon indicating copy to clipboard operation
allure-python copied to clipboard

In Scenario Outline of Behave, Allure reports include Skipped test even when uisng --no-skipped or show_skipped = false

Open Syed8787 opened this issue 6 years ago • 3 comments

I'm submitting a ...

  • [.] bug report
  • [ ] feature request

What is the current behavior? In Scenario Outline of Behave, Skipped issues appear in Allure Results even if Skipped --no-skipped flag is set or behave.ini is set to show_skipped = false

Steps:

  1. I have written 2 scenario outlines. Each scenario outline loops through 4 kits(C, Java, .Net, .Net core) for 2 different examples.
  2. In first scenario outline, after first scenario ie, C, I have skipped remaining 3 scenarios of Java, .Net, .Net core)
  3. When it rolls around second scenario outline, in Allure reports I can see the skipped scenario results of first scenario outline which should not be (highlighted with yellow color in one of the attachments).
  4. behave is skipped the scenarios properly tests feature StepDefs allure report snap 1 Behave_ouput_1 Behave_ouput_2

What is the expected behavior? The skipped scenario results of previous scenario outline should not appear in next scenario outline results

Please tell us about your environment:

Syed8787 avatar Sep 23 '19 12:09 Syed8787

Hi,

I am facing the same issue. @sseliverstov . Can you kindly check if its an issue and if there is any way I can overcome this problem?

naveenchandra91 avatar Sep 26 '19 07:09 naveenchandra91

Kindly look into the issue and let us know what should be done about this?

naveenchandra91 avatar Oct 11 '19 05:10 naveenchandra91

Less verbose case to reproduce the issue

Given the following feature file (lets name it issue432.feature):

Feature: Reproduce issue 432
    Scenario: Scenario to reproduce issue 432
        Given scenario is skipped
        Then pass
        Then pass

    Scenario: A follow-up scenario
        Then the follow-up scenario passes

And the following steps definition file:

from behave import given, then

@given('scenario is skipped')
def given_scenario_is_skipped(context):
    context.scenario.skip()

@then('pass')
def then_pass(context):
    pass

@then("the follow-up scenario passes")
def then_follow_up_scenario_passes(context):
    pass

If we run the following command:

behave --no-skipped -f allure_behave.formatter:AllureFormatter -o ./allure-results ./features/issue432.feature

Then the result dir will contain a *-results.json file with the following json-object inside (non-significant properties are omitted):

{
    "name": "A follow-up scenario",
    "fullName": "Reproduce issue 432: A follow-up scenario",
    "status": "passed",
    "steps": [{
        "name": "Then pass",
        "status": "passed"
    }, {
        "name": "Then pass",
        "status": "skipped"
    }, {
        "name": "Then the follow-up scenario passes",
        "status": "passed"
    }]
}

It is shown in the report like this:

image

The omitted steps of the skipped scenario are unexpectedly included in the result of the next scenario.

behave: 1.2.6 allure-behave: 2.12.0

delatrie avatar Dec 20 '22 20:12 delatrie