use of com.testsigma.automator.actions.mobile.android.verify.VerifyElementPresentSnippet 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");
}
}
Aggregations