Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task
Syed8787 opened this issue Sep 23, 2019 · 3 comments
Labels
bug Something isn't working theme:behave

Comments

@Syed8787
Copy link

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:

@naveenchandra91
Copy link

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
Copy link

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

@delatrie
Copy link
Contributor

delatrie commented Dec 20, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme:behave
Projects
None yet
Development

No branches or pull requests

3 participants