1

I am using pytest-bdd with allure to generate the reports, In generated allure report i can see the severity level is NORMAL by default, how can i set the Severity level as i needed.Thanks in advance.

Screenshot of allure report

Saibharath
  • 56
  • 1
  • 6

2 Answers2

0

You can add severity to your allure report by @severity decorator.

First, you need to import severity and severity level from allure and add it to pytest-bdd test steps.

For example:

from allure import severity, severity_level

@severity(severity_level.CRITICAL)
@scenario('test_user.feature', 'Check user list by page')
def test_check_user_list_by_page():
    """Check user list by page."""
  • Actually i tried this solution but it din't work as it throws the following..""from allure import severity, severity_level E ImportError: cannot import name 'severity_level"" – Saibharath May 08 '19 at 05:41
  • You must be using new `allure-pytest-commons`, where it is not implemented yet. – SilentGuy Jul 11 '19 at 16:32
0

It's possible via Overhave usage: https://github.com/Tinkoff/overhave

For example:

@severity.critical
Feature: My feature

Scenario: My scenario
  When I am user
  ...

Full example from framework documentation is here: https://github.com/Tinkoff/overhave/blob/master/docs/includes/feature_example.rst

You will get necessary severity level in Allure report after test is finished.

Vlad
  • 1