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.20.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.5.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.5.0 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.5.0.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.5.0.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.22.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.22.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.22.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.21 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.20 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.19 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.19.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.19.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.19.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.19.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.18 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.16 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.15.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.15.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
calabash-android-0.4.14 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java