用于查找/执行ghost inspector测试

pytest-ghostinspector的Python项目详细描述


#pytest鬼检查员

[![生成状态](https://travis-ci.org/harvard-dce/pytest-ghostinspector.svg?branch=master)](https://travis-ci.org/harvard-dce/pytest-ghostinspector

用于发现并执行[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的文件

[pytest]
...
addopts =
    --gi_key=abcd1234
    --gi_param foo=bar

###收集模式

v0.4.0引入了–gi_collect_mode选项来控制插件 处理测试集合。选项是:

  • “all”-通过–gi test/–gi suite选项指定gi测试,并启用标准文件系统测试发现功能
  • “文件”-通过–gi test/–gi suite
  • 禁用gi api收集
  • “ids”-禁用文件系统测试发现;仅收集通过–gi test/标识的测试–gi suite

ids模式在您只想使用插件的情况下非常有用 执行一组已知的测试和/或套件,并跳过通过搜索cwd可能找到的任何测试。

默认情况下,如果未显式通过任何模式,则包含–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)模板。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用Eclipse Helios for Web项目   java指定行。作为编译器设置的分隔符?   osm映射中带有osmdroid的java标记   java Android ClassNotFoundException在路径:DexPathList上未找到类   java从j2me调用GWT方法   更新到java 8后的aspectj问题   如何仅从根元素java,com提取文本内容。滴虫软件。是的。html   安卓公司。谷歌。火基。数据库DatabaseException:未能转换java类型的值。将字符串改为长字符串   从java中的方法返回arraylist变量   java如果将引用重新分配给同步块内的锁对象,会是什么?   java下载。使用spring mvc的资源文件中的xlsx文件   java Eclipse提供了什么工具来运行Eclipse中未包含的程序?   spring boot Java泛型如何读取传递给泛型方法的类型上的字段或调用方法   Javacard中的javaecdsa签名