use of com.qaprosoft.zafira.models.dto.config.ConfigurationType in project carina by qaprosoft.
the class ZafiraConfigurator method getConfiguration.
@Override
public ConfigurationType getConfiguration() {
ConfigurationType conf = new ConfigurationType();
for (Parameter parameter : Parameter.values()) {
conf.getArg().add(buildArgumentType(parameter.getKey(), R.CONFIG.get(parameter.getKey())));
}
if (buildArgumentType("platform", R.CONFIG.get("os")).getValue() != null) {
// TODO: review and fix for 5.2.2.xx implementation
// add custom arguments from browserStack
conf.getArg().add(buildArgumentType("platform", R.CONFIG.get("os")));
conf.getArg().add(buildArgumentType("platform_version", R.CONFIG.get("os_version")));
}
long threadId = Thread.currentThread().getId();
// add custom arguments from current mobile device
Device device = DevicePool.getDevice();
if (!device.getName().isEmpty()) {
String deviceName = device.getName();
String deviceOs = device.getOs();
String deviceOsVersion = device.getOsVersion();
conf.getArg().add(buildArgumentType("device", deviceName));
conf.getArg().add(buildArgumentType("platform", deviceOs));
conf.getArg().add(buildArgumentType("platform_version", deviceOsVersion));
LOGGER.debug("Detected device: '" + deviceName + "'; os: '" + deviceOs + "'; os version: '" + deviceOsVersion + "'");
} else {
LOGGER.debug("Unable to detect current device for threadId: " + threadId);
}
return conf;
}
Aggregations