功能测试套件运行程序

flunc的Python项目详细描述


flunc:一个用于web应用程序的功能测试套件运行程序。

安装

我们建议安装到Virtualenv中。

您应该可以使用easy_install flunc;或 您可以下载tarball,提取并运行python setup.py develop

编写测试

不及格测试是Twill脚本。

有一个firefox扩展允许您直接记录测试 从你的浏览器中。要安装,请访问

这些测试以XML格式保存。您可以转换这些测试 通过执行

^{tt3}$

当然,您仍然可以手动编写测试。

运行测试

有关运行功能测试的详细信息,请运行flunc --help

默认情况下,flunc将搜索./ftests/以查找测试。你可以改变 这个带有-p--path)选项。

一些示例:

^{tt7}$

http://localhost/运行all.tsite中列出的所有测试

^{tt8}$

运行all.tsuite中列出的针对localhost:8080/some_portal的所有测试

^{tt9}$

使用all.conf运行create_user.twill

^{tt10}$

指定创建和删除用户和项目的特殊套件 在默认主机上

查找测试

个别测试包含在

<test>.twill

一套测试包含在

<suite>.tsuite

套件配置包含在

<suite>.conf

清洁套房是在套房之后运行的,并且位于

<suite>_cleanup.tsuite

更多详细信息请参见Flunc homepage

0.8(2011-04-04)

  • Better behavior for the error case where search path (-p option) is nonexistent or not a directory (egj)
  • Add optional second argument to url_qs command in flunc.urlinspector which, if present, asserts the value of the given querystring parameter, as well as asserting its presence. (egj)
  • Add new command css_len in flunc.xpath which lets you test that a given CSS selector matches exactly N elements in the page (egj)

0.7(2009-10-05)

  • The -D (–define) command-line option now works as documented (egj)

0.6(2009-07-06)

  • Add extension module flunc.urlinspector with a command url_qs for making simple assertions about the current url’s query string (egj)
  • Add notfind_in_css command to flunc.xpath (egj)
  • Display a more meaningful error message for invalid argument-passing syntaxes (egj)
  • Add a zope_cleanup.opencore_user_cleanup method to flush the opencore member cleanup queue when deleting users. No hard failure if you have a version of opencore that doesn’t support this (pw)

0.5(2009-05-05)

  • Add find_in_css command to flunc.xpath module. Use it to find a regex within a given CSS selector, like find_in_xpath (egj)
  • Transfer binary data directly to the twill script for passed-in param values instead of escaping it as a string (cabraham)

0.4(2008-12-18)

  • Add two twill extensions to checkbox.py: not_selected, is_enabled (pw)
  • Change is_selected to work correctly with checkboxes, I think (pw)
  • Change default host to http://localhost (pw)

0.3(2008-06-25)

  • Add a twill extension (flunc.checkbox.is_selected) for making assertions about form defaults (pw)

0.2(2008-04-14)

  • Don’t display BadRequest exceptions when calling zope_delobject() – those are normal and just add a lot of noise (pw)

  • Added twill extension to support xpath. This introduces a dependency on lxml. There is one function added: find_in_xpath (rmarianski)

    find_in_xpath runs a find command on the html result of an xpath expression For example: {{{ extend_with flunc.xpath find_in_xpath “People” “//div[@id=’oc-pageNav’]” }}}

  • Altered the namespace behavior; now there is no leading dot to specify the global namespace. (jhammel)

    Instead, we use a scope-based model:

    1. items (tests, suites, configuration) is first looked up relavent to the current (local) namespace
    2. if they are not found locally, they are looked up in the global namespace

    The dot is still used for namespace separation. So looking up foo.bar will first look for the namespace foo in the local namespace; if this exists, it will try to look up bar in that. If foo is not a namespace relavent to the current one, it will try to look up foo.bar in the global namespace.

  • Added hierarchal namespaces to tests (jhammel)

    Formerly, tests lived in a flat namespace. Using –recursive, one could put all tests under the root directory into a single namespace. Now each directory has a namespace associated with it. Tests or suites with single names refer to items in the same namespace (that is, the same directory). You may refer to the bar test or suite in the foo subdirectory as

    foo.bar

    If a suite has the same name as the subdirectory name, you may refer to it either with the full specification

    foo.foo

    or with shorthand

    foo

    To refer to the global namespace, preface the name of the test, suite, or path with a dot

    .foo.bar

    refers to the bar suite or test under the foo directory under the root directory.

    These changes should be backwards compatible with existing tests and were made to facilitate test organization with the hope of providing the flexibility to manipulate namespaces when tests live in multiple locations on disc.

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

推荐PyPI第三方库


热门话题
java游戏!框架伪造应用程序它实际上做什么?   java如何在JavaFx中显示表视图中的即时更改?   对象类的equals()方法的java重载   xpages介绍如何部署java。IBM Notes中的策略更改   java如何访问侦听器中的另一个视图?   java getDefaultDisplay()的替代方法是什么   java opencv匹配模板   java Android Firebase写入数据时的常量超时   在Java中,如何将包含大量空格的数字字符串转换为一系列Int变量。   带有GUI的swing Java模拟无法运行模拟   java NoSuchElementException在特定的Web端上使用无头铬和硒   java对文件进行迭代,即使文件在目录中也会出现“未找到文件”异常。你能告诉我为什么吗?谢谢   递归Java 8,匿名递归嵌套方法   java为什么我看到枚举常量的字段值会被序列化/反序列化?在哪种情况下,枚举中哪些内容没有序列化?   java在运行sonar scanner和Spotbugs规则时出错,用于单片项目?   java如何检查硬件键盘是否可用?(黑莓)   tile游戏动作侦听器循环中的java错误   sockets Java线程池与高请求场景中的新线程   java如何使用Hibernate注释在联接表上创建索引?