Search in sources :

Example 1 with VerifyElementAbsentSnippet

use of com.testsigma.automator.actions.mobile.android.verify.VerifyElementAbsentSnippet in project testsigma by testsigmahq.

the class IfElementProxyAction method execute.

@Override
public void execute() throws Exception {
    String status = getTestData();
    switch(status) {
        case ActionConstants.ENABLED:
            VerifyEnabledSnippet enabled = (VerifyEnabledSnippet) this.initializeChildSnippet(VerifyEnabledSnippet.class);
            enabled.execute();
            this.setSuccessMessage(enabled.getSuccessMessage());
            break;
        case ActionConstants.DISABLED:
            VerifyDisabledSnippet disabled = (VerifyDisabledSnippet) this.initializeChildSnippet(VerifyDisabledSnippet.class);
            disabled.execute();
            this.setSuccessMessage(disabled.getSuccessMessage());
            break;
        case ActionConstants.VISIBLE:
            VerifyElementPresentSnippet visible = (VerifyElementPresentSnippet) this.initializeChildSnippet(VerifyElementPresentSnippet.class);
            visible.execute();
            this.setSuccessMessage(visible.getSuccessMessage());
            break;
        case ActionConstants.NOT_VISIBLE:
            VerifyElementAbsentSnippet notVisible = (VerifyElementAbsentSnippet) this.initializeChildSnippet(VerifyElementAbsentSnippet.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) VerifyEnabledSnippet(com.testsigma.automator.actions.mobile.android.verify.VerifyEnabledSnippet) VerifyElementPresentSnippet(com.testsigma.automator.actions.mobile.android.verify.VerifyElementPresentSnippet) VerifyElementAbsentSnippet(com.testsigma.automator.actions.mobile.android.verify.VerifyElementAbsentSnippet) VerifyDisabledSnippet(com.testsigma.automator.actions.mobile.android.verify.VerifyDisabledSnippet)

Aggregations

VerifyDisabledSnippet (com.testsigma.automator.actions.mobile.android.verify.VerifyDisabledSnippet)1 VerifyElementAbsentSnippet (com.testsigma.automator.actions.mobile.android.verify.VerifyElementAbsentSnippet)1 VerifyElementPresentSnippet (com.testsigma.automator.actions.mobile.android.verify.VerifyElementPresentSnippet)1 VerifyEnabledSnippet (com.testsigma.automator.actions.mobile.android.verify.VerifyEnabledSnippet)1 AutomatorException (com.testsigma.automator.exceptions.AutomatorException)1