yaml文件解析步骤如下:
def steps(self, path):
with open(path, encoding="utf-8") as f:
steps = yaml.safe_load(f)
for step in steps:
if "action" in step.keys():
action = step["action"]
if "click" == action:
self.find(step["by"], step["locator"]).click()
if "send" == action:
self.find(step["by"], step["locator"]).send_keys(step["value"])