Search in sources :

Example 1 with VerifyElementEnabledAction

use of com.testsigma.automator.actions.mobile.mobileweb.verify.VerifyElementEnabledAction in project testsigma by testsigmahq.

the class IfElementProxyAction method execute.

@Override
public void execute() throws Exception {
    String status = getTestData();
    switch(status) {
        case ActionConstants.ENABLED:
            VerifyElementEnabledAction enabled = (VerifyElementEnabledAction) this.initializeChildSnippet(VerifyElementEnabledAction.class);
            enabled.execute();
            this.setSuccessMessage(enabled.getSuccessMessage());
            break;
        case ActionConstants.DISABLED:
            VerifyDisabledAction disabled = (VerifyDisabledAction) this.initializeChildSnippet(VerifyDisabledAction.class);
            disabled.execute();
            this.setSuccessMessage(disabled.getSuccessMessage());
            break;
        case ActionConstants.VISIBLE:
            VerifyElementPresentAction visible = (VerifyElementPresentAction) this.initializeChildSnippet(VerifyElementPresentAction.class);
            visible.execute();
            this.setSuccessMessage(visible.getSuccessMessage());
            break;
        case ActionConstants.NOT_VISIBLE:
            VerifyElementIsNotDisplayedAction notVisible = (VerifyElementIsNotDisplayedAction) this.initializeChildSnippet(VerifyElementIsNotDisplayedAction.class);
            notVisible.execute();
            this.setSuccessMessage(notVisible.getSuccessMessage());
            break;
        default:
            setErrorMessage("Unable to Perform Verify Action due to error at test data");
            throw new AutomatorException("Unable to Perform Verify Action due to error at test data");
    }
}
Also used : AutomatorException(com.testsigma.automator.exceptions.AutomatorException) VerifyElementIsNotDisplayedAction(com.testsigma.automator.actions.mobile.mobileweb.verify.VerifyElementIsNotDisplayedAction) VerifyElementEnabledAction(com.testsigma.automator.actions.mobile.mobileweb.verify.VerifyElementEnabledAction) VerifyDisabledAction(com.testsigma.automator.actions.mobile.mobileweb.verify.VerifyDisabledAction) VerifyElementPresentAction(com.testsigma.automator.actions.mobile.mobileweb.verify.VerifyElementPresentAction)

Aggregations

VerifyDisabledAction (com.testsigma.automator.actions.mobile.mobileweb.verify.VerifyDisabledAction)1 VerifyElementEnabledAction (com.testsigma.automator.actions.mobile.mobileweb.verify.VerifyElementEnabledAction)1 VerifyElementIsNotDisplayedAction (com.testsigma.automator.actions.mobile.mobileweb.verify.VerifyElementIsNotDisplayedAction)1 VerifyElementPresentAction (com.testsigma.automator.actions.mobile.mobileweb.verify.VerifyElementPresentAction)1 AutomatorException (com.testsigma.automator.exceptions.AutomatorException)1