use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class CloudAppBridge method getDriverExecutablePath.
@Override
public String getDriverExecutablePath(String browserName, String browserVersion) throws AutomatorException {
try {
MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>();
queryParams.add("browserName", browserName);
queryParams.add("browserVersion", browserVersion);
String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
String url = ServerURLBuilder.driverExecutableURL(queryParams, agentConfig.getUUID());
HttpResponse<String> response = webAppHttpClient.get(url, new TypeReference<>() {
}, authHeader);
if (response.getStatusCode() != HttpStatus.OK.value()) {
throw new AutomatorException(response.getStatusMessage());
}
return response.getResponseEntity();
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new AutomatorException(e.getMessage(), e);
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class CloudAppBridge method updateEnvironmentResultData.
@Override
public void updateEnvironmentResultData(TestDeviceResultRequest testDeviceResultRequest) throws AutomatorException {
try {
String url = ServerURLBuilder.environmentResultUpdateURL(testDeviceResultRequest.getId());
String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
HttpResponse<String> response = webAppHttpClient.put(url, testDeviceResultRequest, new TypeReference<>() {
}, authHeader);
log.info(response.getStatusCode() + " - " + response.getResponseText());
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new AutomatorException(e.getMessage(), e);
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class CloudAppBridge method updateElement.
@Override
public void updateElement(String name, ElementRequestEntity elementRequestEntity) throws AutomatorException {
try {
String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
HttpResponse<ElementEntity> response = webAppHttpClient.put(ServerURLBuilder.elementURL(name), elementRequestEntity, new TypeReference<>() {
}, authHeader);
log.info("Element update response - " + response);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new AutomatorException(e.getMessage(), e);
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class CloudAppBridge method updateRunTimeData.
@Override
public void updateRunTimeData(Long environmentResultId, RuntimeEntity runtimeEntity) throws AutomatorException {
try {
MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>();
queryParams.add("environmentResultId", environmentResultId.toString());
String url = ServerURLBuilder.runTimeNewDataURL(queryParams);
String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
webAppHttpClient.put(url, runtimeEntity, null, authHeader);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new AutomatorException(e.getMessage(), e);
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class CloudAppBridge method postTestCaseResult.
@Override
public void postTestCaseResult(TestCaseResult testCaseResult) throws AutomatorException {
try {
String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
webAppHttpClient.put(ServerURLBuilder.testCaseResultURL(testCaseResult.getId()), testCaseResult, null, authHeader);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new AutomatorException(e.getMessage(), e);
}
}
Aggregations