Search in sources :

Example 6 with MobileLibraryInstallException

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);
    }
}
Also used : MobileDevice(com.testsigma.agent.mobile.MobileDevice) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException) IDevice(com.android.ddmlib.IDevice) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException)

Example 7 with MobileLibraryInstallException

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);
    }
}
Also used : MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException)

Example 8 with MobileLibraryInstallException

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);
    }
}
Also used : MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException)

Example 9 with MobileLibraryInstallException

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);
    }
}
Also used : AutomatorException(com.testsigma.automator.exceptions.AutomatorException) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException) TestDeviceSettings(com.testsigma.automator.entity.TestDeviceSettings) TestsigmaException(com.testsigma.agent.exception.TestsigmaException) DeviceNotConnectedException(com.testsigma.agent.exception.DeviceNotConnectedException)

Aggregations

MobileLibraryInstallException (com.testsigma.agent.exception.MobileLibraryInstallException)9 IDevice (com.android.ddmlib.IDevice)2 MobileDevice (com.testsigma.agent.mobile.MobileDevice)2 DeviceNotConnectedException (com.testsigma.agent.exception.DeviceNotConnectedException)1 TestsigmaException (com.testsigma.agent.exception.TestsigmaException)1 TestDeviceSettings (com.testsigma.automator.entity.TestDeviceSettings)1 AutomatorException (com.testsigma.automator.exceptions.AutomatorException)1