Search in sources :

Example 1 with VerifyElementDisabledAction

use of com.testsigma.automator.actions.mobile.ios.verify.VerifyElementDisabledAction 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:
            VerifyElementDisabledAction disabled = (VerifyElementDisabledAction) this.initializeChildSnippet(VerifyElementDisabledAction.class);
            disabled.execute();
            this.setSuccessMessage(disabled.getSuccessMessage());
            break;
        case ActionConstants.VISIBLE:
            VerifyElementPresenceAction visible = (VerifyElementPresenceAction) this.initializeChildSnippet(VerifyElementPresenceAction.class);
            visible.execute();
            this.setSuccessMessage(visible.getSuccessMessage());
            break;
        case ActionConstants.NOT_VISIBLE:
            VerifyElementAbsenceAction notVisible = (VerifyElementAbsenceAction) this.initializeChildSnippet(VerifyElementAbsenceAction.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) VerifyElementPresenceAction(com.testsigma.automator.actions.mobile.ios.verify.VerifyElementPresenceAction) VerifyElementEnabledAction(com.testsigma.automator.actions.mobile.ios.verify.VerifyElementEnabledAction) VerifyElementAbsenceAction(com.testsigma.automator.actions.mobile.ios.verify.VerifyElementAbsenceAction) VerifyElementDisabledAction(com.testsigma.automator.actions.mobile.ios.verify.VerifyElementDisabledAction)

Aggregations

VerifyElementAbsenceAction (com.testsigma.automator.actions.mobile.ios.verify.VerifyElementAbsenceAction)1 VerifyElementDisabledAction (com.testsigma.automator.actions.mobile.ios.verify.VerifyElementDisabledAction)1 VerifyElementEnabledAction (com.testsigma.automator.actions.mobile.ios.verify.VerifyElementEnabledAction)1 VerifyElementPresenceAction (com.testsigma.automator.actions.mobile.ios.verify.VerifyElementPresenceAction)1 AutomatorException (com.testsigma.automator.exceptions.AutomatorException)1