use of com.testsigma.automator.actions.AddonAction in project testsigma by testsigmahq.
the class AddonNaturalTextActionStepExecutor method execute.
public void execute() throws IOException, IllegalAccessException, NoSuchMethodException, ClassNotFoundException, InvocationTargetException, InstantiationException, AutomatorException, NoSuchFieldException, NaturalActionException {
AddonAction addonAction = new AddonAction(testCaseStepEntity, testCaseStepResult, this.addonElementPropertiesEntity, this.envSettings);
ActionResult snippetResult = addonAction.run();
if (snippetResult == ActionResult.FAILED) {
log.error("Test case step FAILED....");
NaturalActionException actionException;
if (addonAction.getException() != null) {
actionException = new NaturalActionException(addonAction.getErrorMessage(), addonAction.getException(), addonAction.getErrorCode().getErrorCode().intValue());
} else {
actionException = new NaturalActionException(addonAction.getErrorMessage());
}
testCaseStepResult.setWebDriverException(actionException.getErrorStackTraceTruncated());
testCaseStepResult.setErrorCode(addonAction.getErrorCode().getErrorCode().intValue());
testCaseStepResult.setMessage(addonAction.getErrorMessage());
markTestcaseAborted(testCaseResult, testCaseStepResult, addonAction);
testCaseStepResult.getMetadata().setLog(testCaseStepResult.getWebDriverException());
// We are throwing an InvocationTargetException to handle Auto Healing
throw actionException;
} else {
testCaseStepResult.setMessage(addonAction.getSuccessMessage());
}
}
Aggregations