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