_hooks.py 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. from pluggy import HookspecMarker, HookimplMarker
  2. hookspec = HookspecMarker("allure")
  3. hookimpl = HookimplMarker("allure")
  4. class AllureUserHooks(object):
  5. @hookspec
  6. def decorate_as_title(self, test_title):
  7. """ title """
  8. @hookspec
  9. def add_title(self, test_title):
  10. """ title """
  11. @hookspec
  12. def decorate_as_description(self, test_description):
  13. """ description """
  14. @hookspec
  15. def add_description(self, test_description):
  16. """ description """
  17. @hookspec
  18. def decorate_as_description_html(self, test_description_html):
  19. """ description html"""
  20. @hookspec
  21. def add_description_html(self, test_description_html):
  22. """ description html"""
  23. @hookspec
  24. def decorate_as_label(self, label_type, labels):
  25. """ label """
  26. @hookspec
  27. def add_label(self, label_type, labels):
  28. """ label """
  29. @hookspec
  30. def decorate_as_link(self, url, link_type, name):
  31. """ url """
  32. @hookspec
  33. def add_link(self, url, link_type, name):
  34. """ url """
  35. @hookspec
  36. def start_step(self, uuid, title, params):
  37. """ step """
  38. @hookspec
  39. def stop_step(self, uuid, exc_type, exc_val, exc_tb):
  40. """ step """
  41. @hookspec
  42. def attach_data(self, body, name, attachment_type, extension):
  43. """ attach data """
  44. @hookspec
  45. def attach_file(self, source, name, attachment_type, extension):
  46. """ attach file """
  47. class AllureDeveloperHooks(object):
  48. @hookspec
  49. def start_fixture(self, parent_uuid, uuid, name, parameters):
  50. """ start fixture"""
  51. @hookspec
  52. def stop_fixture(self, parent_uuid, uuid, name, exc_type, exc_val, exc_tb):
  53. """ stop fixture """
  54. @hookspec
  55. def start_test(self, parent_uuid, uuid, name, parameters, context):
  56. """ start test"""
  57. @hookspec
  58. def stop_test(self, parent_uuid, uuid, name, context, exc_type, exc_val, exc_tb):
  59. """ stop test """
  60. @hookspec
  61. def report_result(self, result):
  62. """ reporting """
  63. @hookspec
  64. def report_container(self, container):
  65. """ reporting """
  66. @hookspec
  67. def report_attached_file(self, source, file_name):
  68. """ reporting """
  69. @hookspec
  70. def report_attached_data(self, body, file_name):
  71. """ reporting """