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文件,添加下面红色字体部分内容

 /* Plan:
- Create multi-module repo:
- fit (deps: common)
- slim (deps: common, networking)
- common
- networking
- ant
- fitnesse, the wiki server
- Move file creation to plugin
*/ buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.1.9'
}
} plugins {
id 'java'
id "maven-publish"
id "com.jfrog.bintray" version "1.6"
} apply plugin: "info.solidsoft.pitest" version = new Date().format('yyyyMMdd') println "Building FitNesse v${project.version}..." repositories {
mavenCentral()
} configurations {
lesscss
optional
compile {
transitive = false
extendsFrom optional
}
runtime {
transitive = false
}
} sourceSets {
main {
java.srcDir 'src'
resources.srcDir 'src'
output.resourcesDir output.classesDir
}
test {
java.srcDir 'test'
}
} sourceCompatibility = '1.7'
targetCompatibility = '1.7' dependencies {
compile "org.htmlparser:htmlparser:2.1"
compile "org.htmlparser:htmllexer:2.1"
compile "org.apache.velocity:velocity:1.7"
compile "commons-lang:commons-lang:2.6"
compile "commons-collections:commons-collections:3.2.2"
compile "org.json:json:20151123"
compile "com.googlecode.java-diff-utils:diffutils:1.3.0"
optional "org.apache.ant:ant:1.9.6"
optional "junit:junit:4.12" testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-core:1.10.19"
testCompile "org.hamcrest:hamcrest-all:1.3"
testCompile "net.javacrumbs.json-unit:json-unit:1.1.6" /*compileOnly files('libs/joda-time-2.3.jar')*/
/*compile fileTree(dir: 'dependencies/compile/archive', include: '*.jar', exclude: 'management.jar')*/
/*compile(files('dependencies/compile/archive/management.jar')){ notPackaged = true } // Excludes it from all publications*/ compile fileTree(dir: 'libs', include: '*.jar')

lesscss "org.mozilla:rhino:1.7.7.1"
} task fitNesseVersion {
def versionFile = new File("${sourceSets.main.output.resourcesDir}/META-INF/FitNesseVersion.txt")
versionFile.parentFile.mkdirs()
versionFile.text="v${version}"
} task compileBootstrap(type: LessCompiler) {
inputDir file('src/fitnesse/resources/bootstrap/less')
mainLessFile = 'fitnesse-bootstrap.less'
cssFile file("${sourceSets.main.output.resourcesDir}/fitnesse/resources/bootstrap/css/fitnesse-bootstrap.css")
classpath configurations.lesscss
} task createUpdateLists(type: WikiFileListBuilderTask) {
outputDirectory = "${sourceSets.main.output.resourcesDir}/Resources"
doNotReplaceFiles = [
"FitNesseRoot/FrontPage/content.txt",
"FitNesseRoot/FrontPage/properties.xml",
"FitNesseRoot/PageHeader/content.txt",
"FitNesseRoot/PageHeader/properties.xml",
"FitNesseRoot/PageFooter/content.txt",
"FitNesseRoot/PageFooter/properties.xml",
"FitNesseRoot/PageFooter/properties.xml",
"FitNesseRoot/TemplateLibrary/content.txt",
"FitNesseRoot/TemplateLibrary/properties.xml",
"FitNesseRoot/TemplateLibrary/StaticPage/content.txt",
"FitNesseRoot/TemplateLibrary/StaticPage/properties.xml",
"FitNesseRoot/TemplateLibrary/SuitePage/content.txt",
"FitNesseRoot/TemplateLibrary/SuitePage/properties.xml",
"FitNesseRoot/TemplateLibrary/TestPage/content.txt",
"FitNesseRoot/TemplateLibrary/TestPage/properties.xml" ]
mainDirectories = [
"FitNesseRoot/FitNesse",
"FitNesseRoot/FrontPage",
"FitNesseRoot/PageFooter",
"FitNesseRoot/PageHeader",
"FitNesseRoot/TemplateLibrary" ]
} processResources.dependsOn "fitNesseVersion", "compileBootstrap", "createUpdateLists" task copyRuntimeLibs(type: Copy) {
into "lib"
from configurations.runtime
} test {
dependsOn copyRuntimeLibs
maxParallelForks 1
} pitest {
targetClasses = ['fit.*', 'fitnesse.*']
pitestVersion = "1.1.10"
threads = 1 // We can not deal with parallel execution yet
outputFormats = ['XML', 'HTML']
} task run(type: JavaExec) {
dependsOn classes, copyRuntimeLibs
classpath = sourceSets.main.runtimeClasspath
main "fitnesseMain.FitNesseMain"
args "-p", "8001", "-e", "0"
} jar {
dependsOn createUpdateLists
into('Resources') {
from('.') {
include 'FitNesseRoot/FitNesse/**/content.txt'
include 'FitNesseRoot/FitNesse/**/properties.xml'
include 'FitNesseRoot/FrontPage/**/content.txt'
include 'FitNesseRoot/FrontPage/**/properties.xml'
include 'FitNesseRoot/PageFooter/**/content.txt'
include 'FitNesseRoot/PageFooter/**/properties.xml'
include 'FitNesseRoot/PageHeader/**/content.txt'
include 'FitNesseRoot/PageHeader/**/properties.xml'
include 'FitNesseRoot/TemplateLibrary/**/content.txt'
include 'FitNesseRoot/TemplateLibrary/**/properties.xml'
}
}
manifest {
attributes("Main-Class": "fitnesseMain.FitNesseMain",
"Implementation-Version": version)
}
} task standaloneJar(type: Jar, dependsOn: jar) {
baseName = 'fitnesse'
classifier = 'standalone'
from {
(configurations.compile - configurations.optional).collect { zipTree(it) }
} {
exclude 'META-INF/**'
}
from jar.outputs.files.collect {
zipTree(it)
}
manifest {
attributes("Main-Class": "fitnesseMain.FitNesseMain",
"Implementation-Version": version)
}
} task acceptanceTest(type: JavaExec) {
mustRunAfter test
onlyIf { dependsOnTaskDidWork() }
classpath = standaloneJar.outputs.files
main "fitnesseMain.FitNesseMain"
args "-o", "-c", "FitNesse.SuiteAcceptanceTests?suite&format=text"
} check.dependsOn acceptanceTest task javadocJar(type: Jar) {
mustRunAfter check
classifier = 'javadoc'
from javadoc
} task sourcesJar(type: Jar) {
mustRunAfter check
classifier = 'sources'
from sourceSets.main.allSource
} clean{
delete "lib"
} publishing {
publications {
FitNesseRelease(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
artifact standaloneJar
groupId 'org.fitnesse'
artifactId 'fitnesse'
pom.withXml {
asNode().get('version') + { url('http://fitnesse.org') }
asNode().appendNode('description', 'The fully integrated standalone wiki, and acceptance testing framework.')
asNode().append(pomLicenses())
asNode().append(pomScm())
asNode().append(pomDevelopers()) // Clean up scope entries added by the pom generator:
asNode().dependencies.'*'.findAll() {
if (it.scope.text() == 'runtime') {
it.remove(it.scope)
}
}
}
}
}
} bintray {
user = System.getenv("BINTRAY_USER") ?: 'Define your Bintray user name in BINTRAY_USER'
key = System.getenv("BINTRAY_API_KEY") ?: 'Define your Bintray BINTRAY_API_KEY'
publications = ['FitNesseRelease']
publish = true
pkg {
repo = System.getenv("BINTRAY_API_KEY") ?: 'edge'
name = 'fitnesse'
userOrg = 'fitnesse'
licenses = ['CPL-1.0']
websiteUrl = 'http://fitnesse.org'
vcsUrl = 'https://github.com/unclebob/fitnesse.git'
publicDownloadNumbers = true
githubRepo = 'unclebob/fitnesse'
version {
name = project.version
desc = "FitNesse release ${project.version}"
vcsTag = project.version
gpg {
sign = true
}
}
}
} wrapper {
gradleVersion = '2.13'
} def pomLicenses() {
new NodeBuilder().licenses {
license {
name 'Common Public License version 1.0'
url 'http://www.opensource.org/licenses/cpl1.0'
distribution 'repo'
}
}
} def pomScm() {
new NodeBuilder().scm {
connection 'scm:git:git://github.com/unclebob/fitnesse.git'
developerConnection 'scm:git:git@github.com:unclebob/fitnesse.git'
url 'scm:git:http://github.com/unclebob/fitnesse'
}
} def pomDevelopers() {
new NodeBuilder().developers {
developer {
id 'unclebob'
name 'Robert C. Martin'
email 'unclebob@cleancoder.com'
}
}
}

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

