use of com.testsigma.agent.mobile.MobileDevice in project testsigma by testsigmahq.
the class AndroidDeviceListener method deviceConnected.
@Override
public void deviceConnected(IDevice device) {
log.info("Device connected event received by Listener");
try {
if (IDevice.DeviceState.ONLINE.equals(device.getState())) {
MobileDevice mobileDevice = mobileDeviceMapper.map(device);
mobileDevice.setIDevice(device);
populateOtherAttributes(mobileDevice, device);
this.addDevice(mobileDevice);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
use of com.testsigma.agent.mobile.MobileDevice in project testsigma by testsigmahq.
the class AndroidDeviceListener method getInitialDeviceList.
public void getInitialDeviceList() {
try {
if (agentConfig.getRegistered().equals(Boolean.FALSE)) {
log.debug("Skipping initial agent devices collection since agent is not registered...");
return;
}
log.debug("Started getting initial agent devices connected...");
IDevice[] devices = adBridge.getDevices();
for (IDevice device : devices) {
if (IDevice.DeviceState.ONLINE.equals(device.getState())) {
MobileDevice mobileDevice = mobileDeviceMapper.map(device);
mobileDevice.setIDevice(device);
populateOtherAttributes(mobileDevice, device);
this.addDevice(mobileDevice);
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
use of com.testsigma.agent.mobile.MobileDevice in project testsigma by testsigmahq.
the class AndroidDeviceListener method deviceDisconnected.
@Override
public void deviceDisconnected(IDevice device) {
log.info("Device disconnected event received by Listener");
try {
MobileDevice mobileDevice = mobileDeviceMapper.map(device);
this.removeDevice(mobileDevice);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
use of com.testsigma.agent.mobile.MobileDevice in project testsigma by testsigmahq.
the class AndroidDeviceListener method deviceChanged.
@Override
public void deviceChanged(IDevice device, int i) {
log.info("Device changed event received by Listener");
try {
MobileDevice mobileDevice = mobileDeviceMapper.map(device);
if (IDevice.DeviceState.ONLINE.equals(device.getState())) {
populateOtherAttributes(mobileDevice, device);
}
mobileDevice.setIDevice(device);
this.updateDevice(mobileDevice);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
use of com.testsigma.agent.mobile.MobileDevice in project testsigma by testsigmahq.
the class IosMobileAutomationServer method deleteSession.
public void deleteSession(String uniqueId) throws TestsigmaException {
MobileDevice device = deviceContainer.getDevice(uniqueId);
RemoteWebDriver remoteWebDriver = device.getRemoteWebDriver();
if (remoteWebDriver == null) {
log.info("no appium session exists to quit....returning...");
return;
}
remoteWebDriver.quit();
device.setRemoteWebDriver(null);
}
Aggregations