Search in sources :

Example 1 with WebDriverCapability

use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.

the class IosDriver method setHybridCapabilities.

@Override
protected void setHybridCapabilities() throws AutomatorException, MalformedURLException {
    super.setHybridCapabilities();
    AppPathType appPathType = settings.getAppPathType();
    if (appPathType == AppPathType.APP_DETAILS) {
        capabilities.add(new WebDriverCapability(TSCapabilityType.BUNDLE_ID, settings.getBundleId()));
    }
}
Also used : AppPathType(com.testsigma.automator.entity.AppPathType) WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability)

Example 2 with WebDriverCapability

use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.

the class IosWebDriver method setCommonCapabilities.

@Override
protected void setCommonCapabilities() throws AutomatorException {
    super.setCommonCapabilities();
    capabilities.add(new WebDriverCapability(MobileCapabilityType.PLATFORM_NAME, Platform.iOS.name()));
}
Also used : WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability)

Example 3 with WebDriverCapability

use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.

the class MobileDriver method setHybridCapabilities.

@Override
protected void setHybridCapabilities() throws AutomatorException, MalformedURLException {
    super.setHybridCapabilities();
    setHybridRemoteServerUrl(settings.getAppiumUrl());
    if (WorkspaceType.isIOSNative(testDeviceEntity.getWorkspaceType()) && (AppPathType.APP_DETAILS != settings.getAppPathType())) {
        log.info("Identified Application type is iOS Native and app path type is not using bundleID. Trying to resolve" + "bundle Id");
        List<WebDriverCapability> additionalCapabilitiesList = webDriverSettings.getWebDriverCapabilities();
        WebDriverCapability appCapability = additionalCapabilitiesList.stream().filter(cap -> cap.getCapabilityName().equals(TSCapabilityType.APP)).findFirst().orElse(null);
        if ((appCapability != null) && StringUtils.isNotBlank(appCapability.getCapabilityValue().toString())) {
            AppInstaller appInstaller = new AppInstaller(EnvironmentRunner.getWebAppHttpClient());
            String bundleId = appInstaller.installApp(settings.getDeviceName(), settings.getDeviceUniqueId(), appCapability.getCapabilityValue().toString());
            log.info("Bundle Id From Installed Application - " + bundleId);
            settings.setBundleId(bundleId);
        }
    }
}
Also used : WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability) AppInstaller(com.testsigma.automator.mobile.ios.AppInstaller)

Example 4 with WebDriverCapability

use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.

the class MobileDriver method setCommonCapabilities.

@Override
protected void setCommonCapabilities() throws AutomatorException {
    super.setCommonCapabilities();
    capabilities.add(new WebDriverCapability(TSCapabilityType.NAME, executionName));
}
Also used : WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability)

Example 5 with WebDriverCapability

use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.

the class FirefoxDriver method setBrowserSpecificCapabilities.

@Override
protected void setBrowserSpecificCapabilities(List<WebDriverCapability> additionalCapabilitiesList) throws AutomatorException {
    if (additionalCapabilitiesList != null) {
        for (Iterator<WebDriverCapability> single = additionalCapabilitiesList.listIterator(); single.hasNext(); ) {
            WebDriverCapability singleCap = single.next();
            String name = singleCap.getCapabilityName();
            if (com.testsigma.automator.constants.DesiredCapabilities.FIREFOXPROFILE.equals(name)) {
                FirefoxProfile profile = new FirefoxProfile();
                String values = singleCap.getCapabilityValue().toString();
                Map<String, Object> profiles = parseCapabilities(values, TSCapabilityType.FIREFOX_PROFILE);
                for (Map.Entry<String, Object> pro : profiles.entrySet()) {
                    if (pro.getValue() instanceof Boolean) {
                        profile.setPreference(pro.getKey(), (Boolean) pro.getValue());
                    } else if (pro.getValue() instanceof Integer) {
                        profile.setPreference(pro.getKey(), (Integer) pro.getValue());
                    } else {
                        profile.setPreference(pro.getKey(), (String) pro.getValue());
                    }
                }
                capabilities.add(new WebDriverCapability(org.openqa.selenium.firefox.FirefoxDriver.PROFILE, profile));
                single.remove();
            }
        }
    }
}
Also used : WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability) FirefoxProfile(org.openqa.selenium.firefox.FirefoxProfile) Map(java.util.Map)

Aggregations

WebDriverCapability (com.testsigma.automator.drivers.WebDriverCapability)15 File (java.io.File)2 Map (java.util.Map)2 AgentBrowser (com.testsigma.agent.browsers.AgentBrowser)1 WebDriverSettingsDTO (com.testsigma.agent.dto.WebDriverSettingsDTO)1 TestsigmaDriver (com.testsigma.automator.drivers.TestsigmaDriver)1 AppPathType (com.testsigma.automator.entity.AppPathType)1 AppInstaller (com.testsigma.automator.mobile.ios.AppInstaller)1 URL (java.net.URL)1 List (java.util.List)1 MutableCapabilities (org.openqa.selenium.MutableCapabilities)1 ChromeOptions (org.openqa.selenium.chrome.ChromeOptions)1 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)1 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)1