You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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-
update _create_setup_and_teardown function on line 78 : 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 teardown
update start_suite function on line 123: self._create_setup_and_teardown(data, ("before-suite", "before-feature", "after-suite", "after-feature")) to list all suite events/hook keyword tags
update start_test function on line 126: self._create_setup_and_teardown(data, ("before-test", "after-test")) to list all test events/hook keyword tags
wvanmourik-uwv
added a commit
to wvanmourik-uwv/robotframework-gherkin-parser
that referenced
this issue
Nov 20, 2024
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.
The text was updated successfully, but these errors were encountered: