Sha256: f68d425edc95113b3cdf2e504b89fa0bd853d7a10bd0fb71ec089f1916c767d9

Contents?: true

Size: 992 Bytes

Versions: 4

Compression:

Stored size: 992 Bytes

Contents

package com.amplify.honeydew_server.actions;

import com.android.uiautomator.core.*;
import com.amplify.honeydew_server.Action;
import com.amplify.honeydew_server.Result;

import java.util.Map;

public class IsChildCountEqualTo extends Action {

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

    @Override
    public Result execute(Map<String, Object> arguments) throws UiObjectNotFoundException {
        String parentDescription = (String) arguments.get("parent_description");
        String childDescription = (String) arguments.get("child_description");
        int childCount = (Integer) arguments.get("child_count");

        UiCollection parentElement = new UiCollection(new UiSelector().description(parentDescription));
        int count = parentElement.getChildCount(new UiSelector().description(childDescription));
        return new Result(childCount == count, "Actual count was: " + count + " when " + childCount + " was expected");
    }

}

Version data entries

4 entries across 4 versions & 1 rubygems

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