allure-python icon indicating copy to clipboard operation
allure-python copied to clipboard

Robot Framework: listener raises exceptions for keywords with teardown

Open outcatcher opened this issue 6 years ago • 2 comments

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:

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
==============================================================================

outcatcher avatar Dec 25 '18 09:12 outcatcher

Exception raises only for setup-keywords with teardown. Not all teardown keywords

skhomuti avatar Dec 25 '18 15:12 skhomuti

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

josev814 avatar Jan 27 '21 15:01 josev814

Fixed in #453 Released in 2.8.7

delatrie avatar Dec 15 '22 10:12 delatrie