Esempio n. 1
0
def init():
    getDevices = getYam(PATH("../yaml/devices.yaml"))
    apkPath = PATH("../yaml/" + getYam(PATH("../yaml/run.yaml"))["app"])
    print(apkPath)
    apkInfo = ApkInfo(apkPath=apkPath)
    for item in getDevices:
        item["app"] = apkPath
        item["appPackage"] = apkInfo.getApkBaseInfo()[0]
        item["appActivity"] = apkInfo.getApkActivity()
    # 统计
    of = OperateFile(PATH("../Log/info.pickle"))
    of.mkdir_file()
    of = OperateFile(PATH("../Log/sum.pickle"))
    of.mkdir_file()

    data = read(PATH("../Log/sum.pickle"))
    data["appName"] = apkInfo.getApkName()
    data["appSize"] = apkInfo.getApkSize()
    data["appVersion"] = apkInfo.getApkBaseInfo()[2]
    data["sum"] = 0
    data["pass"] = 0
    data["fail"] = 0

    write(data=data, path=PATH("../Log/sum.pickle"))
    return getDevices
Esempio n. 2
0
def runnerPool(getDevices):
    devices_Pool = []

    for i in range(0, len(getDevices)):
        _pool = []
        _initApp = {}
        _initApp["deviceName"] = getDevices[i]["devices"]
        _initApp["platformVersion"] = getPhoneInfo(
            devices=_initApp["deviceName"])["release"]
        _initApp["platformName"] = "android"
        _initApp["port"] = getDevices[i]["port"]
        _initApp["automationName"] = "uiautomator2"
        _initApp["systemPort"] = getDevices[i]["systemPort"]

        _initApp["app"] = getDevices[i]["app"]
        apkInfo = ApkInfo(_initApp["app"])
        _initApp["appPackage"] = apkInfo.getApkBaseInfo()[0]
        _initApp["appActivity"] = apkInfo.getApkActivity()
        _pool.append(_initApp)
        devices_Pool.append(_initApp)

    pool = Pool(len(devices_Pool))
    pool.map(runnerCaseApp, devices_Pool)
    pool.close()
    pool.join()
Esempio n. 3
0
def runnerPool(getDevices):
    devices_Pool = []

    for i in range(0, len(getDevices)):
        _pool = []
        _initApp = {}
        _initApp["deviceName"] = getDevices[i]["devices"]
        _initApp["platformVersion"] = getPhoneInfo(
            devices=_initApp["deviceName"])["release"]
        _initApp["platformName"] = "android"
        _initApp["port"] = getDevices[i]["port"]
        _initApp["automationName"] = "uiautomator2"
        _initApp["systemPort"] = getDevices[i]["systemPort"]

        _initApp["app"] = getDevices[i]["app"]
        #调取Base.Apk.py文件中的ApkInfo类,传入测试app
        apkInfo = ApkInfo(_initApp["app"])
        _initApp["appPackage"] = apkInfo.getApkBaseInfo()[0]
        _initApp["appActivity"] = apkInfo.getApkActivity()
        _initApp[
            "waitappActivity"] = 'com.smartcity.maxnerva.vborad_phone.view.activity.*'
        _pool.append(_initApp)
        devices_Pool.append(_initApp)

    pool = Pool(len(devices_Pool))
    #运行runnerCaseApp方法
    pool.map(runnerCaseApp, devices_Pool)
    pool.close()
    pool.join()
Esempio n. 4
0
def runnerPool(getDevices):
    devices_Pool = []

    for i in range(0, len(getDevices)):
        _pool = []
        _initApp = {}
        _initApp["deviceName"] = getDevices[i]["devices"]
        _initApp["platformVersion"] = getPhoneInfo(devices=_initApp["deviceName"])["release"]
        _initApp["platformName"] = "android"
        _initApp["port"] = getDevices[i]["port"]
        _initApp["automationName"] = "uiautomator2"
        _initApp["systemPort"] = getDevices[i]["systemPort"]

        _initApp["app"] = getDevices[i]["app"]
        apkInfo = ApkInfo(_initApp["app"])
        _initApp["appPackage"] = apkInfo.getApkBaseInfo()[0]
        _initApp["appActivity"] = apkInfo.getApkActivity()
        _pool.append(_initApp)
        devices_Pool.append(_initApp)

    pool = Pool(len(devices_Pool))
    pool.map(runnerCaseApp, devices_Pool)
    pool.close()
    pool.join()