WebDriverRunner implements Browsers { public static void addListener(WebDriverEventListener listener) { webdriverContainer.addListener(listener); }  static void addListener(WebDriverEventListener listener); static void setWebDriver(WebDriver webDriver); static void setWebDriver(WebDriver webDriver, SelenideProxyServer selenideProxy); static void setWebDriver(WebDriver webDriver,
                                  @Nullable SelenideProxyServer selenideProxy,
                                  DownloadsFolder browserDownloadsFolder); static WebDriver getWebDriver(); static void setProxy(Proxy webProxy); static WebDriver getAndCheckWebDriver(); static SelenideProxyServer getSelenideProxy(); static Driver driver(); static DownloadsFolder getBrowserDownloadsFolder(); static void closeWindow(); static void closeWebDriver(); static boolean hasWebDriverStarted(); static void using(WebDriver driver, Runnable lambda); static boolean isFirefox(); static boolean isLegacyFirefox(); static boolean isChrome(); static boolean isIE(); static boolean isEdge(); static boolean isHeadless(); static boolean supportsJavascript(); static boolean isOpera(); static void clearBrowserCache(); static String source(); static String url(); static String currentFrameUrl(); static WebDriverContainer webdriverContainer; }
@Test void userCanAddWebDriverListeners() { WebDriverEventListener listener = mock(WebDriverEventListener.class); WebDriverRunner.addListener(listener); Configuration.browser = CustomWebDriverProvider.class.getName(); open(url); verify(listener).beforeNavigateTo(eq(url.toString()), any(WebDriver.class)); }