html tool

显示标签为“fitness”的博文。显示所有博文
显示标签为“fitness”的博文。显示所有博文

2018年9月10日星期一

fitness python use linux shell


go 一下,和语言依赖没法直接使用命令,下面这个例子是java的
If you're using Fit, you can try Bob Martin's CommandLineFixture. You can use it by creating a simple test table as follows:
| com.objectmentor.fixtures.CommandLineFixture                |
| command | C:\dev\myFileImporter.exe -f c:\dev\data\file.txt |

https://stackoverflow.com/questions/6113344/fitnesse-command-line-fixture


使用python内置方法,间接shell调用,方法如下:
 1 import subprocess
  2      
  3       
  4 def run_shell(command_list):
  5     print command_list
  6     p = subprocess.Popen(command_list, stdout=subprocess.PIPE)
  7     res = p.communicate()
  8     print res
  9     return res 
 10      
 11 if __name__=="__main__":
 12     run_shell(["bash", "/root/test/get_file"])

2018年8月29日星期三

fitness与robotframework的对比

fitness

  • 优点
    • wiki的testcase管理和test都很方便
    • history的查看很赞
  • 与robotframework对比-少的部分
    • testcase的table中如何添加测试用例说明?
    • table中测试文件的当前路径是什么,如何使用相对位置?
    • 底层访问时,在参数构造时,如何与忽略参数处理?与现在的code合成
      • [popexizhi]这个是代码的设计问题吧?
    • 每个testcase缺少单独的访问时间,这个在异步请求或长时间超时问题上是个很有效的功能
    • 如何在gitlab中保存testcase?  

2018年8月27日星期一

关于fitness的实用性分析

参考: http://www.codexiu.cn/python/blog/802/

【popexizhi: 这个是欠了几年的债,好好分析一下吧。之前听蓝总分析了很久关于fitness的使用,只是耳闻,今年终于在robot中排上了,在golange的test框架选择上,也打算使用一下。BBD和TDD的方式一直是在自己的推荐使用范围中,这个是个非常好的例子,不,应该是实现吧】


Column Fixture

特点:行表格展现形式,一条测试用例对应一行数据
Wiki
!define COMMAND_PATTERN {python "%m" %p}
!define TEST_RUNNER {C:\Python27\PyFIT-0.8a2\fit\FitServer.py} [popexizhi: 这个是框架的位置支持,无论操作系统在指定的位置找到这个 pip的依赖算是安装成功了]
!path E:\selfworkspaces\fitTest [popexizhi:当前的工作目录]
!|ColumnFixtureTest.AddTest |  [popexizhi: 下面的位置和unittest 的使用是一致的,唯一的要求是很在 _typeDict
的定义上有点儿不一样。]
| a| b| add?|
|1|2|3|
|1|3|3|
Python:
from fit.ColumnFixture import ColumnFixture
class AddTest(ColumnFixture):
    _typeDict = {
                  "a":"Int",   【popexizhi ; 这里注意是java的命名习惯吧~】
                  "b":"Int",
                  "add":"Int",
                  }
    def __init__(self):
        ColumnFixture.__init__(self)
        self.a=''
        self.b=''
    def add(self):
        c=self.a+self.b
        return c

2018年6月4日星期一

pyfit - fitness use for python

http://www.codexiu.cn/python/blog/802/
[popexizhi: python slim 只找到了2.6和3.0使用的看来已经很久不更新了:)好可惜啊 ]

PS:fit 依赖包的安装
需要下载安装PyFIT,下载地址https://pypi.python.org/pypi/PyFIT/0.8a2
pip install PyFIT==0.8a2 

参考:https://www.cnblogs.com/muxinyue/p/4225801.html


Column Fixture

特点:行表格展现形式,一条测试用例对应一行数据
Wiki
#test page
!1 This is a demo for fitnesse
!2 Use this page as a reference.
!3 Variable Setup
!define COMMAND_PATTERN {python "%m" %p}
!define TEST_RUNNER {/usr/lib/python2.7/site-packages/fit/FitServer.py}
!path /root/tool/fitness/test/
!|ColumnFixtureTest.AddTest |
| a| b| add?|
|1|2|3|
|1|3|3|
----------------------------------------------------------------------
Python: [popexizhi: ColumnFixtureTest.py ]
from fit.ColumnFixture import ColumnFixture
class AddTest(ColumnFixture):
    _typeDict = {
                  "a":"Int",
                  "b":"Int",
                  "add":"Int",
                  }
    def __init__(self):
        ColumnFixture.__init__(self)
        self.a=''
        self.b=''
    def add(self):
        c=self.a+self.b
        return c


2018年5月24日星期四

fitness log : 修改页面属性



fitness 如何看到Test button

tools -> Properties

修改
Page type 中选择Test

2018年4月17日星期二

fitness 补遗I


http://fitnesse.org/PlugIns
[popexizhi: 在看fitness的 doc,发现一个不同语言支持列表,还是很多样的;这里有个好玩的是,powershell, 很奇怪这个也可以用fitness点进去看了一下,发现https://github.com/konstantinvlasenko/PowerSlim
中提到linux如下,好奇怪的组合,go了一下,确实可以,好吧!看了windows真的是要和linux汇入一条河流了:).

Supported Platforms

  • Windows
  • Linux
  • Ubuntu
]

SLiM servers for different languages/environments 

Plugin or AccessoryAuthorURLDocs
RubySlimby Uncle Bob, Corey Haines, Doug Bradburyhttp://github.com/unclebob/RubySlimvideo Now at Slim version 0.3!
RubySlim for Ruby 1.9.3by Lar Vonkhttps://github.com/lvonk/rubyslimSlim version 0.3!
.Net slimby Mike Stockdalehttp://github.com/jediwhale/fitsharp/downloadsdocs
Python Slimby Tim Baconhttp://pypi.python.org/pypi/waferslimIt's a "0.9" release: while the code is believed to be "feature complete" (tested against fitnesse-20090214) more feedback from wider usage would be welcome ;-)
Transactional Spring Slim Runnerby Gojko Adzichttp://github.com/unclebob/springslimdocs
PhpSlimby Gregor Gramlichhttp://github.com/ggramlich/phpslimVideo Tutorials
CSlim: Slim for C and C++by Doug Bradbury, James Grenning, Uncle Bobhttp://github.com/dougbradbury/cslim/tree/masterSee README in the repository
Objective-C Slimby Eric Meyerhttps://github.com/ericmeyer/ObjectiveCSlimdocs
CocoaPod for Swift, Obj-Cby Paul Stringer, Eric Meyerhttps://github.com/paulstringer/OCSlimProjectCocoaPod for iOS and macOS Xcode Projects (wraps Objective-C Slim). See README in the repository.
Grails FitNesse pluginErik Pragthttp://www.grails.org/plugin/fitnessedocs
.NET Fitby Mike Stockdalehttp://github.com/jediwhale/fitsharp/downloadsdocs
Coffee Script SlimMike Suarezhttps://github.com/limadelic/decaf
Power Shell SlimKonstantin Vlasenkohttps://github.com/konstantinvlasenko/PowerSlimdocs
SmalltalkFitRandy Coulmanhttps://github.com/randycoulman/SmalltalkFitSee README in the repository