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.15.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.14 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.13 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.12 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.11 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.10.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.10.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.10.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.10.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.10.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.9 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.9.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.9.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.9.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.9.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.8 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.7.pre10 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.7.pre9 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.7.pre8 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.7.pre7 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java