Skip to content

Instantly share code, notes, and snippets.

@smiklosovic
Last active August 29, 2015 13:58
Show Gist options
  • Save smiklosovic/10268135 to your computer and use it in GitHub Desktop.
Save smiklosovic/10268135 to your computer and use it in GitHub Desktop.
public class AndroidDronePointFilter implements DronePointFilter {
@Override
public boolean accept(DroneContext context, DronePoint<?> dronePoint) {
DronePointContext<?> dronePointContext = context.get(dronePoint);
if (dronePointContext.hasConfiguration() && dronePoint.conformsTo(WebDriver.class)) {
if (dronePointContext.isInstantiated()) {
if (dronePoint.conformsTo(AndroidDriver.class)) {
return true;
}
} else {
WebDriverConfiguration configuration = dronePointContext.getConfigurationAs(WebDriverConfiguration.class);
return configuration.getBrowser().equals("android");
}
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment