Skip to content

Instantly share code, notes, and snippets.

@smiklosovic
Last active August 29, 2015 13:58
Show Gist options
  • Save smiklosovic/9970308 to your computer and use it in GitHub Desktop.
Save smiklosovic/9970308 to your computer and use it in GitHub Desktop.
public void removeAllActivitiesForDrone(@Observes BeforeDroneDestroyed event) {
InjectionPoint<?> injectionPoint = event.getInjectionPoint();
Object drone = droneContext.get().getDrone(injectionPoint);
if (RemoteWebDriver.class.isAssignableFrom(drone.getClass())) {
WebDriverConfiguration configuration = droneContext.get()
.getDroneConfiguration(injectionPoint, WebDriverConfiguration.class);
if (configuration.getBrowser().equals("android")) {
activityWebDriverMapper.get().removeActivities((WebDriver) drone);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment