测试调度执行新增预处理阶段,预处理阶段为在执行开始前准备阶段,目前支持对HTTPCookie数据进行清理

This commit is contained in:
azhengzz 2021-03-10 17:31:50 +08:00
parent 9873a775b5
commit 44ee8f39b3
1 changed files with 9 additions and 2 deletions

View File

@ -116,8 +116,8 @@ class AbstractDispatcher(ABC):
report = Report.add(name=element.name, result=REPORT_RESULT.RUNNING, dispatcher_id=self.dispatcher.id)
# 发送调度执行开始信息
emit_dispatcher_start(id=self.dispatcher.id, type=self.trigger_element_type, report_id=report.id)
# 清理http请求的cookie数据
self._clear_http_cookie()
# 调度预处理
self._dispatcher_set_up()
# 创建一条调度子数据
if self.element_type in [ELEMENT_TYPE.PROJECT, ELEMENT_TYPE.MODULE, ELEMENT_TYPE.SCENE]:
# 元素类型为Project、Module、Scene时会在构造函数中直接创建调度子数据。而元素类型Case/Tool/LogicController是在Scene.execute()方法中创建
@ -202,6 +202,13 @@ class AbstractDispatcher(ABC):
self.dispatcher_logger.logger.warning(msg)
raise ManualStopException(msg)
def _dispatcher_set_up(self):
"""调度预处理,执行测试前执行"""
self.dispatcher_logger.logger.info('[执行预处理][开始]')
# 清理http请求的cookie数据
self._clear_http_cookie()
self.dispatcher_logger.logger.info('[执行预处理][结束]')
def _analyse_report_data(self, report):
"""
分析报告数据