从接口自动化测试框架设计到开发(三)主流程封装
作者:互联网
主流程封装
#Run.Test.py # -*- coding: utf-8 -*- # @Author: jiujiu # @Date: 2020-03-04 16:30:31 # @Last Modified time: 2020-03-04 16:30:31 import sys sys.path.append("G:/uni_test")#添加当前过程的目录 from base.run_method import RunMethod from data.GetData import GetData class RunTest: def __init__(self, arg): self.runmethod = RunMethod() self.data = GetData() #程序执行 def go_on_run(self): res = None #如果有10行,循环遍历每一行,从0行开始 rows_count = self.data.get_case_lines() #排除0行,从第1行开始 for i in range(1,rows_count): url = self.data.get_request_url(i) method = self.data.get_request_method(i) is_run = self.data.get_is_run(i) data = self.data.get_request_data(i) header = self.data.is_header(i) if is_run: res = self.runmethod.run_main(method,url,data,header) return res if __name__ == '__main__': run = RunTest() print(run.go_on_run())
标签:__,封装,get,self,接口,主流程,run,data,method 来源: https://www.cnblogs.com/dydxw/p/12410525.html