|
20 | 20 | from DataDriver.ReaderConfig import TestCaseData # type: ignore |
21 | 21 | from hypothesis import HealthCheck, Phase, Verbosity, given, settings |
22 | 22 | from hypothesis import strategies as st |
| 23 | +from robot.api import logger |
23 | 24 | from robot.api.deco import keyword |
24 | 25 | from robot.result.model import TestCase as ResultTestCase # type: ignore |
25 | 26 | from robot.result.model import TestSuite as ResultTestSuite # type: ignore |
26 | 27 | from robot.running.model import TestCase, TestSuite # type: ignore |
27 | 28 | from robotlibcore import DynamicCore # type: ignore |
28 | | -from schemathesis.core.result import Ok # type: ignore |
| 29 | +from schemathesis.core.result import Ok |
29 | 30 | from schemathesis.core.transport import Response |
30 | 31 |
|
31 | 32 | __version__ = "0.1.0" |
@@ -81,7 +82,20 @@ def _start_test(self, data: TestCase, result: ResultTestCase) -> None: |
81 | 82 | @keyword |
82 | 83 | def call_and_validate(self, case: schemathesis.Case) -> Response: |
83 | 84 | """Validate a Schemathesis case.""" |
84 | | - return case.call_and_validate() |
| 85 | + self.info(f"Case: {case.path} | {case.method} | {case.path_parameters}") |
| 86 | + self.debug( |
| 87 | + f"Case headers {case.headers!r} body {case.body!r} " |
| 88 | + f"cookies {case.cookies!r} path parameters {case.path_parameters!r}" |
| 89 | + ) |
| 90 | + response = case.call_and_validate() |
| 91 | + self.debug(f"Response: {response.headers} | {response.status_code} | {response.text}") |
| 92 | + return response |
| 93 | + |
| 94 | + def info(self, message: str) -> None: |
| 95 | + logger.info(message) |
| 96 | + |
| 97 | + def debug(self, message: str) -> None: |
| 98 | + logger.debug(message) |
85 | 99 |
|
86 | 100 |
|
87 | 101 | def add_examples(strategy: st.SearchStrategy, container: list[TestCaseData], max_examples: int) -> None: |
|
0 commit comments