摘要: 优化版本的HTMLTestRunner模块,从我的百度网盘获取: 链接:https://pan.baidu.com/s/1f8eLpX5qBrpJsVlXKjquRQ 提取码:qqlu 测试报告展示: 代码展示: import unittest from datetime import dateti 阅读全文
posted @ 2019-08-18 13:43 小公瑾 阅读(511) 评论(0) 推荐(0) 编辑
摘要: 在接口自动化测试框架中,我们的代码除了能在本地运行,也能在不在修改代码的前提下在其他的环境下能够运行,这样才能达到高复用性和低维护成本,我们在接口测试的模块调用中,会定义很多相关路径,而这些路径必须使用相对路径且能够动态获取才能够满足框架的基本要求,因此我们可以单独创建一个constants模块处理 阅读全文
posted @ 2019-08-18 13:40 小公瑾 阅读(1970) 评论(0) 推荐(1) 编辑
摘要: import re import os from scripts.handle_mysql import HandleMysql from scripts.handle_config import HandleConfig from scripts.constants import CONFIGS_ 阅读全文
posted @ 2019-08-18 13:39 小公瑾 阅读(293) 评论(0) 推荐(0) 编辑
摘要: from configparser import ConfigParser class HandleConfig: ''' 定义一个配置文件处理类 ''' def __init__(self, filename): self.filename = filename # 配置文件名 self.conf 阅读全文
posted @ 2019-08-18 13:38 小公瑾 阅读(263) 评论(0) 推荐(0) 编辑
摘要: from openpyxl import load_workbook from scripts.handle_config import conf from scripts.constants import DATAS_FILE_PATH actual_col = conf.get_int("mes 阅读全文
posted @ 2019-08-18 13:37 小公瑾 阅读(253) 评论(0) 推荐(1) 编辑
摘要: import logging from scripts.handle_config import conf from scripts.constants import LOGS_DIR class HandleLogger: ''' 定义一个日志处理类 ''' def __init__(self): 阅读全文
posted @ 2019-08-18 13:34 小公瑾 阅读(273) 评论(0) 推荐(0) 编辑
摘要: import requests import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) class HandleRequests: def __init__(self): self.one_ 阅读全文
posted @ 2019-08-18 13:33 小公瑾 阅读(526) 评论(0) 推荐(0) 编辑
摘要: import pymysql class HandleMysql: ''' 定义一个mysql处理类 ''' def __init__(self, hostname, username, password, database_name, port=3306): ''' 建立数据库连接并创建字典类型游 阅读全文
posted @ 2019-08-18 13:31 小公瑾 阅读(287) 评论(0) 推荐(0) 编辑
摘要: import time import paramiko class HandleParamiko: ''' 定义一个linux处理类 ''' def __init__(self, hostname, password, port=22, username='root'): ''' 构造器 :para 阅读全文
posted @ 2019-08-18 13:26 小公瑾 阅读(566) 评论(0) 推荐(0) 编辑