Search in sources :

Example 1 with AddonAction

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());
    }
}
Also used : ActionResult(com.testsigma.automator.constants.ActionResult) NaturalActionException(com.testsigma.automator.actions.exceptions.NaturalActionException) AddonAction(com.testsigma.automator.actions.AddonAction)

Aggregations

AddonAction (com.testsigma.automator.actions.AddonAction)1 NaturalActionException (com.testsigma.automator.actions.exceptions.NaturalActionException)1 ActionResult (com.testsigma.automator.constants.ActionResult)1