Skip to content

Commit

Permalink
fix: new teardown method
Browse files Browse the repository at this point in the history
  • Loading branch information
sr4850 committed Dec 17, 2024
1 parent 9286c3b commit 1f2a6a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/activesupport/driver/Browser.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import activesupport.config.Configuration;
import activesupport.driver.Parallel.*;
import activesupport.proxy.ProxyConfig;
import com.browserstack.local.Local;
import org.openqa.selenium.WebDriver;

import java.net.MalformedURLException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -24,7 +22,6 @@ public class Browser {
ThreadLocal<WebDriver> threadLocalDriver = new ThreadLocal<>();
private static final Logger LOGGER = LogManager.getLogger(Browser.class);

static Local bsLocal = new Local();

public static Configuration configuration = new Configuration();

Expand Down Expand Up @@ -132,13 +129,15 @@ private static void whichBrowser(String browserName) throws IllegalBrowserExcept
public static void closeBrowser() throws Exception {
if (getDriver() != null)
getDriver().quit();
bsLocal.stop();
threadLocalDriver.remove();
}

public static boolean isBrowserOpen() {
boolean isOpen;
isOpen = getDriver() != null;
return isOpen;
}

public static void removeLocalDriverThread() {
threadLocalDriver.remove();
}
}
2 changes: 2 additions & 0 deletions src/main/java/activesupport/driver/BrowserStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import java.util.Optional;

public class BrowserStack {

//DEPRECATED
private static final Logger LOGGER = LogManager.getLogger(BrowserStack.class);
static Local browserStack = new Local();

Expand Down

0 comments on commit 1f2a6a4

Please sign in to comment.