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

A way to turn off creation of default labels, or to remove them. #1165

Open
eklmv opened this issue Oct 9, 2024 · 5 comments
Open

A way to turn off creation of default labels, or to remove them. #1165

eklmv opened this issue Oct 9, 2024 · 5 comments

Comments

@eklmv
Copy link
Contributor

eklmv commented Oct 9, 2024

allure-jest and allure-playwright in v3 by default adds labels, such as package, in my use case i already setting custom label Package for my tests, which causes problems in Allure Testops, doubling entries for my tree.
Is there a way to disable creation of default labels?
Or is there some way to easily extend allure-jest and allure-playwright to remove those labels?

@baev
Copy link
Member

baev commented Oct 14, 2024

For Allure Testops users, the recommended way is to use any other custom label (e.g., prefix all the default labels with your company ID, such as company_package) instead of overriding the default ones.

By the way, your issue is valid, and we plan to support default label overriding. However, I'm not sure when we will push such a change.

@baev
Copy link
Member

baev commented Oct 14, 2024

From the Allure Framework perspective, the missing package label was a bug.

@eklmv
Copy link
Contributor Author

eklmv commented Oct 14, 2024

Thanks for your reply.
Some thoughts on solution:
It's would be nice to have some generic way to add default labels, or even more like tags and etc.
Config could specify some option like eachTest, markTest or whatever, which contains list of modules that exports
function which receives info about test as arguments and have access to labels, tag from allure-js-commons.
For sure integrations would need to implement that change, but on a bright side logic which actually sets current default labels will be moved out of integrations into single place. Current default behavior could looks like simple default setting: eachTest: ['allure-js-commons/default-labels'].
Also as a plus, right now if you want to add some global custom default labels to your jest test you would reach to use beforeEach, but that solution fall apart when you start marking test fro skip. Hook isn't triggered, labels not added.

@baev
Copy link
Member

baev commented Oct 18, 2024

You can provide default labels for all the tests using environment variables. See https://allurereport.org/docs/jest/#set-labels-globally. Is that what you want?

@eklmv
Copy link
Contributor Author

eklmv commented Oct 18, 2024

Sadly it's not enough for us, we populate labels with data extracted from test name, path to it and etc.

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

No branches or pull requests

2 participants