Search in sources :

Example 6 with MobileDevice

use of com.testsigma.agent.mobile.MobileDevice in project testsigma by testsigmahq.

the class DeviceEventCallback method onDevicePaired.

public void onDevicePaired(String uuid) throws TestsigmaException, DeviceContainerException {
    MobileDevice mobileDevice = iosDeviceListener.getMobileDevice(uuid);
    mobileDevice.setIsOnline(true);
    mobileDevice.setIsEmulator(false);
    iosDeviceListener.updateDevice(mobileDevice);
    System.out.println("Paired: " + uuid);
}
Also used : LibIMobileDevice(com.testsigma.agent.mobile.ios.libs.LibIMobileDevice) MobileDevice(com.testsigma.agent.mobile.MobileDevice)

Example 7 with MobileDevice

use of com.testsigma.agent.mobile.MobileDevice in project testsigma by testsigmahq.

the class AgentDevicesController method show.

/**
 * fetch the device details using device unique id.
 *
 * @param uniqueId
 * @return AgentDeviceDTO - connected agent device details
 * @throws DeviceNotConnectedException
 */
@GetMapping(produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public AgentDeviceDTO show(@PathVariable("unique_id") String uniqueId) throws DeviceNotConnectedException, TestsigmaException {
    log.info("Received request fetch device details - " + uniqueId);
    MobileDevice mobileDevice = deviceContainer.getDevice(uniqueId);
    if (mobileDevice == null) {
        throw new DeviceNotConnectedException("Device not online. Please check if the device is connected properly.");
    }
    return mobileDeviceMapper.map(mobileDevice);
}
Also used : MobileDevice(com.testsigma.agent.mobile.MobileDevice) DeviceNotConnectedException(com.testsigma.agent.exception.DeviceNotConnectedException) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 8 with MobileDevice

use of com.testsigma.agent.mobile.MobileDevice in project testsigma by testsigmahq.

the class AndroidMobileAutomationServer method uninstallDrivers.

public void uninstallDrivers(String uniqueId) throws MobileLibraryInstallException {
    try {
        MobileDevice mobileDevice = deviceContainer.getDevice(uniqueId);
        IDevice device = mobileDevice.getIDevice();
        this.uninstallUIAutomatorServer(device);
        this.uninstallUIAutomatorServerTest(device);
        this.uninstallAppiumSettings(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 9 with MobileDevice

use of com.testsigma.agent.mobile.MobileDevice 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 10 with MobileDevice

use of com.testsigma.agent.mobile.MobileDevice in project testsigma by testsigmahq.

the class DeviceEventCallback method onDeviceAdded.

public void onDeviceAdded(String uuid) throws TestsigmaException, DeviceContainerException {
    MobileDevice mobileDevice = iosDeviceListener.getMobileDevice(uuid);
    mobileDevice.setIsOnline(true);
    mobileDevice.setIsEmulator(false);
    iosDeviceListener.addDevice(mobileDevice);
}
Also used : LibIMobileDevice(com.testsigma.agent.mobile.ios.libs.LibIMobileDevice) MobileDevice(com.testsigma.agent.mobile.MobileDevice)

Aggregations

MobileDevice (com.testsigma.agent.mobile.MobileDevice)14 TestsigmaException (com.testsigma.agent.exception.TestsigmaException)5 AdbCommandExecutionException (com.testsigma.agent.exception.AdbCommandExecutionException)4 NativeBridgeException (com.testsigma.agent.exception.NativeBridgeException)4 IDevice (com.android.ddmlib.IDevice)3 LibIMobileDevice (com.testsigma.agent.mobile.ios.libs.LibIMobileDevice)3 MobileLibraryInstallException (com.testsigma.agent.exception.MobileLibraryInstallException)2 DeviceNotConnectedException (com.testsigma.agent.exception.DeviceNotConnectedException)1 MobileAutomationServerSessionException (com.testsigma.agent.exception.MobileAutomationServerSessionException)1 URL (java.net.URL)1 JSONObject (org.json.JSONObject)1 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)1 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1