pytest-allure-dsl

pytest plugin to test case doc string dls instructions


Keywords
py, test, pytest, allure, dsl
Install
pip install pytest-allure-dsl==1.0.0

Documentation

Pytest Allure DSL Plugin

Installation

pip install pytest-allure-dsl

Enable plugin

From command line

pytest -p pytest_allure_dsl --allure-dsl

From pytest.ini

[pytest]
addopts = -p pytest_allure_dsl --allure-dsl

From conftest.py

pytest_plugins = ['pytest_allure_dsl']

By default allure dir is ./.allure, you can change it with --alluredir option

Usage

"""
feature:
  - common feature from module to test case functions
"""


def test_example(allure_dsl):
    """
    story: test story string or story list
    description: test description string
    issue: issue for example
    steps:
      1: step {num}
      2: step two
    """
    with allure_dsl.step(1, num='one'):
        pass

    with allure_dsl.step(2):
        pass


class TestExample:
    """
    feature:
      - common feature from class to test case methods
    """

    def test_example(self):
        """
        story: test story string or story list
        description: test description string
        attachments:
          - title: jsonschema
            file: jsonschemaes/schema.json
        """
        pass

Top level labels

  • feature
  • story
  • epic
  • issue
  • link
  • test_case