从bdd规范创建动态文档
livingdocs的Python项目详细描述
使用python bdd测试运行程序,如behave,创建living 来自bdd功能文件的文档。此库将创建 包含有关bdd规范和 有助于为您的实时文档生成一个静态站点。
当前支持的文档类型:
- *.mmark文件(由Hugo使用)
快速启动
使用cli命令livingdocs配置hugo站点:
$ livingdocs Your site's title: <enter title> Your site's description: <enter description> ....
这将在根目录中创建一个livingdocs文件夹 将有一个雨果骨架创建一个静态网站。
使用像behave这样的测试运行程序,可以为每个 功能、场景和步骤。在environment.py中,可以使用 获取此信息的接线员:
from livingdocs.maker import DocsMaker def before_all(context): context.docs = DocsMaker('feature') def before_scenario(context, scenario): context.docs.start_scenario(context, scenario) def after_scenario(context, scenario): context.docs.end_scenario(context, scenario) def before_feature(context, feature): context.docs.start_feature(context, feature) def after_feature(context, feature): context.docs.end_feature(context, feature) def before_step(context, step): context.docs.start_step(context, step) def after_step(context, step): """ if context.browser is an instance of Selenium Webdriver, then it will take a snapshot of this step. """ context.docs.end_step(context, step)
开发
首先创建一个虚拟环境,然后要运行测试,请使用:
tox -e py27
许可证
- BSD许可证
变更日志
0.2.0(2016-09-16)
- 功能-添加了cli命令以生成静态站点
0.1.3(2016-09-13)
- 错误修复-功能文件名路径可以是嵌套目录
0.1.2(2016-08-21)
- 不要在基本安装设置中包含枕头(或PIL)。
0.1.1(2016-08-21)
- 安装期间安装了要求。
0.1.0(2016-08-21)
- pypi上的第一个版本。