airtestproject / pocounit Goto Github PK
View Code? Open in Web Editor NEWUnittest framework for test automation
License: Apache License 2.0
Unittest framework for test automation
License: Apache License 2.0
Launching unittests with arguments python -m unittest Q6TestCase.Q6TestCase in G:\AutoTest\Q6-Airtest\my-testflow\Q6\lib\Q6TestCase
Traceback (most recent call last):
File "D:\PyCharm Community Edition 2017.3.5\helpers\pydev\pydevd.py", line 1668, in <module>
main()
File "D:\PyCharm Community Edition 2017.3.5\helpers\pydev\pydevd.py", line 1662, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "D:\PyCharm Community Edition 2017.3.5\helpers\pydev\pydevd.py", line 1072, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\PyCharm Community Edition 2017.3.5\helpers\pycharm\_jb_unittest_runner.py", line 35, in <module>
main(argv=args, module=None, testRunner=unittestpy.TeamcityTestRunner, buffer=not JB_DISABLE_BUFFERING)
File "D:\Python27\Lib\unittest\main.py", line 94, in __init__
self.parseArgs(argv)
File "D:\Python27\Lib\unittest\main.py", line 149, in parseArgs
self.createTests()
File "D:\Python27\Lib\unittest\main.py", line 158, in createTests
self.module)
File "D:\Python27\Lib\unittest\loader.py", line 130, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "D:\Python27\Lib\unittest\loader.py", line 105, in loadTestsFromName
return self.loadTestsFromTestCase(obj)
File "D:\Python27\Lib\unittest\loader.py", line 56, in loadTestsFromTestCase
loaded_suite = self.suiteClass(map(testCaseClass, testCaseNames))
TypeError: __init__() takes exactly 1 argument (2 given)
照着代码复制了一遍,也按照了pocounit库,但是debug的时候出现了这个报错,请问下这个是啥问题?
from pocounit.case import PocoTestCase
from pocounit.addons.poco.action_tracking import ActionTracker
from poco.drivers.unity3d import UnityPoco
class GxxTestCase(PocoTestCase):
@classmethod
def setUpClass(cls):
super(GxxTestCase, cls).setUpClass()
cls.poco = UnityPoco(('<ip>', 5001))
# 启用动作捕捉(action tracker)
action_tracker = ActionTracker(cls.poco)
cls.register_addon(action_tracker)
Pocounit-results生成的结果会把上一次的覆盖掉,想通过设备和时间来区分
Current Behavior
My PocoTestResultPlayer is not showing any video.
Investigating further, i've tried to run the adb commands by-hand on my terminal (MacOs).
When the yosemite.apk install command is run, I get an Error: Unknown option: -g
If I remove the -g option from the command, yosemite is installed succesfully, but then it won't have granted permissions.
I've tried installing yosemite manually and giving permissions by manually starting a record from the app. Then, if I run my tests again, it works correctly, but it records a vertical video with my horizontal app on the middle, and big black margins on top and bottom
Expected Behavior
yosemite.apk should install with no errors and be able to record a video
Context (Environment)
Test running from MacOs
Samsung Galaxy S4 (Android 5.0.1)
Unity videogame with agent running succesfully
Running test with PyCharm with a normal run (not unit test). My test runs okay, only screen recording is failing.
My requirements.txt:
pocounit==1.0.40
airtest==1.1.3
pocoui==1.0.79
ADB version is:
Android Debug Bridge version 1.0.40
Version 4986621
Installed as /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb
Command executed by the test:
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s c818cb7a install -t -g -r /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/apks/Yosemite.apk
suite = unittest.defaultTestLoader.discover('.', 'test*.py')
是否支持类似unittest的discover()方法批量加载TestCase,应该如何使用?
试了下,直接用unittest.makeSuite,unittest.findTestCases,unittest.defaultTestLoader.loadTestsFromModule,unittest.defaultTestLoader.discover这些都会报错__init__() takes 1 positional argument but 2 were given,是因为pocounit里case类的初始化和unittest里case类的初始化不一样?
Hi, I have done the setup for multiple test cases to run using pocotestsuite module but whenever executing runner file, only listening to the setUp() function, not listening the setUpClass(). Can you provide clear details on how to execute the multiple test cases simultaneously.
How to generate HTML report for pocounit testcases like htmltestrunner generates for python unittest library ?
我在使用GitHub上的my-testflow项目时,是可以生成一个录屏的mp4文件的,使用PocoResultPlayer 可以将运行的内容回放。但是我自己写了一个ios端的demo,运行是正常的但是没有生成mp4录屏文件,使用pocoresultplayer回放时,有点击操作,但是屏幕是黑的
请问下airetest可不可以远程调用,比如我把脚本放在服务端,本机通过调用服务端的脚本来测试?adb能否连接到手机?
在ios上跑pocounit报下列warning,有什么办法屏蔽掉吗?
./usr/local/lib/python3.7/site-packages/pocounit/case.py:211: UserWarning: Fail to stop result emitter: "SiteSnapshot". You can report this error to the developers or just ignore it. Error message:
Labconfig.getIsLogJavis():False
"Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pocounit/case.py", line 207, in run
emitter.stop()
File "/usr/local/lib/python3.7/site-packages/pocounit/result/site_snapshot.py", line 32, in stop
self.snapshot('caseEnd')
File "/usr/local/lib/python3.7/site-packages/pocounit/result/site_snapshot.py", line 38, in snapshot
self.snapshot_screen(site_id)
File "/usr/local/lib/python3.7/site-packages/pocounit/result/site_snapshot.py", line 60, in snapshot_screen
b64img, fmt = self.poco.snapshot()
File "/usr/local/lib/python3.7/site-packages/poco/pocofw.py", line 433, in snapshot
return self.agent.screen.getScreen(width)
File "/usr/local/lib/python3.7/site-packages/poco/utils/airtest/screen.py", line 21, in getScreen
return base64.b64encode(open(savepath, 'rb').read()), 'png'
TypeError: expected str, bytes or os.PathLike object, not NoneType
"
.format(emitter.class.name, traceback.format_exc()))
我用pocounit框架写了能运行的脚本,但接两台android设备,只能第一台连接上的能跑,后面连的都不会执行,也没报错
怎么批量执行用例,聚合报告,有建议吗
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.