File tree 2 files changed +14
-1
lines changed
atest/acceptance/keywords
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,13 @@ Run On Failure also fails
73
73
... ${FAILURE MESSAGE }
74
74
... Page Should Not Contain needle loglevel=None
75
75
76
+ Run On Failure With Default Keyword And Conflight With Keyword Names
77
+ [Documentation] LOG 2.1 INFO REGEXP: .*<a href=\\"selenium-screenshot.*\\.png\\"><img src=\\"selenium-screenshot.*\\.png\\" width=\\"800px\\"></a>.*
78
+ Register Keyword To Run On Failure Capture Page Screenshot
79
+ Run Keyword And Expect Error
80
+ ... ${FAILURE MESSAGE }
81
+ ... Page Should Not Contain needle loglevel=None
82
+
76
83
*** Keywords ***
77
84
On Fail
78
85
${count } = Evaluate ${ON FAIL COUNT } + 1
@@ -87,3 +94,6 @@ Open Browser To Front Page
87
94
88
95
Failure During Run On failure
89
96
Fail Expected error.
97
+
98
+ Capture Page Screenshot
99
+ Fail This should not be never run
Original file line number Diff line number Diff line change @@ -544,7 +544,10 @@ def failure_occurred(self):
544
544
return
545
545
try :
546
546
self ._running_on_failure_keyword = True
547
- BuiltIn ().run_keyword (self .run_on_failure_keyword )
547
+ if self .run_on_failure_keyword .lower () == "capture page screenshot" :
548
+ self .capture_page_screenshot ()
549
+ else :
550
+ BuiltIn ().run_keyword (self .run_on_failure_keyword )
548
551
except Exception as err :
549
552
logger .warn (
550
553
f"Keyword '{ self .run_on_failure_keyword } ' could not be run on failure: { err } "
You can’t perform that action at this time.
0 commit comments