use of com.testsigma.automator.entity.TestDeviceSettings in project testsigma by testsigmahq.
the class WebDriverManager method setWebSession.
private void setWebSession(RemoteWebDriver driver) {
TestDeviceSettings testDeviceSettings = EnvironmentRunner.getRunnerEnvironmentEntity().getEnvSettings();
String executionUuid = EnvironmentRunner.getRunnerExecutionId();
Capabilities cap = driver.getCapabilities();
String browserVersion = cap.getVersion();
if (browserVersion.contains(".")) {
browserVersion = browserVersion.substring(0, browserVersion.indexOf(".") + 2);
}
testDeviceSettings.setBrowserVersionFound(browserVersion);
WebDriverSession webSession = new WebDriverSession();
JSONObject sessionSettings = ObjectUtils.defaultIfNull(webSession.getSettings(), new JSONObject());
for (String key : JSONObject.getNames(new JSONObject(testDeviceSettings))) {
sessionSettings.put(key, new JSONObject(testDeviceSettings).get(key));
}
webSession.setSettings(sessionSettings);
sessionMap.put(executionUuid, webSession);
}
use of com.testsigma.automator.entity.TestDeviceSettings in project testsigma by testsigmahq.
the class ScreenCaptureUtil method createScreenshotsFolder.
public void createScreenshotsFolder() {
TestDeviceSettings settings = EnvironmentRunner.getRunnerEnvironmentEntity().getEnvSettings();
Long envRunId = EnvironmentRunner.getRunnerEnvironmentRunResult().getId();
StringBuffer screenshots = new StringBuffer(PathUtil.getInstance().getScreenshotsPath());
File f = new File(PathUtil.getInstance().getScreenshotsPath());
f.mkdirs();
String path = screenshots.append(File.separator).append(envRunId).toString();
settings.setScreenshotLocalPath(path);
}
use of com.testsigma.automator.entity.TestDeviceSettings 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