@Test @SuppressWarnings("unchecked") public void shouldBeWrappedInEventFiringWebdriver() throws Throwable { AbstractWebDriverEventListener eventListener = new AbstractWebDriverEventListener() { }; driverService = new DriverService(DriverType.PHANTOMJS, eventListener); driverService.before(); WebDriver driver = driverService.getDriver(); assertThat(driver).isInstanceOf(EventFiringWebDriver.class); EventFiringWebDriver eventFiringWebDriver = (EventFiringWebDriver) driver; Field field = EventFiringWebDriver.class.getDeclaredField("eventListeners"); field.setAccessible(true); assertThat(((List<WebDriverEventListener>) field.get(eventFiringWebDriver)).size()).isEqualTo(1); }