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

Add support allure decorators (not all) for allure-pytest-bdd (fixes #726) #818

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

fantom0005
Copy link

@fantom0005 fantom0005 commented May 23, 2024

Context

Add Allure Decorators Support for Tests

This pull request introduces the ability to use Allure decorators for test cases in pytest-bdd. These decorators are essential for auto-documentation and integration with Allure Test Ops.

Currently Working Decorators:
  • @allure.description

  • @allure.label

  • @allure.severity

  • @allure.epic

  • @allure.feature

  • @allure.story

  • @allure.suite

  • @allure.parent_suite

  • @allure.sub_suite

  • @allure.tag

  • @allure.id

  • @allure.manual

  • @allure.link

  • @allure.issue

  • @allure.testcase

Non-Working Decorators:
  • @allure.title

  • @allure.description_html

I propose to fix the remaining decorators and dynamic labels in subsequent pull requests.

Thank you for reviewing!

Checklist

Copy link
Contributor

@delatrie delatrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @fantom0005. Thank you for this pull request. I really appreciate this work (so is the Allure Pytest-BDD community, I believe).

I took a brief look and it seems good so far. I'll do a more in-depth review next week, although, as long as it matches allure-pytest, there shouldn't be any problem.

For now, the only thing I would like to ask you to change is to rename the test file and the test function to better reflect what's tested inside (see my comment).

tests/allure_pytest_bdd/acceptance/allure_tags_test.py Outdated Show resolved Hide resolved
Copy link
Contributor

@delatrie delatrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, @fantom0005!

Sorry for making you wait so long!
I took a closer look and it mostly looks good. Let's fix the "unknown mark" warning and it will be good to go.

I would also appreciate if you could add one more test to check docstring-to-description conversion.

Please, read my comments for more details.

if description:
return description
elif hasattr(item, 'function'):
return item.function.__doc__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test on converting the function's doc into the Allure description?

test_helper = AllureTestHelper(config)
allure_commons.plugin_manager.register(test_helper)
config.add_cleanup(cleanup_factory(test_helper))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, register custom marks like allure-pytest does it here

@vaibhav1713109
Copy link

Hi @delatrie
When will be these feature will merged? I really need these feature for the report generation.

@leandrowcs
Copy link

@delatrie and @fantom0005
Do you know when this PR will be merged?

@JanuarioJVBarros
Copy link

@delatrie and @fantom0005
Can you give updates on this PR? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants