Fitnesse + Xebium环境搭建

1.在搭建Fitnesse + Xebium环境之前先将selenium基础环境搭建完成并调试成功

参照:http://www.cnblogs.com/moonpool/p/5480724.html

2.把Xebium集成到Fitnesse中

a. 搭建Fitnesse环境

参照:http://www.cnblogs.com/moonpool/p/5765307.html

b.下载Xebium

下载地址:http://xebia.github.io/Xebium/

c. 导入eclipse,如下图,Import->Maven->Existing Maven Projects方式导入Xebium项目

d.将xebium项目中src/main/java下文件拷贝到Fitnesse项目的src下面

在eclipse中刷新Fitnesse项目

e. 导入依赖包,在Fitnesse中新建一个libs目录(和lib目录平级),在libs中放入下面的jar包,并导入Fitnesse项目,下面的jar包都可以在selenium-java-2.53.0.zip和Xibum项目中找到。

下面的jar包也可以在http://pan.baidu.com/s/1kUZajOV直接下载

f. 配置build.gradle文件,添加下面红色字体部分内容

  1 /* Plan:
  2  - Create multi-module repo:
  3    - fit (deps: common)
  4    - slim (deps: common, networking)
  5    - common
  6    - networking
  7    - ant
  8    - fitnesse, the wiki server
  9  - Move file creation to plugin
 10 */
 11
 12 buildscript {
 13     repositories {
 14         mavenCentral()
 15     }
 16     dependencies {
 17         classpath ‘info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.1.9‘
 18     }
 19 }
 20
 21 plugins {
 22   id ‘java‘
 23   id "maven-publish"
 24   id "com.jfrog.bintray" version "1.6"
 25 }
 26
 27 apply plugin: "info.solidsoft.pitest"
 28
 29
 30 version = new Date().format(‘yyyyMMdd‘)
 31
 32 println "Building FitNesse v${project.version}..."
 33
 34 repositories {
 35   mavenCentral()
 36 }
 37
 38 configurations {
 39   lesscss
 40   optional
 41   compile {
 42     transitive = false
 43     extendsFrom optional
 44   }
 45   runtime {
 46     transitive = false
 47   }
 48 }
 49
 50 sourceSets {
 51   main {
 52     java.srcDir ‘src‘
 53     resources.srcDir ‘src‘
 54     output.resourcesDir output.classesDir
 55   }
 56   test {
 57     java.srcDir ‘test‘
 58   }
 59 }
 60
 61 sourceCompatibility = ‘1.7‘
 62 targetCompatibility = ‘1.7‘
 63
 64 dependencies {
 65   compile "org.htmlparser:htmlparser:2.1"
 66   compile "org.htmlparser:htmllexer:2.1"
 67   compile "org.apache.velocity:velocity:1.7"
 68   compile "commons-lang:commons-lang:2.6"
 69   compile "commons-collections:commons-collections:3.2.2"
 70   compile "org.json:json:20151123"
 71   compile "com.googlecode.java-diff-utils:diffutils:1.3.0"
 72   optional "org.apache.ant:ant:1.9.6"
 73   optional "junit:junit:4.12"
 74
 75   testCompile "junit:junit:4.12"
 76   testCompile "org.mockito:mockito-core:1.10.19"
 77   testCompile "org.hamcrest:hamcrest-all:1.3"
 78   testCompile "net.javacrumbs.json-unit:json-unit:1.1.6"
 79
 80   /*compileOnly files(‘libs/joda-time-2.3.jar‘)*/
 81   /*compile fileTree(dir: ‘dependencies/compile/archive‘, include: ‘*.jar‘, exclude: ‘management.jar‘)*/
 82   /*compile(files(‘dependencies/compile/archive/management.jar‘)){ notPackaged = true  } // Excludes it from all publications*/
 83
 84   compile fileTree(dir: ‘libs‘, include: ‘*.jar‘)
 85
 86   lesscss "org.mozilla:rhino:1.7.7.1"
 87 }
 88
 89 task fitNesseVersion {
 90   def versionFile = new File("${sourceSets.main.output.resourcesDir}/META-INF/FitNesseVersion.txt")
 91   versionFile.parentFile.mkdirs()
 92   versionFile.text="v${version}"
 93 }
 94
 95 task compileBootstrap(type: LessCompiler) {
 96   inputDir file(‘src/fitnesse/resources/bootstrap/less‘)
 97   mainLessFile = ‘fitnesse-bootstrap.less‘
 98   cssFile file("${sourceSets.main.output.resourcesDir}/fitnesse/resources/bootstrap/css/fitnesse-bootstrap.css")
 99   classpath configurations.lesscss
100 }
101
102 task createUpdateLists(type: WikiFileListBuilderTask) {
103   outputDirectory = "${sourceSets.main.output.resourcesDir}/Resources"
104   doNotReplaceFiles = [
105     "FitNesseRoot/FrontPage/content.txt",
106     "FitNesseRoot/FrontPage/properties.xml",
107     "FitNesseRoot/PageHeader/content.txt",
108     "FitNesseRoot/PageHeader/properties.xml",
109     "FitNesseRoot/PageFooter/content.txt",
110     "FitNesseRoot/PageFooter/properties.xml",
111     "FitNesseRoot/PageFooter/properties.xml",
112     "FitNesseRoot/TemplateLibrary/content.txt",
113     "FitNesseRoot/TemplateLibrary/properties.xml",
114     "FitNesseRoot/TemplateLibrary/StaticPage/content.txt",
115     "FitNesseRoot/TemplateLibrary/StaticPage/properties.xml",
116     "FitNesseRoot/TemplateLibrary/SuitePage/content.txt",
117     "FitNesseRoot/TemplateLibrary/SuitePage/properties.xml",
118     "FitNesseRoot/TemplateLibrary/TestPage/content.txt",
119     "FitNesseRoot/TemplateLibrary/TestPage/properties.xml" ]
120   mainDirectories = [
121     "FitNesseRoot/FitNesse",
122     "FitNesseRoot/FrontPage",
123     "FitNesseRoot/PageFooter",
124     "FitNesseRoot/PageHeader",
125     "FitNesseRoot/TemplateLibrary" ]
126 }
127
128 processResources.dependsOn "fitNesseVersion", "compileBootstrap", "createUpdateLists"
129
130 task copyRuntimeLibs(type: Copy) {
131   into "lib"
132   from configurations.runtime
133 }
134
135 test {
136   dependsOn copyRuntimeLibs
137   maxParallelForks 1
138 }
139
140 pitest {
141   targetClasses = [‘fit.*‘, ‘fitnesse.*‘]
142   pitestVersion = "1.1.10"
143   threads = 1 // We can not deal with parallel execution yet
144   outputFormats = [‘XML‘, ‘HTML‘]
145 }
146
147 task run(type: JavaExec) {
148   dependsOn classes, copyRuntimeLibs
149   classpath = sourceSets.main.runtimeClasspath
150   main "fitnesseMain.FitNesseMain"
151   args "-p", "8001", "-e", "0"
152 }
153
154 jar {
155   dependsOn createUpdateLists
156   into(‘Resources‘) {
157     from(‘.‘) {
158       include ‘FitNesseRoot/FitNesse/**/content.txt‘
159       include ‘FitNesseRoot/FitNesse/**/properties.xml‘
160       include ‘FitNesseRoot/FrontPage/**/content.txt‘
161       include ‘FitNesseRoot/FrontPage/**/properties.xml‘
162       include ‘FitNesseRoot/PageFooter/**/content.txt‘
163       include ‘FitNesseRoot/PageFooter/**/properties.xml‘
164       include ‘FitNesseRoot/PageHeader/**/content.txt‘
165       include ‘FitNesseRoot/PageHeader/**/properties.xml‘
166       include ‘FitNesseRoot/TemplateLibrary/**/content.txt‘
167       include ‘FitNesseRoot/TemplateLibrary/**/properties.xml‘
168     }
169   }
170   manifest {
171     attributes("Main-Class": "fitnesseMain.FitNesseMain",
172         "Implementation-Version": version)
173   }
174 }
175
176 task standaloneJar(type: Jar, dependsOn: jar) {
177   baseName = ‘fitnesse‘
178   classifier = ‘standalone‘
179   from {
180     (configurations.compile - configurations.optional).collect { zipTree(it) }
181   } {
182     exclude ‘META-INF/**‘
183   }
184   from jar.outputs.files.collect {
185     zipTree(it)
186   }
187   manifest {
188     attributes("Main-Class": "fitnesseMain.FitNesseMain",
189         "Implementation-Version": version)
190   }
191 }
192
193 task acceptanceTest(type: JavaExec) {
194   mustRunAfter test
195   onlyIf { dependsOnTaskDidWork() }
196   classpath = standaloneJar.outputs.files
197   main "fitnesseMain.FitNesseMain"
198   args "-o", "-c", "FitNesse.SuiteAcceptanceTests?suite&format=text"
199 }
200
201 check.dependsOn acceptanceTest
202
203 task javadocJar(type: Jar) {
204   mustRunAfter check
205   classifier = ‘javadoc‘
206   from javadoc
207 }
208
209 task sourcesJar(type: Jar) {
210   mustRunAfter check
211   classifier = ‘sources‘
212   from sourceSets.main.allSource
213 }
214
215 clean{
216   delete "lib"
217 }
218
219 publishing {
220   publications {
221     FitNesseRelease(MavenPublication) {
222       from components.java
223       artifact sourcesJar
224       artifact javadocJar
225       artifact standaloneJar
226       groupId ‘org.fitnesse‘
227       artifactId ‘fitnesse‘
228       pom.withXml {
229         asNode().get(‘version‘) + { url(‘http://fitnesse.org‘) }
230         asNode().appendNode(‘description‘, ‘The fully integrated standalone wiki, and acceptance testing framework.‘)
231         asNode().append(pomLicenses())
232         asNode().append(pomScm())
233         asNode().append(pomDevelopers())
234
235         // Clean up scope entries added by the pom generator:
236         asNode().dependencies.‘*‘.findAll() {
237           if (it.scope.text() == ‘runtime‘) {
238             it.remove(it.scope)
239           }
240         }
241       }
242     }
243   }
244 }
245
246 bintray {
247   user = System.getenv("BINTRAY_USER") ?: ‘Define your Bintray user name in BINTRAY_USER‘
248   key = System.getenv("BINTRAY_API_KEY") ?: ‘Define your Bintray BINTRAY_API_KEY‘
249   publications = [‘FitNesseRelease‘]
250   publish = true
251   pkg {
252     repo = System.getenv("BINTRAY_API_KEY") ?: ‘edge‘
253     name = ‘fitnesse‘
254     userOrg = ‘fitnesse‘
255     licenses = [‘CPL-1.0‘]
256     websiteUrl = ‘http://fitnesse.org‘
257     vcsUrl = ‘https://github.com/unclebob/fitnesse.git‘
258     publicDownloadNumbers = true
259     githubRepo = ‘unclebob/fitnesse‘
260     version {
261       name = project.version
262       desc = "FitNesse release ${project.version}"
263       vcsTag = project.version
264       gpg {
265         sign = true
266       }
267     }
268   }
269 }
270
271 wrapper {
272   gradleVersion = ‘2.13‘
273 }
274
275 def pomLicenses() {
276   new NodeBuilder().licenses {
277     license {
278       name ‘Common Public License version 1.0‘
279       url ‘http://www.opensource.org/licenses/cpl1.0‘
280       distribution ‘repo‘
281     }
282   }
283 }
284
285 def pomScm() {
286   new NodeBuilder().scm {
287     connection ‘scm:git:git://github.com/unclebob/fitnesse.git‘
288     developerConnection ‘scm:git:[email protected]:unclebob/fitnesse.git‘
289     url ‘scm:git:http://github.com/unclebob/fitnesse‘
290   }
291 }
292
293 def pomDevelopers() {
294   new NodeBuilder().developers {
295     developer {
296       id ‘unclebob‘
297       name ‘Robert C. Martin‘
298       email ‘[email protected]‘
299     }
300   }
301 }

g. 重新启动Fitnesse,通过命令行进入fitnesse-master并使用下面的命令运行:

.\gradlew run

3. 在Fitnesse中新建一个test输入下面内容

 1 !***< Hidden
 2 !*< Classpath setup
 3 !define TEST_SYSTEM {slim}
 4 !path libs/*.jar
 5 *!
 6
 7
 8
 9
10 ‘‘‘此处导入后台代码包名‘‘‘
11 !|import                   |
12 |com.xebia.incubator.xebium|
13
14
15 *!
16
17
18 ‘‘‘测试脚本‘‘‘
19 !| script     |selenium driver fixture                             |
20 |start browser|firefox|on url    |http://www.baidu.com/            |
21 |ensure       |do     |open      |on|/                             |
22 |ensure       |do     |type      |on|!-//*[@id="kw"]-!  |with  |Xebium  |
23 |ensure       |do     |click     |on|!-//*[@id="su"-!]                  |
24 |ensure       |do     |waitForElementPresent|on|!-link=Get your webtests in FitNesse with Xebium | Xebia Blog-!|
25 |stop browser|

测试结果

时间: 2024-10-25 04:10:34

Fitnesse + Xebium环境搭建的相关文章

一、环境搭建

1 更新到最新版本的pip(这是安装python扩展包的一个插件)命令如下: python -m pip install --upgrade pip 2 使用pip安装virtualenv,命令 pip install virtualenv  如果要指定版本号,pip install virtualenv==15.0.1(安装虚拟环境) 3 创建django虚拟环境,命令 virtualenv django_basic_venv 4 使用虚拟环境 需要进入到安装目录的Scripts文件夹下,运行

Ionic2环境搭建及文件目录介绍

[注]引用自:http://blog.csdn.net/jasonzds/article/details/53821184 1环境搭建 一年前研究混合框架,初步确定了四种方案给公司选择,ionic,hbuilder,wex5,react-native这四个框架各有优缺点,ionic和react-native是国外框架,相对好一点,文档更新很快,就不一一说了,大概的思路都是一样的,js逻辑实现,同时调用原生功能,h5,css3 UI实现,其实他们都有自己的ui框架,当时选择了国内的hbuiler,

Selenium+Java+Eclipse 自动化测试环境搭建

一.下载Java windows java下载链接 https://www.java.com/zh_CN/download/win10.jsp 二.安装Java 安装好后检查一下需不需要配置环境变量,现在java 8已经不用配置环境变量了,直接在命令行输入:java -version 三.下载和安装Eclipse windows Eclipse下载链接 https://www.eclipse.org/downloads/ 你也可以下载绿色版 四.下载selenium,然后解压 selenium

Qt在Mac OS X下的编程环境搭建(配置Qt库和编译器,有图,很清楚)

尊重作者,支持原创,如需转载,请附上原地址:http://blog.csdn.net/libaineu2004/article/details/46234079 在Mac OS X下使用Qt开发,需要配置Qt库和编译器.编译器只能使用苹果公司自主研发的Clang.1.分别下载并安装XCode和Command Line Tools(必须安装),安装完毕后,Clang就有了. https://developer.apple.com/downloads/ 2.下载Qt并默认安装 http://down

基于 Eclipse 的 MapReduce 开发环境搭建

文 / vincentzh 原文连接:http://www.cnblogs.com/vincentzh/p/6055850.html 上周末本来要写这篇的,结果没想到上周末自己环境都没有搭起来,运行起来有问题的呢,拖到周一才将问题解决掉.刚好这周也将之前看的内容复习了下,边复习边码代码理解,印象倒是很深刻,对看过的东西理解也更深入了. 目录 1.概述 2.环境准备 3.插件配置 4.配置文件系统连接 5.测试连接 6.代码编写与执行 7.问题梳理 7.1 console 无日志输出问题 7.2

ICE分布式文件管理系统——ICE环境搭建(其二)

上一博文,我们讲述了ICE这个中间件的基本认识. 接下来我们讲述开发环境搭建. 其过程主要分为三步: 安装GCC-4.4.6.安装ICE-3.4.2.安装QT-4.7.3. (本文是基于LINUX下的ICE-3.4.2的安装,如果已安装了GCC(版本高于GCC-4.4.6亦可),请直接安装ICE) 一.安装GCC: (gcc各版本浏览地址:http://ftp.gnu.org/gnu/gcc/) 一般来说基于linux的操作系统都是默认安装了GCC的.假如说你的电脑没有的话 请百度一哈,可以解决

[Step-By-Step Angular2](1)Hello World与自动化环境搭建

随着rc(release candidate,候选版本)版本的推出,万众瞩目的angular2终于离正式发布不远啦!五月初举办的ng-conf大会已经过去了整整一个月,大多数api都如愿保持在了相对稳定的状态——当然也有router这样的例外,在rc阶段还在大面积返工,让人颇为不解——不过总得说来,现在学习angular2不失为一个恰当的时机. Google为angular2准备了完善的文档和教程,按理说,官网(https://angular.io)自然是学习新框架的最好教材.略显遗憾的是,在B

Linux交叉开发环境搭建 —— 效率之源

楼主今天终于把所有Linux开发环境需要的软件下载完毕了.虽然以前也是搭建过的,时间久了又折腾了一晚上. 交叉环境: Windows.Linux文件共享 SecureCRT 连接虚拟机终端 工具: VirtualBox ubuntu-16.04-desktop-amd64.iso(ubuntu官网下载) SecureCRT Source Insight 虚拟机搭建: 检查bios虚拟技术功能开启 新建虚拟机,选择创建虚拟硬盘,其余均默认 点击新建虚拟机设置->存储->选中没有光盘->点击

Intellij IDEA 14.1.4 Scala开发环境搭建

主要内容 Intellij IDEA开发环境简介 Intellij IDEA Scala开发环境搭建 Intellij IDEA常见问题及解决方案 Intellij IDEA常用快捷键 1. Intellij IDEA开发环境简介 具体介绍请参见:http://baike.baidu.com/link?url=SBY93H3SPkmcmIOmZ8H60O1k4iVLgOmdqoKdGp9xHtU-Pbdsq2cpn75ZPZPWAJxeUlwr0ravraQzOckh777beq Intelli