与crossbrowsertesting.com提供的api对话的python库
python-xbtesting的Python项目详细描述
与[crossbrowsertesting.com]提供的api通信的python库(http://crossbrowsertesting.com/)。
免责声明:我与CrossBrowserTesting.com,LLC没有任何关联。
安装
$ pip install python-xbtesting
###先决条件
- simplejson
用法
###设置
>>> from xbtesting import XBTesting >>> XBTesting.username = "your username" >>> XBTesting.password = "your password" >>> xbt = XBTesting()
###检索测试
>>> tests = xbt.get_tests() >>> tests [<xbtesting.xbtesting.XBTest object at 0x1011a3850>, <xbtesting.xbtesting.XBTest object at 0x1011a39d0>, <xbtesting.xbtesting.XBTest object at 0x1011a3a50>, <xbtesting.xbtesting.XBTest object at 0x1011a3b50>, <xbtesting.xbtesting.XBTest object at 0x1011a3b90>] >>> tests[0].id 98765 >>> tests[0].url 'http://your-website.com/' >>> tests[0].test_date datetime.datetime(2010, 12, 13, 8, 4, 28)
####XBText实例的可用属性
- id(int)
- 网址(str)
- 测试日期(日期时间)
###检索测试版本
>>> versions = test[0].get_versions() >>> versions [<xbtesting.xbtesting.XBTestVersion object at 0x1011b8150>, <xbtesting.xbtesting.XBTestVersion object at 0x1011b8190> ] >>> versions[0].id 876543 >>> versions[0].version_date datetime.datetime(2010, 12, 13, 8, 4, 28)
####xbtestversion实例的可用属性
- id(int)
- 测试(xbtest)
- 版本日期(日期时间)
- 计数成功(int)
- 未完成计数(int)
- 公共版网址(str)
- 版本用户界面URL(str)
- 版本压缩(str)
- w3c\u css错误(int)
- w3c\u html错误(int)
- w3c_html_警告(int)
###检索测试版本的结果
>>> results = versions[0].get_results() >>> results [<xbtesting.xbtesting.XBTestVersionResult object at 0x100750650>, <xbtesting.xbtesting.XBTestVersionResult object at 0x100750190>, <xbtesting.xbtesting.XBTestVersionResult object at 0x1007501d0>, <xbtesting.xbtesting.XBTestVersionResult object at 0x100750290>, <xbtesting.xbtesting.XBTestVersionResult object at 0x100750310>, <xbtesting.xbtesting.XBTestVersionResult object at 0x100750350>, <xbtesting.xbtesting.XBTestVersionResult object at 0x100750390>, <xbtesting.xbtesting.XBTestVersionResult object at 0x1007503d0>, <xbtesting.xbtesting.XBTestVersionResult object at 0x100750410>, <xbtesting.xbtesting.XBTestVersionResult object at 0x100750450>, <xbtesting.xbtesting.XBTestVersionResult object at 0x1007504d0>, <xbtesting.xbtesting.XBTestVersionResult object at 0x100750510>] >>> results[0].id 7654321 >>> results[0].finished_date datetime.datetime(2011, 1, 18, 8, 34) >>> results[0].full_page 'http://media.crossbrowsertesting.com/users/12345/screenshots/full/z02129bb861061d1a052.png' >>> results[0].browser 'Firefox 3.5' >>> results[0].os 'Mac OSX 10.5.8' >>> results[0].resolution '1024x768'
####xbtestversionresult实例的可用属性
- id(int)
- 测试版本(xbtestversion)
- 开始日期(日期时间)
- 完成日期(日期时间)
- 状态(str)
- 操作系统(str)
- 浏览器(str)
- 分辨率(str)
- 窗口化(str)
- 窗口化的拇指(str)
- 整页(str)
- 整页大拇指(str)
- 现场测试网址(str)