用于查找/执行ghost inspector测试
pytest-ghostinspector的Python项目详细描述
#pytest鬼检查员
用于发现并执行[ghost inspector](https://ghostinspector.com/)测试。
##功能
Pytest GhostInspector是一个利用Pytest的插件 框架和测试运行器来执行ghost检查器测试 通过他们的rest api。不是标准测试代码,而是创建 通过ghost检查器测试功能性web应用程序 ui和/或测试记录器,然后指定套件或单个 使用yaml配置文件或命令行执行的测试 论据。api密钥和任何必要的测试变量是 也可以指定为命令行参数或 pytest.ini文件。
##要求
- 适用于Python 2.6-3.5
- Ghost Inspector帐户和API密钥
##安装
通常的…
$ pip install pytest-ghostinspector
##用法
此插件向py.test添加了几个命令行参数:
ghostinspector: --gi_key=GI_KEY Set the value for the Ghost Inspector API key --gi_start_url=GI_START_URL Override the starting url value for the Ghost Inspector tests --gi_suite=GI_SUITE Id of a Ghost Inspector suite to execute --gi_test=GI_TEST Id of a Ghost Inspector test to execute --gi_param=GI_PARAM Querystring param (repeatable) to include in the API execute request. Example: "--gi_param foo=bar"
###通过命令行选项
安装之后,执行ghost inspector测试的最简单方法是通过 py.test的命令行选项:
$ py.test --gi_key=hjkl1234 --gi_test=asdf0987
输出应该类似于:
============================== test session starts ============================= platform linux2 -- Python 2.7.10, pytest-2.8.3, py-1.4.30, pluggy-0.3.1 rootdir: /path/to/cwd, inifile: plugins: ghostinspector-0.1.0 collected 1 items . . ============================ 1 passed in 26.34 seconds =========================
###通过yaml测试文件
如果您有足够大的测试或套件集合,则可以创建 包含id和插件的yaml测试文件将收集 执行它们:
# gi_test_my_tests.yml suites: - id: abcd1234 - id: fdsa9876 tests: - id: qwer4567
然后将py.test指向yaml文件:
$ py.test gi_tests/gi_test_my_tests.yml
###pytest.ini
为了避免键入常见选项,如–gi_key,请将它们包含在
pytest.ini带有addopts的文件
###收集模式 v0.4.0引入了–gi_collect_mode选项来控制插件
处理测试集合。选项是: ids[pytest]
...
addopts =
--gi_key=abcd1234
--gi_param foo=bar
默认情况下,如果未显式通过任何模式,则包含–gi test/–gi suite将触发ids模式。
##开发
我们非常欢迎您的贡献。测试可以用毒物进行。
##许可证
Pytest GhostInspector是根据麻省理工学院许可证条款发行的免费开源软件。
##版权所有
2015年哈佛大学校长和研究员
##帽子提示
这个插件是用[cookiecutter]生成的(https://github.com/audreyr/cookiecutter) 以及@hackebrot的[cookiecutter pytest plugin](https://github.com/pytest-dev/cookiecutter-pytest-plugin)模板。