Skip to content

Commit 791c1c7

Browse files
committed
Add parent keywords that shall be skipped for self healing
1 parent e115954 commit 791c1c7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "robotframework-heal"
3-
version = "0.3.0"
3+
version = "0.3.0dev3"
44
description = "A Robot Framework Listener for library agnostic self-healing and smart recovery of tests"
55
authors = ["Many Kasiriha <many.kasiriha@dbschenker.com>"]
66
maintainers = ["Many Kasiriha <many.kasiriha@dbschenker.com>"]

src/SelfHealing/SelfHealing.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
r"Multiple .*? with name '(?P<test>.*?)' executed in.*? suite '(?P<suite>.*?)'."
2626
)
2727

28+
skip_parent_keywords = [
29+
"Run Keyword And Return Status",
30+
"Run Keyword And Expect Error",
31+
"Run Keyword And Ignore Error",
32+
"Run Keyword And Continue On Failure"
33+
]
34+
2835
class SelfHealing:
2936
ROBOT_LIBRARY_SCOPE = 'SUITE'
3037
ROBOT_LISTENER_API_VERSION = 3
@@ -75,7 +82,7 @@ def _start_library_keyword(self, data, implementation, result):
7582

7683
def _end_library_keyword(self, data, implementation, result):
7784
# Check if Keyword belongs to Browser Library
78-
if result.owner == 'Browser' and result.failed and data.parent.name != "Run Keyword And Return Status":
85+
if result.owner == 'Browser' and result.failed and data.parent.name not in skip_parent_keywords:
7986
browser = implementation.owner.instance
8087
logger.info(f"Keyword '{result.full_name}' with arguments '{BuiltIn().replace_variables(data.args)}' used on line {data.lineno} failed.", also_console=True)
8188
healer = BrowserHealer(implementation.owner.instance, use_llm_for_locator_proposals = self.use_llm_for_locator_proposals)

0 commit comments

Comments
 (0)