allure-python
allure-python copied to clipboard
Robot Framework: listener raises exceptions for keywords with teardown
I'm submitting a ...
- [x] bug report
- [ ] feature request
- [ ] support request => Please do not submit support request here, see note at the top of this template.
What is the current behavior?
When running test use keyword with [Teardown]
, several exceptions from allure_robotframework
listener are received, like Calling method 'start_keyword' of listener 'allure_robotframework' failed: AttributeError: 'TestBeforeResult' object has no attribute 'afters'
.
Test after this exceptions is not included in report (as expected)
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
When running test using keyword with [Teardown]
, several exceptions from allure_robotframework
listener are received, like Calling method 'start_keyword' of listener 'allure_robotframework' failed: AttributeError: 'TestBeforeResult' object has no attribute 'afters'
Example test file — see below
Used command: robot -t Debug --listener allure_robotframework test.robot
What is the expected behavior?
No exceptions on using keywords with teardown, tests are included in report
What is the motivation / use case for changing the behavior?
Test for which listener errors were shown is not included in report Tear down in keywords is described in official documentation
Please tell us about your environment:
- Allure version: 2.8.1
- Test framework: [email protected] (Python 3.7.0 on win32)
- Allure adaptor: [email protected]
Other information
Test file (test.robot
):
*** Test Cases ***
Debug
[Setup] Make Magic
Log To Console 2
*** Keywords ***
Make Magic
[Documentation] Make some magic
Log To Console 3
[Teardown] Log To Console 4
Logs of execution:
==============================================================================
Test
==============================================================================
Debug 3
[ ERROR ] Calling method 'start_keyword' of listener 'allure_robotframework' failed: AttributeError: 'TestBeforeResult' object has no attribute 'afters'
4
[ ERROR ] Calling method 'start_keyword' of listener 'allure_robotframework' failed: AttributeError: 'TestResultContainer' object has no attribute 'steps'
2
[ ERROR ] Calling method 'end_keyword' of listener 'allure_robotframework' failed: KeyError: '3ab3f897-f084-4ed1-97e6-c67fc5c14faf'
[ ERROR ] Calling method 'end_test' of listener 'allure_robotframework' failed: AttributeError: 'TestResultContainer' object has no attribute 'labels'
| PASS |
------------------------------------------------------------------------------
Test | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Exception raises only for setup-keywords with teardown. Not all teardown keywords
I ran into this issue as well. I's an issue with RobotEyes. I have a PR in their repo, that would fix this. RobotEyes PR80
Fixed in #453 Released in 2.8.7