Open appaji2020 opened 5 months ago
A way to fix the behaviour is to patch GherkinParser/Library.py and introduce an event type switch (before- for setup, after- for teardown):
def yield_hooks(self, event_type: str, events: Union[str, Tuple[str, ...]], *args: Any, **kwargs: Any) -> Iterator[str]:
and replace line 60 with hook_tags = [tag for tag in kw.tags if tag.startswith(self.prefix + event_type)]
to filter events by event_type for example only hook:before-for name in self.yield_hooks('before-',events)
and line 102 : for name in self.yield_hooks('after-',events):
to process only before- events for setup and after- events for teardownself._create_setup_and_teardown(data, ("before-suite", "before-feature", "after-suite", "after-feature"))
to list all suite events/hook keyword tagsself._create_setup_and_teardown(data, ("before-test", "after-test"))
to list all test events/hook keyword tags
Describe the bug I am trying to use gherkin parser. I observed that when i define Suite Teardown/Test Teardown, it calls setup method instead.
To Reproduce Steps to reproduce the behavior:
If possible add some example source code like:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots/ Videos If applicable, add screenshots or videos to help explain your problem.
Logs Copy the messages from VSCode "Output" view for RobotCode and RobotCode Language Server for the specific folder/workspace.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.