Sha256: 030d9dd28f6b6a7365d06880f4428dbbbfbc5e50b1637f0bdc49bcef7cd690dc

Contents?: true

Size: 1.06 KB

Versions: 163

Compression:

Stored size: 1.06 KB

Contents

package sh.calaba.instrumentationbackend.actions.time;


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.TimePicker;


public class SetTimeByContentDescription implements Action {

    @Override
    public Result execute(String... args) {
        int[] time = TestHelpers.parseTime(args[1]);
        String contentDescription = args[0];
        View view = TestHelpers.getViewByDescription(contentDescription);
        
        if(view != null && view instanceof TimePicker) {
            InstrumentationBackend.solo.setTimePicker((TimePicker)view, time[0], time[1]); 
        } else {
            return new Result(false, "Failed to find TimePicker with content description:'" + contentDescription + "'"); 
        }
        
        return Result.successResult();
    }

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

}

Version data entries

163 entries across 163 versions & 2 rubygems

Version Path
calabash-android-0.4.7.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.7.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.7.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.7.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
testautoa-0.4.4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.5.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
testautoa-0.4.3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
testautoa-0.4.2.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.3.pre8 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.3.pre7 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.3.pre6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.3.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.3.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.3.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
testautoa-0.4.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.3.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java