diff --git a/allure-pytest-bdd/src/pytest_bdd_listener.py b/allure-pytest-bdd/src/pytest_bdd_listener.py index 9a4f5fac..f78c5e9e 100644 --- a/allure-pytest-bdd/src/pytest_bdd_listener.py +++ b/allure-pytest-bdd/src/pytest_bdd_listener.py @@ -5,7 +5,7 @@ from allure_commons.model2 import Label from allure_commons.model2 import Status -from allure_commons.types import LabelType +from allure_commons.types import LabelType, AttachmentType from allure_commons.utils import platform_label from allure_commons.utils import host_tag, thread_tag from allure_commons.utils import md5 @@ -114,6 +114,12 @@ def pytest_runtest_makereport(self, item, call): if test_result.status == Status.PASSED and status != Status.PASSED: test_result.status = status test_result.statusDetails = status_details + if report.caplog: + self.attach_data(report.caplog, "log", AttachmentType.TEXT, None) + if report.capstdout: + self.attach_data(report.capstdout, "stdout", AttachmentType.TEXT, None) + if report.capstderr: + self.attach_data(report.capstderr, "stderr", AttachmentType.TEXT, None) if report.when == 'teardown': self.lifecycle.write_test_case(uuid=uuid)