Search in sources :

Example 1 with AppInstaller

use of com.testsigma.automator.mobile.ios.AppInstaller 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)

Aggregations

WebDriverCapability (com.testsigma.automator.drivers.WebDriverCapability)1 AppInstaller (com.testsigma.automator.mobile.ios.AppInstaller)1