1 Star 0 Fork 2

codeceo/appMonkey

forked from 冰貉/appMonkey 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
monkeytestcase.py 932 Bytes
一键复制 编辑 原始数据 按行查看 历史
冰貉 提交于 2021-03-12 09:31 . 上传修改兼容android10
#coding=utf-8
import time
import os
import unittest
#一个monkey测试任务
class MonkeyTestCase(unittest.TestCase):
def __init__(self, methodName='runTest', monkeycmd=None, deviceid=None, story=None):
super(MonkeyTestCase, self).__init__(methodName)
self.monkeycmd = monkeycmd
self.deviceid = deviceid
self.story = story
self.testcmd = None
@staticmethod
def loadtestcase(testcase_klass, monkeycmd=None, deviceid=None, story=None):
""" Create a suite containing all tests taken from the given
subclass, passing them the parameter 'param'.
"""
testloader = unittest.TestLoader()
testnames = testloader.getTestCaseNames(testcase_klass)
suite = unittest.TestSuite()
for name in testnames:
suite.addTest(testcase_klass(name, monkeycmd=monkeycmd, deviceid=deviceid, story=story))
return suite
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/abaiweb/app-monkey.git
git@gitee.com:abaiweb/app-monkey.git
abaiweb
app-monkey
appMonkey
master

搜索帮助