用于功能黑盒测试的可编程浏览器
zope.testbrowser的Python项目详细描述
更改
5.3.3(2019-07-02)
- 修复单击选定单选按钮将取消选中它的错误。见 第68期
- 修复另一个可能导致的与beautifulsoup4>;=4.7不兼容的问题 在browser.getLink()的syntaxError中。请参见第61期
5.3.2(2019-02-06)
- 修复可能导致的与美化组4>;=4.7不兼容的问题 在browser.getcontrol()的syntaxerror中。请参见第61期
- 修复一个当您的区域设置无法设置cookie过期日期的错误 不是英国人。请参见第65期
- 修正在2019年1月1日因 硬编码的"未来"日期。请参见第62期
5.3.0(2018-10-10)
- 添加对Python3.7的支持。
- 放弃对Python3.3和3.4的支持。
- 放弃对pystone的支持,因为python 3.7放弃了pystone。所以 browser.lastrequestpystones 不再存在。重命名 .browser.pystonetimer 到 .browser.timer
- 修正checkboxlistcontrol的mechrepr (https://github.com/zopefoundation/zope.testbrowser/pull/46" rel="nofollow">https://github.com/zopefoundation/zope.testbrowser/pull/46 )。
- 将 mechrepr 添加到具有电子邮件类型的输入字段中。 (https://github.com/zopefoundation/zope.testbrowser/pull/47" rel="nofollow">https://github.com/zopefoundation/zope.testbrowser/pull/47)。
5.2.4(2017-11-24)
- 如果表单操作包含查询字符串,则使用get方法修复表单提交 ( https://github.com/zopefoundation/zope.testbrowser/pull/42 )。
- 恢复忽略隐藏元素w按标签搜索时 (https://github.com/zopefoundation/zope.testbrowser/pull/41" rel="nofollow">https://github.com/zopefoundation/zope.testbrowser/pull/41)。
5.2.3(2017-10-18)
- 修复控件上的mechrepr,以始终返回本机str ( https://github.com/zopefoundation/zope.testbrowser/issues/38 )。
5.2.2(2017-10-10)
- 尝试设置 只读控制。
- 修正选择收音机和按索引选择控制选项 ( https://github.com/zopefoundation/zope.testbrowser/issues/31 )。
5.2.1(2017-09-01)
- 从允许的版本中排除 webtest 的2.0.27版本,因为它破坏了一些 试验:
- 使测试适应 webtest 的2.0.28版本,但保持与旧版本的兼容性 版本。
5.2(2017-02-25)
- 修正了处理列表的方法,例如类名列表。 [毛里塔尼亚]
- 修复了浏览器只跟踪http状态重定向的问题 301、302、303和307;不是其他30x状态,如304。
- 修复了将实际文件传递到 add_file
- 将 控件 属性添加到窗体类以列出所有窗体控件。
- 恢复使用部分实际显示的选择框标题的功能。
- 允许在browser.displayValue上设置字符串值而不是列表
- 修复在选定控件上设置空值的问题。
- 支持Python3.6、PyPy2.7和PyPy3.3。
5.1(2017-01-31)
- 别名 .browser.urllib_request.httperror 到 .browser.httperror 更好的API。
5.0.0(2016-09-30)
将大多数博士论文转换为斯芬克斯文档,并发布到 https://zopetestbrowser.readthedocs.io/
内部实现现在使用WebTest而不是Mechanize。 机械化 依赖关系被完全删除。 这是一个向后不兼容的更改。
删除API:
zope.testbrowser.testing.browser(这是一个大的)。
而不是使用zope.testbrowser.testing.browser() 并依赖 它神奇地获取了 zope.app.testing.functional singleton 应用程序,现在必须定义从 zope.testbrowser.wsgi.layer ,覆盖 make-wsgi-u-app方法 创建wsgi应用程序,然后使用 zope.testbrowser.wsgi.browser() 在您的测试中。
(或者您可以自己以任何方式设置wsgi应用程序 并明确地传递给 zope.testbrowser.browser.browser(wsgi_app=my_app) )
示例:如果您的测试文件是这样的
# my/package/tests.py from zope.app.testing.functional import defineLayer from zope.app.testing.functional import FunctionalDocFileSuite defineLayer('MyFtestLayer', 'ftesting.zcml', allow_teardown=True) def test_suite(): suite = FunctionalDocFileSuite('test.txt', ...) suite.layer = MyFtestLayer return suite
现在您必须使用
# my/package/tests.py from unittest import TestSuite import doctest import zope.app.wsgi.testlayer import zope.testbrowser.wsgi class Layer(zope.testbrowser.wsgi.TestBrowserLayer, zope.app.wsgi.testlayer.BrowserLayer): """Layer to prepare zope.testbrowser using the WSGI app.""" layer = Layer(my.package, 'ftesting.zcml', allowTearDown=True) def test_suite(): suite = doctest.DocFileSuite('test.txt', ...) suite.layer = layer return suite
然后将所有测试从
>>> from zope.testbrowser.testing import Browser
>>> from zope.testbrowser.wsgi import Browser
也许这篇博客文章可以帮助你适应这个新版本。 摆脱zope.app.testing
移除模块:
- zope.testbrowser.connection连接
删除不应使用的内部类:
- zope.testbrowser.testing.publisherResponse
- zope.testbrowser.testing.publisherconnection
- zope.testbrowser.testing.publisherHttpHandler
- zope.testbrowser.testing.publisherMechaniZebrowser
- zope.testbrowser.wsgi.wsgicon测试浏览器连接
- zope.testbrowser.wsgi.wsgihttphandler
- zope.testbrowser.wsgi.wsgimechanizebrowser
删除不应该使用的内部属性(这 列表不一定完整:
- 浏览器。
删除设置工具附加功能:
- zope.testbrowser[zope功能测试]
更改的行为:
- testbrowser不再遵循html重定向aka <;meta http equiv="refresh" 。/<;/TT>。这是一个机械化的功能 似乎不是由webtest提供的。
添加对Python3.3、3.4和3.5的支持。
放弃对Python2.5和2.6的支持。
放下 webtest<;=1.3.4 引脚。我们现在需要 webtest>;=2.0.8 。
删除对已弃用的zope.app.testing的依赖性
错误修复:如果您的html包含 <;a>; 没有ref属性的元素 (https://github.com/zopefoundation/zope.testbrowser/pull/3" rel="nofollow">https://github.com/zopefoundation/zope.testbrowser/pull/3)。
4.0.3(2013-09-04)
- 由于某些不兼容和 测试失败
- 使zope.testbrowser可以通过pip安装 ( https://github.com/zopefoundation/zope.testbrowser/issues/6 )。
- 当 browser.handleerrors 为false时,还可以添加 x-wsgiorg.throw\u错误 对环境的影响。 http://wsgi.org/wsgi/specifications/throw_errors
- 防止WebTest始终发送粘贴。在 当browser.handleerrors 是 正确 。这样可以更容易地测试错误页。
- 生成browser.submit()句柄 (https://github.com/zopefoundation/zope.testbrowser/pull/4" rel="nofollow">https://github.com/zopefoundation/zope.testbrowser/pull/4)。
-
来自getcontrol()等的更友好的错误消息:
- 当您指定超出界限的索引时,显示可用的 选择
- 如果找不到任何东西,请显示所有可用的项目
4.0.2(2011-05-25)
- 删除zope.pagetemplate上的测试依赖项。
4.0.1(2011-05-04)
- 在文档中添加如何使用zope.testbrowser.wsgi.browser的提示 测试zope 2/zope 3/bluestream wsgi应用程序。
4.0.0(2011-03-14)
- LP 721252:模糊错误现在显示所有匹配控件。
- 与WebTest集成。 zope.testbrowser.wsgi.browser 是 使用webtest.testapp来驱动wsgi的浏览器实现 申请。这将取代3.11中添加的wsgi_intercept支持。
- 使用webob将测试应用程序重新编写为纯wsgi应用程序。运行 使用基于WebTest的浏览器的现有测试
- 将基于zope.app.testing的浏览器移动到zope.app.testing中(离开 向后兼容导入到位)。在zope.app.testing中发布 3.9.
3.11.1(2011-01-24)
- 固定棕色袋子释放3.11.0。
3.11.0(2011-01-24)
- 添加 wsgi_intercept 支持(来自 zope.app.wsgi.testlayer )。
3.10.4(2011-01-14)
- 将over-the-wire.txt doctest移出testbrowserlayer不 需要或使用它。
- 修复与zope.app.testing 3.8.1的测试兼容性。
3.10.3(2010-10-15)
- 修正了与zope.app.wsgi.testlayer的向后兼容性。
3.10.2(2010-10-15)
- 修复了浏览器中的python 2.7兼容性。handleerrors。
3.10.1(2010-09-21)
- 修正了导致浏览器保留以前内容的错误 这些地方是: -链接。单击() -提交控件。单击() -图像控件。单击() -form.submit()
- 还调整了上述位置的异常消息以匹配 预版本3.4.1消息。
3.10.0(2010-09-14)
- LP 98437:使用 机械化 的内置 提交() 提交表单, 允许 机械化 适当设置"referer:"(sic)头。
- 修复了使用 zope.app.testing 3.8及更高版本运行的测试。
3.9.0(2010-05-17)
- lp 568806:update dependency mechanize>;=0.2.0 ,现在包括 客户机窗体的api。取消使用 urllib2 api(不兼容 与机械化0.2.0相比, 有利于机械化。 感谢John J.Lee提供的修补程序。
- 使用stdlib doctest 模块,而不是zope.testing.doctest
- 注意: 此版本不再与Python2.4完全兼容: handleerrors=false 不再工作。
3.8.1(2010-04-19)
- pin依赖于 机械化 0.2.0在我们有时间调整其API更改之前发布。
- 修正lp 98396:testbrowser错误地解析相对url。
3.8.0(2010-03-05)
- 添加 follow 获取和跟踪链接的便利方法。
3.7.0(2009-12-17)
-
将
zope.app.testing
依赖项移到
publisherconnection
类。zope2指定了它自己的版本
publisherconnection 它不依赖于zope.app.testing - 修正lp 419119:当浏览器没有内容时返回 无 提出一个例外。
3.7.0A1(2009-08-29)
- 将依赖项从zope.app.publisher更新为 zope.browserpage , zope.browserresource 和 zope.ptresource
- 删除对zope.app.principalanotation和 zope.securitypolicy 使用简单的 许可的securitypolicy
- 将zope.app.zcmlfiles上的测试依赖项替换为显式的 最小包集的依赖关系。
- 从ftesting.zcml中删除不需要的zope.app.authentication
- 将依赖项从zope.app.securitypolicy更新为 zope.securitypolicy
3.6.0A2(2009-01-31)
- 将依赖项从 zope.app.folder 更新到 zope.site.folder
- 删除zope.app.component中不必要的测试依赖项
3.6.0A1(2009-01-08)
- 将作者电子邮件更新为zope dev而不是zope3 dev。
- 不再在包含在 <;textarea>; ;修复需要clientform>;=0.2.10(lp 268139)。
- 将cookies属性添加到浏览器中,以便于操作浏览器 饼干。请参见主文档中的简短示例,以及new cookies.txt 文档。
3.5.1(2008-10-10)
- 在python 2.6misi上解决一个 机械化的 / urllib2 错误天然气 超时 请求的属性 基类。
- 解决创建请求对象时的 机械化 / urllib2 错误 无法正确处理片段URL。
3.5.0(2008-03-30)
- 添加一个允许 提供正文和内容类型的测试。这很方便 使用非表单输入(例如json)测试ajax请求。
- 删除供应商导入的 机械化
- 修复导致3.4.0版本之间的http异常回溯不同的错误 和3.4.1.
- 在处理unicode时解决python中的一个bug 字符串。
- 修复3.4.1中引入的在doctests中创建不兼容回溯的错误。 这就需要在源树中添加一个补丁 已发送到机械化项目。
- 通过添加zope.interface和 zope.schema 作为真正的依赖关系
- 修复自上次更新以来未更新的browser.getlink文档 API修改。
- 将已修复错误的测试移动到单独的文件。
- 删除旨在帮助测试服务器的非功能性和未记录的代码 使用虚拟主机。
3.4.2(2007-10-31)
- 解决zopesecuritypolicy折旧警告。
3.4.1(2007-09-01)
- 将依赖项更新为mechanize 0.1.7b 和clientform 0.2.7
- 添加对Python2.5的支持。
3.4.0(2007-06-04)
- 添加禁止在http错误上引发异常的功能 ( raisehttperrors 属性)。
- 使用 重整器。
3.4.0A1(2007-04-22)
初始版本作为一个单独的项目,对应于zope.testbrowser 来自Zope 3.4.0a1