Sha256: 0b541401e5252d58e271fde5ad64492a2dfdc4c0aedf22cd48506b502798a75c

Contents?: true

Size: 1.07 KB

Versions: 159

Compression:

Stored size: 1.07 KB

Contents

package sh.calaba.instrumentationbackend.actions.text;


import sh.calaba.instrumentationbackend.InstrumentationBackend;
import sh.calaba.instrumentationbackend.Result;
import sh.calaba.instrumentationbackend.TestHelpers;
import sh.calaba.instrumentationbackend.actions.Action;
import android.view.View;
import android.widget.EditText;


public class ClearTextFieldByContentDescription implements Action {

    @Override
    public Result execute(String... args) {
        String contentDescription = args[0];
        View view = TestHelpers.getTextViewByDescription(contentDescription);
        if(view == null) {
            return new Result(false, "No view found with content description: '" + contentDescription + "'");
        } else if (!(view instanceof EditText)) {
            return new Result(false, "Expected EditText found: '" + view.getClass() + "'");
        } else {
            InstrumentationBackend.solo.clearEditText((EditText)view);
            return Result.successResult();
        }
    }

    @Override
    public String key() {
        return "clear_named_field";
    }

}

Version data entries

159 entries across 159 versions & 2 rubygems

Version Path
calabash-android-0.3.8 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.7 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.3.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.3.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.3.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.3.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.2.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.2.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.2.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.2.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.2.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.0 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.0.pre10 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
calabash-android-0.3.0.pre9 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java