private String getConsoleIconPath(DesiredCapabilities cap) { String name = cap.getBrowserName().toLowerCase(); String path = "org/openqa/grid/images/"; InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(path + name + ".png"); return in == null ? null : contextPath + "/grid/resources/" + path + name + ".png"; }
/** * @see org.openqa.selenium.Capabilities#getBrowserName() */ @Override public String getBrowserName() { return builtCapabilities.getBrowserName(); }
/** * @see org.openqa.selenium.Capabilities#getBrowserName() */ @Override public String getBrowserName() { return builtCapabilities.getBrowserName(); }
public static Predicate<WebDriverWrapper<?>> filterFromSystemProperties() { Predicate<WebDriverWrapper<?>> filter = any -> true; if (System.getProperty(CapabilityType.BROWSER_NAME) != null) { Set<String> browsers = new HashSet<>(Splitter.on(',').trimResults().splitToList(System.getProperty(CapabilityType.BROWSER_NAME))); filter = filter.and(driverWrapper -> browsers.contains(driverWrapper.getCapability().getBrowserName())); } if (System.getProperty(CapabilityType.PLATFORM) != null) { Set<Platform> platforms = Splitter.on(',').trimResults().splitToList(System.getProperty(CapabilityType.PLATFORM)) .stream().map(Platform::valueOf).collect(Collectors.toSet()); filter = filter.and(driverWrapper -> platforms.contains(driverWrapper.getCapability().getPlatform())); } return filter; }
public static Predicate<WebDriverWrapper<?>> filter(Browser... values) { Set<String> browsers = Sets.newHashSet(values).stream().map(value -> value.toString().toLowerCase()).collect(Collectors.toSet()); return driverWrapper -> browsers.isEmpty() || browsers.contains(driverWrapper.getCapability().getBrowserName()); }
public static Predicate<WebDriverWrapper<?>> filter(Browser... values) { return driverWrapper -> { Set<String> browsers = Sets.newHashSet(values).stream().map(value -> value.toString().toLowerCase()).collect(Collectors.toSet()); return browsers.isEmpty() || browsers.contains(driverWrapper.getCapability().getBrowserName()); }; }
/** * Check the results. */ private List<String> checkResults(final boolean... success) { final List<String> faillures = new ArrayList<>(); for (int index = 0; index < success.length; index++) { if (!success[index]) { faillures.add(repeatedCapabilities[index].getBrowserName() + "[" + repeatedCapabilities[index].getVersion() + "]/" + repeatedCapabilities[index].getPlatform()); } } return faillures; }
/** * Check the results. */ private void checkResults(final boolean[] success, final List<String> faillures) { for (int index = 0; index < success.length; index++) { if (!success[index]) { faillures.add(repeatedCapabilities[index].getBrowserName() + "[" + repeatedCapabilities[index].getVersion() + "]/" + repeatedCapabilities[index].getPlatform()); } } }
private void configureTargetPlatform(DesiredCapabilities capabilities) { setAppropriateSaucelabsPlatformVersion(capabilities); if (capabilities.getBrowserName().equals("safari")) { setAppropriateSaucelabsPlatformVersionForSafari(capabilities); } }
private void updateWaitingRequests(BrowserStatisticsCollection gridStatistics) { String capabilitiesBrowserName; for (DesiredCapabilities waitingCapabilities : this.getRegistry().getDesiredCapabilities()) { capabilitiesBrowserName = waitingCapabilities.getBrowserName(); for (String browserName : BrowserInformationCache.SUPPORTED_BROWSERS) { if (capabilitiesBrowserName.startsWith(browserName)) { gridStatistics.incrementWaitingRequests(browserName); } } } }
private void updateWaitingRequests(BrowserStatisticsCollection gridStatistics) { String capabilitiesBrowserName; for (DesiredCapabilities waitingCapabilities : this.getRegistry().getDesiredCapabilities()) { capabilitiesBrowserName = waitingCapabilities.getBrowserName(); for (String browserName : BrowserInformationCache.SUPPORTED_BROWSERS) { if (capabilitiesBrowserName.startsWith(browserName)) { gridStatistics.incrementWaitingRequests(browserName); } } } }
private void configureTargetPlatform(DesiredCapabilities capabilities) { String platformValue = ThucydidesSystemProperty.SAUCELABS_TARGET_PLATFORM.from(environmentVariables); if (isNotEmpty(platformValue)) { capabilities.setCapability("platform", platformFrom(platformValue)); } if (capabilities.getBrowserName().equals("safari")) { setAppropriateSaucelabsPlatformVersionForSafari(capabilities); } }
@Override public DesiredCapabilities getCapabilities(DesiredCapabilities capabilities) { if (isLocalRun() && StringUtils.isNotBlank(getBinaryPath())) { System.setProperty(SeLionConstants.WEBDRIVER_EDGE_DRIVER_PROPERTY, getBinaryPath()); } capabilities.setBrowserName(DesiredCapabilities.edge().getBrowserName()); if (ProxyHelper.isProxyServerRequired()) { capabilities.setCapability(CapabilityType.PROXY, ProxyHelper.createProxyObject()); } return capabilities; }
@Override public DesiredCapabilities getCapabilities(DesiredCapabilities capabilities) { capabilities.setBrowserName(DesiredCapabilities.htmlUnit().getBrowserName()); if (ProxyHelper.isProxyServerRequired()) { capabilities.setCapability(CapabilityType.PROXY, ProxyHelper.createProxyObject()); } return capabilities; }
@Override public DesiredCapabilities getCapabilities(DesiredCapabilities capabilities) { capabilities.setBrowserName(DesiredCapabilities.opera().getBrowserName()); if (ProxyHelper.isProxyServerRequired()) { String msg = String.format(ProxyHelper.WARNING_MSG, "Opera"); SeLionLogger.getLogger().severe(msg); capabilities.setCapability(CapabilityType.PROXY, ProxyHelper.createProxyObject()); } return capabilities; } }
@Override public DesiredCapabilities getCapabilities(DesiredCapabilities capabilities) { capabilities.setBrowserName(DesiredCapabilities.safari().getBrowserName()); if (ProxyHelper.isProxyServerRequired()) { String msg = String.format(ProxyHelper.WARNING_MSG, "Safari"); SeLionLogger.getLogger().severe(msg); capabilities.setCapability(CapabilityType.PROXY, ProxyHelper.createProxyObject()); } return capabilities; } }
@Override public DesiredCapabilities getCapabilities(DesiredCapabilities capabilities) { if (isLocalRun() && StringUtils.isNotBlank(getBinaryPath())) { System.setProperty(SeLionConstants.WEBDRIVER_IE_DRIVER_PROPERTY, getBinaryPath()); } capabilities.setBrowserName(DesiredCapabilities.internetExplorer().getBrowserName()); if (ProxyHelper.isProxyServerRequired()) { capabilities.setCapability(InternetExplorerDriver.IE_USE_PRE_PROCESS_PROXY, true); capabilities.setCapability(CapabilityType.PROXY, ProxyHelper.createProxyObject()); } return capabilities; }
@Override public DesiredCapabilities getCapabilities(DesiredCapabilities capabilities) { if (isLocalRun() && StringUtils.isNotBlank(getBinaryPath())) { System.setProperty(SeLionConstants.WEBDRIVER_CHROME_DRIVER_PROPERTY, getBinaryPath()); } capabilities.setBrowserName(DesiredCapabilities.chrome().getBrowserName()); capabilities.setCapability(ChromeOptions.CAPABILITY, getDefaultChromeOptions()); if (ProxyHelper.isProxyServerRequired()) { capabilities.setCapability(CapabilityType.PROXY, ProxyHelper.createProxyObject()); } return capabilities; }
public Capabilities getCapabilities(WebDriverConfiguration configuration, boolean performValidations) { DesiredCapabilities capabilities = new DesiredCapabilities(configuration.getCapabilities()); capabilities.setPlatform(DesiredCapabilities.edge().getPlatform()); capabilities.setBrowserName(DesiredCapabilities.edge().getBrowserName()); new EdgeDriverBinaryHandler(capabilities).checkAndSetBinary(true); return capabilities; } }
public Capabilities getCapabilities(WebDriverConfiguration configuration, boolean performValidations) { DesiredCapabilities capabilities = new DesiredCapabilities(configuration.getCapabilities()); capabilities.setPlatform(DesiredCapabilities.edge().getPlatform()); capabilities.setBrowserName(DesiredCapabilities.edge().getBrowserName()); new EdgeDriverBinaryHandler(capabilities).checkAndSetBinary(true); return capabilities; } }