功能测试套件运行程序

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在获取数据时忽略模型类中的forign键映射   java为什么Microsoft JDBC驱动程序忽略failoverPartner主机名   java可以下载mozswing文件   java等价于ObjectOutputStream,不仅保存其状态,还保存整个对象?   Java Android LiveData根据其他LiveData调用房间查询   java如何使用jackson jsonNode实现这一点并获得所需的输出   在web服务器上作为web应用程序运行java应用程序?   groovy中java类的元类属性   返回空指针的java图形对象   标头中包含用户名和密码的java SOAP客户端请求   具有堆栈实现和递归的Hanoi算法塔(Java)   java当我运行这两个类时,我的老鼠不会移动   使用图像进行java相似图像搜索   Java8并行流机制   使用单例对象作为枚举元素的java Scala枚举,是否有可能对它们进行迭代?   java Webview更改高度大小   不可序列化对象和函数的java Spark Scala编程   java my app在eclipse中运行良好,而不是在jar中