Sha256: 661f895934fd7c03470fb113f25c55f55f0eeb8e2f90e56fa2eb2572b7e8d106

Contents?: true

Size: 944 Bytes

Versions: 3

Compression:

Stored size: 944 Bytes

Contents

package com.amplify.honeydew_server.actions;

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

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

3 entries across 3 versions & 1 rubygems

Version Path
honeydew-0.20.0 server/src/main/java/com/amplify/honeydew_server/actions/IsChildCountEqualTo.java
honeydew-0.19.0 server/src/main/java/com/amplify/honeydew_server/actions/IsChildCountEqualTo.java
honeydew-0.18.0 server/src/main/java/com/amplify/honeydew_server/actions/IsChildCountEqualTo.java