galen框架api到python的移植
galenp的Python项目详细描述
将galen框架api移植到python。
这个项目是将Galen Frameworkjava api移植到python 语言。
python galen api由三部分组成。使用的一个例子是 如下所示。
Galen远程网络驱动程序
driver=GalenRemoteWebDriver("http://localhost:4444/wd/hub",desired_capabilities=DesiredCapabilities.CHROME)
如上所述,api还公开了remotewebdriver api的一个版本。
检查布局API
Galen().check_layout(driver,"specs/"+specs,included_tags,excluded_tags)
API的这一部分与checkLayout()方法非常相似 在JavaGalenapi类中定义。
层次报告fluent api
TestReport("A galenpy test").add_report_node(info_node("Running layout check for: "+test_name).with_node(warn_node('this is just an example')).with_node(error_node('to demonstrate reporting'))).add_layout_report_node("check "+specs,check_layout_report).finalize()
上面的示例演示如何通过 以流畅的界面方式添加报表节点。在把 各种节点类型,如信息、警告或布局报告、对 finalize()方法的作用是创建一个添加到 报告列表。
生成报告
generate_galen_report('target/report')
在galen布局验证结束时,将在 通过另一个galen api方法调用给定的文件夹。
更多示例
一个显示galenpy使用情况的单独项目可以在 galen-sample-py-tests。