-
Notifications
You must be signed in to change notification settings - Fork 639
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
Adding pytest style custom markers to Behave code ? #1129
Comments
OTHERWISE:
|
I just reevaluate
THEREFORE:
NOTES:
|
ThanksFirst of all, thanks for taking the time to check with me. As per your second reply:Not sure we're talking about the same thing, but what i meant is shown below. We register the new marker, by adding it to a pytest.ini which is in the folder that contains the test file and is automatically parsed by pytest when started.
Then the test code:
Execution and manual formatted output:
And the final result (with manual formatted xml output):
As per your first reply:Somehow i need to be able to get to know which tests failed and which tests passed so that i can pass along that info the requirements management system. In the above example, i can add the marker (in the code) to get to know that because the pass/fail are in the xml, together with the marker id. After that's executed, there is another python script (call it, my notifier) that takes up that xml output and goes through the list of results and tells the RMS of the results by passing it the result together with the id. If the TAG can be added to the tests in the Behave formatted/style Python code, and that TAG is included in whatever XML block inside the XML output file, then i'm all set and i just have to include parsing of that block in the notifier. I will check how the TAG can be used and see if it ends up in the XML. Thanks for now. Cheers! |
Thanks, but in
RELATED TO:
RELATED TO:
|
HINT: |
Your remark on the record_property in pytest remembered me that you indeed need to call that for the specific properties to end up in the xml output, sorry i forgot that.
|
Ok, doing this:
results in
Is that what you meant ? I can add parsing of this CDATA structure in my Notifier. |
When using pytest, I can make pytest aware of special marker.
[pytest] markers = test_id:The id of the test as known in requirements management system.
This marker is then included in the junit output when tests are executed when started like this.
pytest -rA --show-capture=all --junitxml=./test-run-results.xml
Now, when i create the test infrastructure using Behave, i would like to do something similar.
The Junit output is already available so that's nice.
But i cannot find an option in the docs to register this with Behave to make this info available in the junit xml file.
I found some info in doing it from the Allure report, but I'm not sure that's the way to go.
That info is here :
Did i miss anything ?
The text was updated successfully, but these errors were encountered: