Skip to content

Commit 15970a9

Browse files
author
poncoe
committed
add getCloseWhenError() in TellMeWhy
1 parent 9bbb199 commit 15970a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/coedotzmagic/qatools/failurehandling/TellMeWhy.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ public static void setCloseWhenError(boolean close) {
6464
closeWhenError = close;
6565
}
6666

67+
public static boolean getCloseWhenError() {
68+
return closeWhenError;
69+
}
70+
6771
public static String getTraceInfo(StackTraceElement[] stackTrace) {
6872
StackTraceElement element = stackTrace[2];
6973
String traceMethod = " [Method: " + element.getMethodName() + "]";
@@ -87,7 +91,7 @@ private void log(String level, String getTrace, String messages) {
8791
if ("e".equalsIgnoreCase(level)) {
8892
System.out.println(identity + "[" + levelFormatted + "]" + "[" + timestamp + "] " + STOP_AUTOMATION);
8993
System.out.println(identity + "[" + levelFormatted + "]" + "[" + timestamp + "] " + REPORT_US);
90-
if (closeWhenError) {
94+
if (getCloseWhenError()) {
9195
WebDriver driver = DriverHelper.GetWebDriver();
9296
assert driver != null;
9397
driver.quit();

0 commit comments

Comments
 (0)