_hooks.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. from pluggy import HookspecMarker, HookimplMarker
  2. hookspec = HookspecMarker("allure")
  3. hookimpl = HookimplMarker("allure")
  4. class AllureUserHooks:
  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 add_parameter(self, name, value, excluded, mode):
  37. """ parameter """
  38. @hookspec
  39. def start_step(self, uuid, title, params):
  40. """ step """
  41. @hookspec
  42. def stop_step(self, uuid, exc_type, exc_val, exc_tb):
  43. """ step """
  44. @hookspec
  45. def attach_data(self, body, name, attachment_type, extension):
  46. """ attach data """
  47. @hookspec
  48. def attach_file(self, source, name, attachment_type, extension):
  49. """ attach file """
  50. class AllureDeveloperHooks:
  51. @hookspec
  52. def start_fixture(self, parent_uuid, uuid, name, parameters):
  53. """ start fixture"""
  54. @hookspec
  55. def stop_fixture(self, parent_uuid, uuid, name, exc_type, exc_val, exc_tb):
  56. """ stop fixture """
  57. @hookspec
  58. def start_test(self, parent_uuid, uuid, name, parameters, context):
  59. """ start test"""
  60. @hookspec
  61. def stop_test(self, parent_uuid, uuid, name, context, exc_type, exc_val, exc_tb):
  62. """ stop test """
  63. @hookspec
  64. def report_result(self, result):
  65. """ reporting """
  66. @hookspec
  67. def report_container(self, container):
  68. """ reporting """
  69. @hookspec
  70. def report_attached_file(self, source, file_name):
  71. """ reporting """
  72. @hookspec
  73. def report_attached_data(self, body, file_name):
  74. """ reporting """