Search in sources :

Example 16 with TestsigmaException

use of com.testsigma.agent.exception.TestsigmaException 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)

Example 17 with TestsigmaException

use of com.testsigma.agent.exception.TestsigmaException in project testsigma by testsigmahq.

the class IosDeviceListener method initializeNativeBridge.

public void initializeNativeBridge() throws TestsigmaException {
    if (bridgeInitialized) {
        return;
    }
    try {
        this.usbMuxSocket = iosDeviceService.createConnection();
        bridgeInitialized = true;
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new TestsigmaException(e.getMessage(), e.getMessage());
    }
}
Also used : TestsigmaException(com.testsigma.agent.exception.TestsigmaException) DeviceContainerException(com.testsigma.agent.exception.DeviceContainerException) TestsigmaException(com.testsigma.agent.exception.TestsigmaException)

Example 18 with TestsigmaException

use of com.testsigma.agent.exception.TestsigmaException in project testsigma by testsigmahq.

the class IosDeviceService method setupWda.

public void setupWda(MobileDevice device) throws TestsigmaException, AutomatorException {
    log.info("Setting up WDA on device - " + device.getName());
    try {
        wdaService.installWdaToDevice(device);
        wdaService.startWdaOnDevice(device);
    } catch (Exception e) {
        log.error("Error while setting up wda and starting it. Error - ");
        log.error(e.getMessage(), e);
        cleanupWda(device);
        throw new TestsigmaException(e.getMessage(), e);
    }
}
Also used : TestsigmaException(com.testsigma.agent.exception.TestsigmaException) AutomatorException(com.testsigma.automator.exceptions.AutomatorException) TestsigmaException(com.testsigma.agent.exception.TestsigmaException)

Aggregations

TestsigmaException (com.testsigma.agent.exception.TestsigmaException)18 AutomatorException (com.testsigma.automator.exceptions.AutomatorException)10 IosDeviceCommandExecutor (com.testsigma.automator.mobile.ios.IosDeviceCommandExecutor)6 File (java.io.File)4 IosDeveloperImageDTO (com.testsigma.agent.dto.IosDeveloperImageDTO)2 AdbCommandExecutionException (com.testsigma.agent.exception.AdbCommandExecutionException)2 NativeBridgeException (com.testsigma.agent.exception.NativeBridgeException)2 URL (java.net.URL)2 Properties (java.util.Properties)2 ToString (lombok.ToString)2 DriverSessionDTO (com.testsigma.agent.dto.DriverSessionDTO)1 DeviceContainerException (com.testsigma.agent.exception.DeviceContainerException)1 DeviceNotConnectedException (com.testsigma.agent.exception.DeviceNotConnectedException)1 MobileLibraryInstallException (com.testsigma.agent.exception.MobileLibraryInstallException)1 TestDeviceSettings (com.testsigma.automator.entity.TestDeviceSettings)1 IOException (java.io.IOException)1 JSONObject (org.json.JSONObject)1