.\gradlew run

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

 !***< Hidden
!*< Classpath setup
!define TEST_SYSTEM {slim}
!path libs/*.jar
*! '''此处导入后台代码包名'''
!|import |
|com.xebia.incubator.xebium| *! '''测试脚本'''
!| script |selenium driver fixture |
|start browser|firefox|on url |http://www.baidu.com/ |
|ensure |do |open |on|/ |
|ensure |do |type |on|!-//*[@id="kw"]-! |with |Xebium |
|ensure |do |click |on|!-//*[@id="su"-!] |
|ensure |do |waitForElementPresent|on|!-link=Get your webtests in FitNesse with Xebium | Xebia Blog-!|
|stop browser|

测试结果

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

  1. .NET Core系列 : 1、.NET Core 环境搭建和命令行CLI入门

    2016年6月27日.NET Core & ASP.NET Core 1.0在Redhat峰会上正式发布,社区里涌现了很多文章,我也计划写个系列文章,原因是.NET Core的入门门槛相当高, ...

  2. Azure Service Fabric 开发环境搭建

    微服务体系结构是一种将服务器应用程序构建为一组小型服务的方法,每个服务都按自己的进程运行,并通过 HTTP 和 WebSocket 等协议相互通信.每个微服务都在特定的界定上下文(每服务)中实现特定的 ...

  3. rnandroid环境搭建

    react-native 环境搭建具体步骤这个大家已经玩烂了,这个主要是记录下来自己做win7系统遇到的坑 1.com.android.ddmlib.installexception 遇到这个问题,在 ...

  4. python开发环境搭建

    虽然网上有很多python开发环境搭建的文章,不过重复造轮子还是要的,记录一下过程,方便自己以后配置,也方便正在学习中的同事配置他们的环境. 1.准备好安装包 1)上python官网下载python运 ...

  5. springMVC初探--环境搭建和第一个HelloWorld简单项目

    注:此篇为学习springMVC时,做的笔记整理. MVC框架要做哪些事情? a,将url映射到java类,或者java类的方法上 b,封装用户提交的数据 c,处理请求->调用相关的业务处理—& ...

  6. 【定有惊喜】android程序员如何做自己的API接口?php与android的良好交互(附环境搭建),让前端数据动起来~

    一.写在前面 web开发有前端和后端之分,其实android还是有前端和后端之分.android开发就相当于手机app的前端,一般都是php+android或者jsp+android开发.androi ...

  7. Nexus(一)环境搭建

    昨天,成功搭建了自己的 Maven 环境(详见:Maven(一)环境搭建),今天就来研究和探讨下 Nexus 的搭建! 使用背景: 安装环境:Windows 10 -64位 JDK版本:1.7 Mav ...

  8. 「译」JUnit 5 系列:环境搭建

    原文地址:http://blog.codefx.org/libraries/junit-5-setup/ 原文日期:15, Feb, 2016 译文首发:Linesh 的博客:环境搭建 我的 Gith ...

  9. appium+robotframework环境搭建

    appium+robotframework环境搭建步骤(Windows系统的appium自动化测试,只适用于测试安卓机:ios机需要在mac搭建appium环境后测试) 搭建步骤,共分为3部分: 一. ...

随机推荐

  1. .NET MVC 4 实现用户注册功能

    初学MVC,踩了不少坑,所以通过实现一个用户注册功能把近段时间学习到的知识梳理一遍,方便以后改进和查阅. 问题清单: l 为什么EF自动生成的表名后自动添加了s? l 如何为数据库初始化一些数据? l ...

  2. [2011山东ACM省赛] Binomial Coeffcients(求组合数)

    Binomial Coeffcients nid=24#time" style="padding-bottom:0px; margin:0px; padding-left:0px; ...

  3. Nexus 5更新 Android5.0 失败解决方法

    Android 5.0最终推出了正式版,今天也及时刷到了Android5.0 (LRX21O),官方链接:https://developers.google.com/android/nexus/ima ...

  4. 第一个php小程序(学习)

    </pre><pre name="code" class="php"><? php $b=array("name&quo ...

  5. CentOS 安装和配置 Mantis

    Mantis是一个基于PHP技术的轻量级的开源缺陷跟踪系统,以Web操作的形式提供项目管理及缺陷跟踪服务.在功能上.实用性上足以满足中小型项目的管理及跟踪.更重要的是其开源,不需要负担任何费用. 1. ...

  6. 01-bilibilidemo配置

    github-ijkplayer(bilibili)->cd 桌面位置 git clone https://github.com/Bilibili/ijkplayer.git ijkplayer ...

  7. Python数据分析简介

    1,Python作为一门编程语言开发效率快,运行效率被人诟病,但是Python核心部分使用c/c++等更高效的语言来编写的还有强大的numpy, padnas, matplotlib,scipy库等应 ...

  8. Erlang Shell调试网络程序真方便

    Erlang的shell功能强大,这里我将它当成我的客户端.可以动态的输入你需要发送的内容,也可以动态的接收内容,就像调试器一样,在开发过程中起到很重要的作用.具体使用方式如下: C:\Documen ...

  9. EasyDarwin开源流媒体服务器实现RTSP直播同步输出MP4、RTMP、HLS的方案思路

    背景 近期跟开源团队商量,想在EasyDarwin上继续做一些功能扩展,目前EasyDarwin开源流媒体服务器只能够实现高效的RTSP推流直播转发/分发功能,输入与输出都是RTSP/RTP流,不能够 ...

  10. EasyDarwin开源音频解码项目EasyAudioDecoder:基于ffmpeg的安卓音频(AAC、G726)解码库(第一部分,ffmpeg-android的编译)

    ffmpeg是一套开源的,完整的流媒体解决方案.基于它可以很轻松构建一些强大的应用程序.对于流媒体这个行业,ffmpeg就像圣经一样的存在.为了表达敬意,在这里把ffmpeg官网的一段简介搬过来,ff ...