pip install pytest-allure-dsl
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
"""
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
- feature
- story
- epic
- issue
- link
- test_case