haxe-poco

helps integrate Airtest poco sdk into haxe project for cpp target
https://github.com/charmdev/haxe-poco

To install, run:

haxelib install haxe-poco 1.0.2 

See using Haxelib in Haxelib documentation for more information.

README.md

CI

haxe-poco

helps integrate Airtest poco sdk into haxe cpp project.

What is Poco and AirTest?

Great framework for Automate UI testing. Read more: https://airtest.doc.io.netease.com/en/IDEdocs/poco_framework/poco_quick_start/ https://poco.readthedocs.io/en/latest/source/doc/integration.html

How to use it in haxe project:

  1. implement IRpc for e.g. like this:
import poco.Protocol;

class YourRpc implements poco.PocoServer.IRpc {
    var dumper:YourDumper;

    public function new() {
        dumper = new YourDumper();
    }

    public function dump():DumpResponse {
        return dumper.dumpHierarchy();
    }
}

class YourDumper implements poco.sdk.AbstractDumper {
    var root:GameRoot;

    public function new() {
        root = new GameRoot();
    }

    public function dumpHierarchy():SerializedNode {
        return dumpHierarchyImpl(root);
    }

    private function dumpHierarchyImpl(node:poco.sdk.AbstractNode, onlyVisibleNode:Bool=true):SerializedNode {
        var payload:Payload = node.enumerateAttrs();
        var nodeChildren = node.getChildren();

        var result:SerializedNode = {
            name:payload.name,
            payload:payload
        };

        var children = [];
        for (child in nodeChildren) {
            var childNode:SerializedNode = dumpHierarchyImpl(child, onlyVisibleNode);
            if (!onlyVisibleNode || childNode.payload.visible)
                children.push(childNode);
        }

        if (children.length > 0) 
            result.children = children;

        return result;
    }
}
  1. initialize PocoServer with your rpc and start it:
var poco = new PocoServer(rpc, 15004);
  1. Start your project and connect it with AirtestIDE
Contributors
nulld
Version
1.0.2
Published
6 years ago
Dependencies
License
Apache

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub

⌂