功能测试套件运行程序

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 Android Action_Edit Intent无法像以前一样调用App Gallery来编辑图片   确保JRE兼容性的java适当程序(32或64位)   java JSONArray。for循环中的add(JSONObject)正在替换for循环中的旧值,数组由循环中的最后一个值组成   java需要帮助创建一个返回数组的方法,该数组的元素是另一个数组的平方   使用SmbFile w/groovy XmlSluper()创建xml。解析()Java   检查大小后的java ArrayIndexOutOfBoundsException   乘法表中的第k个最小元素   java 401 on请求,其中指定了'permitAll()'   java如何附加ORC文件   java hibernate类模型   java IDEA没有看到由自定义注释处理器生成的方法   Servlet中未声明java SerialVersionId   java linkedlist到达列表末尾时   java如何正确对齐EditText光标?   java 6编译器1.6上的eclipse重写方法错误   java如何在基于Jersey的RESTful Web服务中读取post数据   java如何在活动中正确使用接口?   Java的JIT编译器的工作速度有多快?