Skip to content

Instantly share code, notes, and snippets.

@TadeasKriz
Forked from smiklosovic/gist:10268135
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TadeasKriz/10268749 to your computer and use it in GitHub Desktop.
Save TadeasKriz/10268749 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()) {
return dronePointContext.getInstanceAs(WebDriver.class) instanceof AndroidDriver;
} 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