use of com.testsigma.agent.exception.MobileLibraryInstallException in project testsigma by testsigmahq.
the class AndroidMobileAutomationServer method installDrivers.
public void installDrivers(String uniqueId) throws MobileLibraryInstallException {
try {
MobileDevice mobileDevice = deviceContainer.getDevice(uniqueId);
IDevice device = mobileDevice.getIDevice();
this.installAppiumSettings(device);
this.startAppiumSettings(device);
this.installUIAutomatorServer(device);
this.installUIAutomatorServerTest(device);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new MobileLibraryInstallException(e.getMessage(), e);
}
}
use of com.testsigma.agent.exception.MobileLibraryInstallException in project testsigma by testsigmahq.
the class AndroidMobileAutomationServer method installUIAutomatorServerTest.
private void installUIAutomatorServerTest(IDevice device) throws MobileLibraryInstallException {
try {
// if (commandExecutor.isPackageInstalled(device, UI_AUTOMATOR2_TEST_PACKAGE)) {
// log.info("io.appium.uiautomator2.server.test is already installed. So Skipping the install");
// return;
// }
log.info("Installing UIAutomatorServerTest on device" + device.getSerialNumber());
device.installPackage(uiAutomatorServerTestAPK().getAbsolutePath(), true);
} catch (Exception e) {
throw new MobileLibraryInstallException(e.getMessage(), e);
}
}
use of com.testsigma.agent.exception.MobileLibraryInstallException in project testsigma by testsigmahq.
the class AndroidMobileAutomationServer method uninstallUIAutomatorServer.
private void uninstallUIAutomatorServer(IDevice device) throws MobileLibraryInstallException {
try {
if (!commandExecutor.isPackageInstalled(device, UI_AUTOMATOR2_PACKAGE)) {
log.info("io.appium.uiautomator2.server is not installed. So Skipping the uninstall");
}
log.info("Uninstalling UIAutomatorServer on device" + device.getSerialNumber());
device.uninstallPackage(UI_AUTOMATOR2_PACKAGE);
} catch (Exception e) {
throw new MobileLibraryInstallException(e.getMessage(), e);
}
}
use of com.testsigma.agent.exception.MobileLibraryInstallException in project testsigma by testsigmahq.
the class TestPlanRunTask method setupLocalDevice.
protected void setupLocalDevice() throws AutomatorException {
log.info("Setting up local mobile device");
try {
checkDeviceAvailability();
TestDeviceSettings testDeviceSettings = environment.getEnvSettings();
setAppiumUrl(testDeviceSettings);
testDeviceSettings.setDeviceName(mobileDevice.getName());
testDeviceSettings.setDeviceUniqueId(mobileDevice.getUniqueId());
if (Platform.Android.equals(getEnvPlatform())) {
testDeviceSettings.setChromedriverExecutableDir(PathUtil.getInstance().getDriversPath());
} else if (Platform.iOS.equals(getEnvPlatform())) {
iosDeviceService.setupWda(mobileDevice);
}
environment.setEnvSettings(testDeviceSettings);
mobileAutomationServerService.installDrivers(this.mobileDevice.getOsName(), this.mobileDevice.getUniqueId());
} catch (TestsigmaException | DeviceNotConnectedException | MobileLibraryInstallException e) {
log.error(e.getMessage(), e);
throw new AutomatorException(e.getMessage(), e);
}
}
Aggregations