private DesiredCapabilities getDescription(WebDriver instance, Capabilities capabilities) { DesiredCapabilities caps = new DesiredCapabilities(capabilities.asMap()); caps.setJavascriptEnabled(instance instanceof JavascriptExecutor); if (instance instanceof TakesScreenshot) { caps.setCapability(CapabilityType.TAKES_SCREENSHOT, true); } if (instance instanceof LocationContext) { caps.setCapability(CapabilityType.SUPPORTS_LOCATION_CONTEXT, true); } if (instance instanceof ApplicationCache) { caps.setCapability(CapabilityType.SUPPORTS_APPLICATION_CACHE, true); } if (instance instanceof NetworkConnection) { caps.setCapability(CapabilityType.SUPPORTS_NETWORK_CONNECTION, true); } if (instance instanceof WebStorage) { caps.setCapability(CapabilityType.SUPPORTS_WEB_STORAGE, true); } if (instance instanceof FindsByCssSelector) { caps.setCapability(CapabilityType.SUPPORTS_FINDING_BY_CSS, true); } if (instance instanceof Rotatable) { caps.setCapability(CapabilityType.ROTATABLE, true); } if (instance instanceof HasTouchScreen) { caps.setCapability(CapabilityType.HAS_TOUCHSCREEN, true); } return caps; }
public static LocationContext location( WebDriver driver ) { return null; }
@Override public Location location() { return ((LocationContext) super.getWrappedDriver()).location(); }
@Override public void setLocation(Location arg0) { ((LocationContext) super.getWrappedDriver()).setLocation(arg0); }
static LocationContext getLocationContext(WebDriver driver) { return convert(driver, LocationContext.class, CapabilityType.SUPPORTS_LOCATION_CONTEXT, RemoteLocationContext.class); }