use of ru.sbtqa.tag.pagefactory.mobile.utils.AppiumVideoRecorder in project page-factory-2 by sbtqa.
the class MobileDriverService method mountDriver.
@Override
public void mountDriver() {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, PROPERTIES.getAppiumPlatformName());
capabilities.setCapability(MobileCapabilityType.APP, PROPERTIES.getAppiumApp());
capabilities.setCapability(MobileCapabilityType.APPIUM_VERSION, PROPERTIES.getAppiumVersion());
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, PROPERTIES.getAppiumDeviceName());
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, PROPERTIES.getAppiumPlatformVersion());
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, PROPERTIES.getAppiumBrowserName());
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, PROPERTIES.getAppiumAutomationName());
capabilities.setCapability(MobileCapabilityType.UDID, PROPERTIES.getAppiumUdid());
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, PROPERTIES.getNewCommandTimeout());
capabilities.setCapability(MobileCapabilityType.FULL_RESET, PROPERTIES.getAppiumFullReset());
capabilities.setCapability(MobileCapabilityType.NO_RESET, PROPERTIES.getAppiumNoReset());
capabilities.setCapability(IOSMobileCapabilityType.AUTO_ACCEPT_ALERTS, PROPERTIES.getAppiumAlertsAutoAccept());
capabilities.setCapability("bundleId", PROPERTIES.getAppiumBundleId());
capabilities.setCapability("appPackage", PROPERTIES.getAppiumAppPackage());
capabilities.setCapability("appActivity", PROPERTIES.getAppiumAppActivity());
capabilities.setCapability("permissions", PROPERTIES.getAppiumPermissions());
capabilities.setCapability("autoGrantPermissions", PROPERTIES.getAppiumAutoGrantPermissions());
capabilities.setCapability("unicodeKeyboard", PROPERTIES.getAppiumKeyboardUnicode());
capabilities.setCapability("resetKeyboard", PROPERTIES.getAppiumKeyboardReset());
capabilities.setCapability("connectHardwareKeyboard", false);
capabilities.setCapability("xcodeOrgId", PROPERTIES.getAppiumXcodeOrgId());
capabilities.setCapability("xcodeSigningId", PROPERTIES.getAppiumXcodeSigningId());
capabilities.setCapability("showIOSLog", PROPERTIES.getAppiumShowIOSLog());
capabilities.setCapability("appium:disableWindowAnimation", PROPERTIES.getDisableWindowAnimation());
capabilities.setCapability("appium:useJSONSource", PROPERTIES.getAppiumUseJSONSource());
capabilities.setCapability("appium:simpleIsVisibleCheck", PROPERTIES.getAppiumSimpleIsVisibleCheck());
capabilities.setCapability("appium:useNewWDA", PROPERTIES.getAppiumUseNewWDA());
capabilities.setCapability("appium:usePrebuiltWDA", PROPERTIES.getAppiumUsePrebuiltWDA());
capabilities.setCapability("appium:derivedDataPath", PROPERTIES.getAppiumDerivedDataPath());
if (PROPERTIES.getAppiumPlatformName() == ANDROID) {
capabilities.merge(new SelenoidCapabilitiesParser().parse());
}
LOG.info(String.valueOf(capabilities));
URL url;
try {
url = new URL(PROPERTIES.getAppiumUrl());
} catch (MalformedURLException e) {
throw new FactoryRuntimeException("Could not parse appium url. Check 'appium.url' property", e);
}
mobileDriver = PROPERTIES.getAppiumPlatformName() == IOS ? new IOSDriver(url, capabilities) : new AndroidDriver(url, capabilities);
if (PROPERTIES.getAppiumPlatformName() == ANDROID) {
((AndroidDriver) mobileDriver).setSetting(Setting.WAIT_FOR_IDLE_TIMEOUT, PROPERTIES.getWaitForIdleTimeout());
}
if (PROPERTIES.getAppiumVideoEnabled()) {
appiumVideoRecorder = new AppiumVideoRecorder(Environment.getScenario());
appiumVideoRecorder.startRecord();
}
}
Aggregations