Exemple #1
0
def get_common_report(start_test_time, endtime, starttime):
    mreport = m_report.GetReport()

    b_get_hp_info = phoneBase.get_phone_info(devices=ga.deviceName)
    raw = phoneBase.get_men_total(devices=ga.deviceName)

    apk_msg = apkBase.apkInfo(PATH('../img/t.apk'))
    mreport.app_name = apk_msg.get_apk_name()
    mreport.app_size = apk_msg.get_apk_size()
    mreport.app_version = apk_msg.get_apk_version()

    mreport.test_sum = common.test_sum
    mreport.test_failed = common.test_failed
    mreport.test_success = common.test_success
    mreport.test_sum_date = str((endtime - starttime).seconds - 6) + "秒"

    mreport.phone_name = b_get_hp_info["phone_name"] + " " + b_get_hp_info[
        "phone_model"]
    mreport.phone_rel = b_get_hp_info["release"]
    mreport.phone_pix = phoneBase.get_app_pix(devices=ga.deviceName)
    mreport.phone_raw = reportPhone.phone_raw(raw / 1024)

    print(common.MEN)
    avg_men = phoneBase.get_avg_raw(common.MEN, ga.deviceName)  # 获取每次占用内存多少
    mreport.phone_avg_use_raw = avg_men
    mreport.phone_max_use_raw = reportPhone.phone_max_use_raw(common.MEN)
    mreport.phone_cpu = phoneBase.get_cpu_kel(devices=ga.deviceName)
    mreport.phone_avg_use_cpu = reportPhone.phone_avg_use_cpu(common.CPU)
    mreport.phone_avg_max_use_cpu = reportPhone.phone_avg_max_use_cpu(
        common.CPU)
    mreport.test_date = start_test_time
    mreport.fps_max = reportPhone.fps_max(common.FPS)
    mreport.fps_avg = reportPhone.fps_avg(common.FPS)
    b_report.OperateReport().set_report(mreport)
def report():
    workbook = xlsxwriter.Workbook('GetReport.xlsx')
    worksheet = workbook.add_worksheet("测试总况")
    worksheet2 = workbook.add_worksheet("测试详情")
    print(data)
    b_OperateReport = b_report.OperateReport(wd=workbook, data=data)
    b_OperateReport.init(worksheet)
    b_OperateReport.detail(worksheet2)
    b_OperateReport.close()
Exemple #3
0
def report():
    workbook = xlsxwriter.Workbook('GetReport.xlsx')
    worksheet = workbook.add_worksheet("测试总况")
    worksheet2 = workbook.add_worksheet("测试详情")
    print(common.RRPORT)
    b_OperateReport = b_report.OperateReport(wd=workbook, data=common.RRPORT)
    b_OperateReport.init(worksheet)
    b_OperateReport.detail(worksheet2)
    b_OperateReport.close()
    b_email.send_mail(get_email())
Exemple #4
0
def report(start_time, end_time, device):
    data = get_report_collect(start_time, end_time, device)
    workbook = xlsxwriter.Workbook('GetReport.xlsx')
    worksheet = workbook.add_worksheet("测试总况")
    worksheet2 = workbook.add_worksheet("测试详情")
    log.info("################### result #####################")
    log.info("#")
    log.info("#    %s" % data)
    log.info("#")
    log.info("################################################")
    b_operate_report = b_report.OperateReport(wd=workbook, data=data)
    b_operate_report.init(worksheet)
    b_operate_report.detail(worksheet2)
    b_operate_report.close()