Sha256: 2c564246c9f084827cfbb53ce8c504c1e293867a1bdde99eae4abb9ade0f3b23

Contents?: true

Size: 1.05 KB

Versions: 41

Compression:

Stored size: 1.05 KB

Contents

package sh.calaba.instrumentationbackend.actions.gestures;

import sh.calaba.instrumentationbackend.InstrumentationBackend;
import sh.calaba.instrumentationbackend.Result;
import sh.calaba.instrumentationbackend.actions.Action;

import com.jayway.android.robotium.solo.Solo;

public class Swipe implements Action {

    @Override
    public Result execute(String... args) {
        String direction = args[0];

        if (args.length == 1) {
            if(direction.equalsIgnoreCase("left")) {
                InstrumentationBackend.solo.scrollToSide(Solo.LEFT);
                return Result.successResult();
            } else if(direction.equalsIgnoreCase("right")) {
                InstrumentationBackend.solo.scrollToSide(Solo.RIGHT);
                return Result.successResult();
            }
            return Result.failedResult("Invalid direction to swipe: " + direction);
        }
        return Result.failedResult("You must provide a direction. Either 'left' or 'right'");
    }

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

}

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
calabash-android-0.4.20.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.5.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.5.2.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.5.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.5.0 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.5.0.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.5.0.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.22.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.22.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.22.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.21 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.20 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.19 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.19.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.19.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.19.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.19.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.18 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.16 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.15.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java