Poco ポコ
A cross-engine UI automation framework. Unity3D/cocos2dx-*/Android native APP/(Other engines SDK)/...
Example
First you should connect your Android phone, for example, via usb cable and enable the ADB DEBUG MODE.
# coding=utf-8
import time
from poco.drivers.unity3d import UnityPoco
poco = UnityPoco()
poco('btn_start').click()
time.sleep(1.5)
shell = poco('shell').focus('center')
for star in poco('star'):
star.drag_to(shell)
time.sleep(1)
assert poco('scoreVal').get_text() == "100", "score correct."
poco('btn_back', type='Button').click()
Tools for writing test scripts
To retrieve the UI hierarchy of the game, please use our AirtestIDE (an IDE for writing test scripts) or
standalone PocoHierarchyViewer (to view the hierarchy and attributes only but lightweight) !
Installation
In order to use Poco, you must install Poco python library on your host and also install the poco-sdk in
your game/app.
Poco can be installed straightforward with pip command
pip install pocoui
SDK Integration
For poco-sdk integration please refer to Integration Guide
Features
supports mainstream game engines, including: Unity3D, cocos2dx-js, cocos2dx-lua and Android native apps
retrieves UI Elements Hierarchy in game's runtime
is super fast and impact-free to the game
allows straightforward SDK integration to the game (within in 5 minutes)
provides powerful APIs that are engine independent
supports multi-touch e.g. fling/pinch/... (and more is coming soon)
support gps, accelerometer and gyro sensors, rotation (landscape/portrait) and other sensors as input (coming soon)
is extensible to other private engines by implementing poco-sdk .
is compatible with Python 2.7 and Python 3.3+.
Documentation
Tutorials and examples
How to use Poco
Poco supports different types of engines by different drivers. For different engines please initialize poco instance
by corresponding driver. Remember to connect an Android device to your PC/mac with a running game or launch and keep
the game/app active on PC/mac.
Following example shows how to initialize popo instance for
Unity3D.
from poco.drivers.unity3d import UnityPoco
poco = UnityPoco()
# for windows
# poco = UnityPoco(('localhost', 5001), unity_editor=