Sha256: e2af80929ce7dd19f3e252c8f33f2111cfae4a34248a1765d4d6065f72cfc680

Contents?: true

Size: 1004 Bytes

Versions: 3

Compression:

Stored size: 1004 Bytes

Contents

package com.amplify.honeydew_server.actions;

import com.android.uiautomator.core.UiDevice;
import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiSelector;
import com.amplify.honeydew_server.Action;
import com.amplify.honeydew_server.Result;

import java.util.Map;

public class SetText extends Action {

    public SetText(UiDevice uiDevice) {
        super(uiDevice);
    }

    @Override
    public Result execute(Map<String, Object> arguments) throws UiObjectNotFoundException {
        String textDescription = (String) arguments.get("description");
        String text = (String) arguments.get("text");

        UiObject textField = new UiObject(new UiSelector().description(textDescription));

        if(isUiObjectAvailable(textField, arguments)){
            textField.setText(text);
            uiDevice.pressDPadDown();
            return Result.OK;
        }

        return Result.FAILURE;
    }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
honeydew-0.17.0 server/src/main/java/com/amplify/honeydew_server/actions/SetText.java
honeydew-0.16.0 server/src/main/java/com/amplify/honeydew_server/actions/SetText.java
honeydew-0.15.0 server/src/main/java/com/amplify/honeydew_server/actions/SetText.java