class Meiyin_Port(unittest.TestCase): def setUp(self): logger.info("*************************用例{}开始执行***************************".format(self)) self.headers = {"appId": "wxe36d354edaff0317", "deviceId": "android", "macId": "juLoEbCTWJwtB/qI1MRNW52fYaUb9Bb0K6WZFzy4FE7OlFRd5QCxT6uCXUVRyulMWUOrDgbVPsa2On0oRLtzN5k9GGAMVP+UKNyp26yZimPpvhcRA5BEQfbOI/9lVdByFEXBn5YRMt1nYdD9h4TgGNCW8zmjHY5bJggL8mf7uTo=", "h-nonce": "4a91903c-bbc6-4b9d-a976-8aabd0501c06", "h-system-code": "android", "versionName": "1.6.2.2", 'random':str(random.randint(1000000000, 9000000000)), 'timestamp':str(round(time.time() * 1000)) } self.logger = MeiyinLog().get_log() def tearDown(self): self.logger.info("*************************用例{}执行结束***************************".format(self)) @classmethod def setUpClass(cls): logger.info('************************测试类{}开始运行*************************'.format(cls)) @classmethod def tearDownClass(cls): logger.info('************************测试类{}运行结束*************************'.format(cls))
# -*- coding:utf-8 -*- ''' @versoin:V-1.8.0 @author:xiaobao @file:run.py @time:2020年9月1日 ''' import unittest # from Meiyin_Report import HTMLTestRunner # from HTMLTestRunner import HTMLTestRunner import time from gevent import pywsgi from Common.Common_Log import MeiyinLog logger = MeiyinLog().get_log() if __name__ == '__main__': suite = unittest.TestSuite() suite.addTest( unittest.TestLoader().loadTestsFromName('Test_Case.test_login')) #登录 suite.addTest(unittest.TestLoader().loadTestsFromName( 'Test_Case.Person.test_sign')) #签到 suite.addTest(unittest.TestLoader().loadTestsFromName( 'Test_Case.Person.test_person')) #更改姓名 suite.addTest(unittest.TestLoader().loadTestsFromName( 'Test_Case.Person.test_getmessage')) #获取信息列表 suite.addTest(unittest.TestLoader().loadTestsFromName( 'Test_Case.Person.test_search')) #搜索/查看商品 suite.addTest(unittest.TestLoader().loadTestsFromName( 'Test_Case.Person.test_code')) #验证码验证
#!/usr/bin/python # -*- coding:utf-8 -*- ''' @versoin:V-1.8.0 @author:xiaobao @file:get_rtime.py @time:2020年9月17日 ''' import time, re, os, xlrd from Common.Common_Excel import get_nrows, get_xls from Common.Common_Conf import end_path from Common.Common_Log import MeiyinLog from collections import Counter from Common.Common_Conf import path logger = MeiyinLog().get_log() name = time.strftime("%Y_%m_%d_") + 'test' + '.log' file = path + name # 筛选列表 portlist = [ 'usercenter/sign', 'editUserInfo', 'getMessageGroup', 'productSearch', 'getProductInfo', 'checkCodeIsOk', 'getMineWallet', 'addAlbum', 'delAlbumBatch', 'editAddressNew',