airtestproject / poco-sdk Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://github.com/AirtestProject/Poco
License: Apache License 2.0
Home Page: https://github.com/AirtestProject/Poco
License: Apache License 2.0
输入没问题,但是想做清空操作不行
我们公司cocos2dx-lua版本 没有升级到3.0+, 可以接入pocosdk吗
Followed documentation but integration was not successful as the documentation needs to be updated for latest cocos-2d-js v3.17. Can someone help me in steps to get integrated in latest cocos?
按照文档完成了pocosdk的接入
堆栈信息如下:
...Bin/trunk/client/cocos/src/app/poco/poco_manager.lua:111: attempt to index local 'client_sock' (a nil value)
.../trunk/client/cocos/src/main.lua:23: in function <...ace/trunk/client/cocos/src/main.lua:16>
...Bin/trunk/client/cocos/src/app/poco/poco_manager.lua:111: in function 'server_loop'
...Bin/trunk/client/cocos/src/app/poco/poco_manager.lua:96: in function <...Bin/trunk/client/cocos/src/app/poco/poco_manager.lua:96>
昨天做了多台机子测试,共出现了几十次这个堆栈错误告警
sdk版本:cocos2d-lua poco sdk(v1.0.6_2018-5-15)
现在3.17的websocket版本是2.4.2 , 贵方提供的sdk版本是1.6,可以更新一下poco sdk 的版本吗?至少应该支持3.17吧
已经将poco-sdk放入游戏目录,在main.js里 加入了
var PocoManager = window.PocoManager;
var poco = new PocoManager() ;
window.poco = poco;
执行后产生 PocoManager is not a constructor 此错误,想请教步骤是否有误?
project.json 也已经加入
"src/lib/Poco/sdk/AbstractDumper.js",
"src/lib/Poco/sdk/AbstractNode.js",
"src/lib/Poco/sdk/Attributor.js",
"src/lib/Poco/sdk/DefaultMatcher.js",
"src/lib/Poco/sdk/IScreen.js",
"src/lib/Poco/sdk/Selector.js",
"src/lib/Poco/Cocos2dxNode.js",
"src/lib/Poco/Cocos2dxDumper.js",
"src/lib/Poco/POCO_SDK_VERSION.js",
"src/lib/Poco/Poco.js"
CocosCreator版本:1.8
报错信息:
load script [C:\Users\Administrator\Desktop\AirTest\complete_project\temp\quick-scripts\assets\scripts\Poco\Cocos2dxDumper.js] failed : TypeError: Cannot read property 'prototype' of undefined
at __define (C:\Users\Administrator\Desktop\AirTest\complete_project\temp\quick-scripts\assets\scripts\Poco\Cocos2dxDumper.js:18:48)
at C:\Users\Administrator\Desktop\AirTest\complete_project\temp\quick-scripts\assets\scripts\Poco\Cocos2dxDumper.js:42:13
at Object.<anonymous> (C:\Users\Administrator\Desktop\AirTest\complete_project\temp\quick-scripts\assets\scripts\Poco\Cocos2dxDumper.js:49:11)
at Object.<anonymous> (C:\Users\Administrator\Desktop\AirTest\complete_project\temp\quick-scripts\assets\scripts\Poco\Cocos2dxDumper.js:52:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17
my game log shows error:
2018-05-29 15:25:20.153767+0800 XApp [LUA-print] stack traceback:
...client/cocos/src/cocos/framework/init.lua:79: in function <...client/cocos/src/cocos/framework/init.lua:74>
[string "-------------------------------------------..."]:15: in main chunk
[C]: in function 'require'
[string "-------------------------------------------..."]:11: in main chunk
[C]: in function 'require'
...client/cocos/src/app/poco/Cocos2dxScreen.lua:33: in function <.../client/cocos/src/app/poco/Cocos2dxScreen.lua:32>
[C]
please help me to solve it
(我们游戏日志错误如上,帮忙看下这个bug)
poco(text = 'QQ').click()
如果QQ在设备的主界面1中,但是设备界面现在处于主界面2,就会报错,无法找到QQ应用,
这个不是继承了uiautomator吗,在使用uiautomator的时候,如果当前界面没有QQ,会自动去另外的界面寻找。
AS 里面看log,发现websocketserver 已经启动
2019-10-21 14:10:04.951 4824-4963/com.ygqp.game1 D/cocos2d-x debug info: JS: Cocos2d-JS v3.10
2019-10-21 14:10:04.978 4824-4963/com.ygqp.game1 D/cocos2d-x debug info: try starting wss..
2019-10-21 14:10:04.979 4824-4963/com.ygqp.game1 D/WebSocketServer.cpp: [WebSocketServer::init] _port: 5003
2019-10-21 14:10:04.979 4824-5109/com.ygqp.game1 D/WebSocketServer.cpp: WebSocketServer thread start, helper instance: 0xca55f1c0
2019-10-21 14:10:04.979 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: Initial logging level 1023
2019-10-21 14:10:04.979 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: Libwebsockets version: 1.6.0 3ca4bac
2019-10-21 14:10:04.979 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: IPV6 compiled in and enabled
2019-10-21 14:10:04.979 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: libev support not compiled in
2019-10-21 14:10:04.980 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: mem: platform fd map: 4096 bytes
2019-10-21 14:10:04.980 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: mem: per-conn: 268 bytes + protocol rx buf
2019-10-21 14:10:05.006 4824-4963/com.ygqp.game1 D/cocos2d-x debug info: Network onServerUp...
2019-10-21 14:10:05.006 4824-4963/com.ygqp.game1 D/cocos2d-x debug info: {"type":"serverup"}
现在游戏基于 v3.10开发,好像不支持 require 语句,我加上 require(‘poco’)在 main.js
里面就报错,我把3.10里的websocket都用 3.13的替换了,所以现在可以编译成功,游戏也能跑起来,但到 airetest ide里面poco的 ui树就是无法刷新,log viewer里面报错 invalid select payload,
我现在没有加入 require(‘poco’)别的都是按照教程里面一步一步做的,请问这个如果require 是必须的话,如果 3.10没有支持,如何绕过?
I am trying to intergrate poco sdk into my project.
I copied the Unity3D folder into my scripts folder of unity project and deleted the ngui folder.
My console shows error:
Assets/Unity3D/ugui/UnityNode.cs(9,15): error CS0101: The namespace Poco' already contains a definition for
UnityNode'
本人是测试人员自学ui自动化
对于基于UI控件搜索的方式进行自动化测试,
1.针对cocos 2d游戏 接入 poco sdk,这个是要开发同学的项目脚本接入这个sdk是吗?
2.如果项目游戏没有接入poco sdk的话 用aieIDE进行ui自动化是无法使用空间搜索的方式进行自动化测试的是吧?
from poco.drivers.std import StdPoco
poco = StdPoco()
poco("Button_bag").click()
-----------------------------------------------------------------------------------------------
> [Start running..]
> [02:20:36][DEBUG]<airtest.core.android.adb> E:\Airtest\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 42f64a0baa5cbf51 wait-for-device
> [02:20:36][DEBUG]<airtest.core.android.adb> E:\Airtest\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 42f64a0baa5cbf51 shell getprop ro.build.version.sdk
> [02:20:36][DEBUG]<airtest.utils.logwraper> main_script: {'script': u'E:\\rok_Script\\untitled.air'}
> [02:20:36][DEBUG]<airtest.core.android.adb> E:\Airtest\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 42f64a0baa5cbf51 shell netcfg ; echo ---$?---
==================================================================
ERROR: runTest (app.widgets.code_runner.ide_launcher.AirtestIDECase)
Traceback (most recent call last):
File "airtest\cli\runner.py", line 84, in runTest
File "E:\untitled.air\untitled.py", line 11, in <module>
poco("Button_bag").click()
File "poco\proxy.py", line 21, in wrapped
File "poco\proxy.py", line 280, in click
File "poco\proxy.py", line 404, in get_position
File "poco\proxy.py", line 37, in wrapped
File "poco\proxy.py", line 524, in attr
File "poco\proxy.py", line 653, in _do_query
File "poco\freezeui\hierarchy.py", line 89, in select
File "poco\sdk\Selector.py", line 77, in select
File "poco\sdk\Selector.py", line 70, in getRoot
File "poco\freezeui\hierarchy.py", line 35, in getRoot
File "poco\utils\simplerpc\utils.py", line 13, in new_func
File "poco\utils\simplerpc\simplerpc.py", line 75, in wait
RuntimeError: <poco.utils.simplerpc.simplerpc.Callback object at 0x000000000472CE10> timeout error
导致报错 unity556f
download the cocos2d-x,the file is empty
启动项目后无法创建端口5001到5006
Unable to find an unused port from 5001 to 5006
UnityEngine.Debug:LogError(Object)
报错内容:
Unable to find an unused port from 5001 to 5006
UnityEngine.Debug:LogError(Object)
PocoManger:Awake() (at assets/unity3D/pocomanager.cs:78)
i meet this issue,no such file or directory:'iproxy':'iproxy'\n in IOS Poco
有一些问题请教:
1.尝试集成了pocosdk之后,提示找不到version.
在POCO_SDK_VERSION.lua硬写入 local VERSION = "1.0.1"--import('.POCO_SDK_VERSION')
打包成功。
2.集成以后如何确定是否集成成功?
3.在Airtest IDE或者 PocoHierarchyViewer中, 都没有识别cocos2dx-lua的选项, 如何识别UI元素?
Poco SDK 能否支持在UnityEditor直接录制?
(请尽量按照下面提示内容填写,有助于我们快速定位和解决问题,感谢配合。否则直接关闭。)
(重要!问题分类)
描述问题bug
(简洁清晰得概括一下遇到的问题是什么。或者是报错的traceback信息。)
项目植入了POCO的代码后在unity3D上运行正常,IDE也能正常获取UI渲染树。但是经IL2CPP编译打包成安卓包后就会发生异常。经排查后定位到这一行代码:
Dictionary<string,object> data = JsonConvert.DeserializeObject<Dictionary<string,object>> (json, settings);
查询资料后推断应该是IL2CPP的代码剥离会导致JSON等反射相关的功能会受影响。
然后尝试了在link.xml中将JSON相关代码库加入白名单的方法(link中的代码贴在下方),仍不奏效。
想求助一下有没有什么好的解决方法?
<type fullname="System.ComponentModel.TypeConverter" preserve="all"/>
<type fullname="System.ComponentModel.ArrayConverter" preserve="all"/>
<type fullname="System.ComponentModel.BaseNumberConverter" preserve="all"/>
<type fullname="System.ComponentModel.BooleanConverter" preserve="all"/>
<type fullname="System.ComponentModel.ByteConverter" preserve="all"/>
<type fullname="System.ComponentModel.CharConverter" preserve="all"/>
<type fullname="System.ComponentModel.CollectionConverter" preserve="all"/>
<type fullname="System.ComponentModel.ComponentConverter" preserve="all"/>
<type fullname="System.ComponentModel.CultureInfoConverter" preserve="all"/>
<type fullname="System.ComponentModel.DateTimeConverter" preserve="all"/>
<type fullname="System.ComponentModel.DecimalConverter" preserve="all"/>
<type fullname="System.ComponentModel.DoubleConverter" preserve="all"/>
<type fullname="System.ComponentModel.EnumConverter" preserve="all"/>
<type fullname="System.ComponentModel.ExpandableObjectConverter" preserve="all"/>
<type fullname="System.ComponentModel.Int16Converter" preserve="all"/>
<type fullname="System.ComponentModel.Int32Converter" preserve="all"/>
<type fullname="System.ComponentModel.Int64Converter" preserve="all"/>
<type fullname="System.ComponentModel.NullableConverter" preserve="all"/>
<type fullname="System.ComponentModel.SByteConverter" preserve="all"/>
<type fullname="System.ComponentModel.SingleConverter" preserve="all"/>
<type fullname="System.ComponentModel.StringConverter" preserve="all"/>
<type fullname="System.ComponentModel.TimeSpanConverter" preserve="all"/>
<type fullname="System.ComponentModel.UInt16Converter" preserve="all"/>
<type fullname="System.ComponentModel.UInt32Converter" preserve="all"/>
<type fullname="System.ComponentModel.UInt64Converter" preserve="all"/>
2019-03-05 12:21:48.663 5022-5039/com.haku.TEST E/Unity: System.NotSupportedException: C:\Program Files\Unity\Editor\Data\il2cpp\libil2cpp\icalls\mscorlib\System.Reflection.Emit\DynamicMethod.cpp(19) : Unsupported internal call for IL2CPP:DynamicMethod::create_dynamic_method - System.Reflection.Emit is not supported.
at System.Reflection.Emit.DynamicMethod.CreateDynMethod () [0x00000] in <filename unknown>:0
at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDefaultConstructor[T] (System.Type type) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.GetDefaultCreator (System.Type createdType) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract (Newtonsoft.Json.Serialization.JsonContract contract) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateDictionaryContract (System.Typ
相关截图
(贴出遇到问题时的截图内容,如果有的话)
(在AirtestIDE里产生的图像和设备相关的问题,请贴一些AirtestIDE控制台黑窗口相关报错信息)
复现步骤
项目经IL2CPP编译后应该都能复现
预期效果
(预期想要得到什么、见到什么)
python 版本: python3.5
airtest 版本: 1.0.69
airtest版本通过
pip freeze
可以命令可以查到
设备:
其他相关环境信息
Unity3D上运行正常,在android上运行异常。)
private float[] GameObjectPosInScreen (Vector3 objectPos, Renderer renderer, RectTransform rectTransform, Rect rect)
{
float[] pos = { 0f, 0f };
if (renderer) {
// 3d object
pos [0] = objectPos.x / (float)Screen.width;
pos [1] = objectPos.y / (float)Screen.height;
} else if (rectTransform) {
// ui object (rendered on screen space, other render modes may be different)
// use center pos for now
pos [0] = rect.center.x / (float)Screen.width;
pos [1] = rect.center.y / (float)Screen.height;
}
return pos;
}
位置不对:Canvas如果是ScreenSpace Camera模式,并且设置的UICamera是独立的相机(不是主相机而是另外一个专门的UICamera)的情况下,用rect.center是不准确的,还要用RectTransformUtility做进一步的转换。
size不对:因为CanvasScaler的存在,所以获得的rect不是真实的屏幕上UI的rect大小,rect/rootCanvas.scale 才是真实屏幕上的rect大小。
newtonjson资源冲突了,换成了minijson,每次更新会造成麻烦。
if PocoSDK folder add assembly definition file, we cannot add new rpc method that use project scripts.
Can't get the project tree directly in the game itself.
In the main menu everything works fine, but as soon as I go directly to the game, the developer console displays the error "Material dosen't have a color propery '_Color' "
The fact that we have in the material is not '_Color' and it is not clear what to do now
Windows platform game created on Unity
Downloaded the source code from Poco-SDK repo
Do we need to copy the Unity folder from the downloaded file to airtest IDE project? or gaming project code?
Egret
DZ417deMac-mini:roh5 dream001$ egret build -e
您正在使用白鹭编译器 5.2.31 版本
扫描项目列表
项目共计编译耗时:26.941秒
DZ417deMac-mini:roh5 dream001$ python -m poco.utils.net.stdbroker ws://:5003 tcp://:15004
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7: Error while finding module specification for 'poco.utils.net.stdbroker' (ModuleNotFoundError: No module named 'poco')
看了下POCO目前U3D只支持NGUI、UGUI。 我们这边用的是FairyGUI,因为自身不是程序出身,看代码有点困难,希望官方会提供一些其他GUI框架集成SDK的教程或例子,万分感谢!
http://top.gdl.netease.com/poco-res/poco-sdk-test-cocos2dx-js-demo-android.zip
I installed this demo cocos app. and ran below python command. It throws connection timeout error.
from poco.drivers.cocosjs import CocosJsPoco
poco = CocosJsPoco("ws://localhost:15003")
ERROR:
...
...
[rpc]waiting for connection...9
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/poco/drivers/cocosjs/init.py", line 102, in init
agent = CocosJsPocoAgent(port, device)
File "/usr/local/lib/python2.7/site-packages/poco/drivers/cocosjs/init.py", line 52, in init
self.c.connect()
File "/usr/local/lib/python2.7/site-packages/poco/utils/simplerpc/rpcclient.py", line 23, in connect
self._wait_connected(timeout)
File "/usr/local/lib/python2.7/site-packages/poco/utils/simplerpc/rpcclient.py", line 41, in _wait_connected
raise RpcConnectionError("Connecting Timeout")
RpcConnectionError: Connecting Timeout
Help me in understanding how to use this. Thanks.
Also, can someone share the source code of demo-cocos 2djs app. That will be helpful for me to integrate in my cocos2djs app. Thanks in advance!
Here, What actually i did based on my understanding is listed below.
这是一个简单易用,并且发展非常迅速的UI框架。希望能提供支持。
使用低版本 Unity 时(5.6.4),UnityEngine.XR.XRSettings 报错;
希望这里做个版本区分,低版本下还是 UnityEngine.VR.VRSettings.
这个 wjjn3033不是我的用户名
----------------------------------------------------------------------
ERROR: runTest (app.widgets.code_runner.ide_launcher.AirtestIDECase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/wjjn3033/dev/idestable/airtest/airtest/cli/runner.py", line 66, in runTest
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/Users/wjjn3033/dev/idestable/airtest/airtest/cli/runner.py", line 62, in runTest
File "/Applications/AirtestIDE.app/Contents/MacOS/untitled.air/untitled.py", line 10, in <module>
poco = StdPoco(15004)
File "/Users/wjjn3033/dev/idestable/poco/poco/drivers/std/__init__.py", line 77, in __init__
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.