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文件,添加下面红色字体部分内容
/* 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环境搭建的更多相关文章
- .NET Core系列 : 1、.NET Core 环境搭建和命令行CLI入门
2016年6月27日.NET Core & ASP.NET Core 1.0在Redhat峰会上正式发布,社区里涌现了很多文章,我也计划写个系列文章,原因是.NET Core的入门门槛相当高, ...
- Azure Service Fabric 开发环境搭建
微服务体系结构是一种将服务器应用程序构建为一组小型服务的方法,每个服务都按自己的进程运行,并通过 HTTP 和 WebSocket 等协议相互通信.每个微服务都在特定的界定上下文(每服务)中实现特定的 ...
- rnandroid环境搭建
react-native 环境搭建具体步骤这个大家已经玩烂了,这个主要是记录下来自己做win7系统遇到的坑 1.com.android.ddmlib.installexception 遇到这个问题,在 ...
- python开发环境搭建
虽然网上有很多python开发环境搭建的文章,不过重复造轮子还是要的,记录一下过程,方便自己以后配置,也方便正在学习中的同事配置他们的环境. 1.准备好安装包 1)上python官网下载python运 ...
- springMVC初探--环境搭建和第一个HelloWorld简单项目
注:此篇为学习springMVC时,做的笔记整理. MVC框架要做哪些事情? a,将url映射到java类,或者java类的方法上 b,封装用户提交的数据 c,处理请求->调用相关的业务处理—& ...
- 【定有惊喜】android程序员如何做自己的API接口?php与android的良好交互(附环境搭建),让前端数据动起来~
一.写在前面 web开发有前端和后端之分,其实android还是有前端和后端之分.android开发就相当于手机app的前端,一般都是php+android或者jsp+android开发.androi ...
- Nexus(一)环境搭建
昨天,成功搭建了自己的 Maven 环境(详见:Maven(一)环境搭建),今天就来研究和探讨下 Nexus 的搭建! 使用背景: 安装环境:Windows 10 -64位 JDK版本:1.7 Mav ...
- 「译」JUnit 5 系列:环境搭建
原文地址:http://blog.codefx.org/libraries/junit-5-setup/ 原文日期:15, Feb, 2016 译文首发:Linesh 的博客:环境搭建 我的 Gith ...
- appium+robotframework环境搭建
appium+robotframework环境搭建步骤(Windows系统的appium自动化测试,只适用于测试安卓机:ios机需要在mac搭建appium环境后测试) 搭建步骤,共分为3部分: 一. ...
随机推荐
- windows下gVim 中文显示为乱码
打开vimrc文件,在vim的安装目录下可以找到该文件: 或在windows下是在vim/gvim下输入:edit $vim/_vimrc. 在文件的末尾添加一句 "set fileenco ...
- Struts2 原理(转载)
图来源于Struts2官方站点,是Struts 2 的整体结构. Struts2框架由3个部分组成:核心控制器FilterDispatcher.业务控制器和用户实现的业务逻辑组件.在这3个部分里,St ...
- VS重置命令:devenv.exe/resetuserdata
VS命令行下执行下面的命令: devenv.exe/resetuserdata
- 51NOD 1810 连续区间 分治 区间计数
1810 连续区间 基准时间限制:1.5 秒 空间限制:131072 KB 分值: 80 区间内所有元素排序后,任意相邻两个元素值差为1的区间称为“连续区间” 如:3,1,2是连续区间,但3, ...
- 解决express video 手机无法播放的问题
http://stackoverflow.com/questions/24976123/streaming-a-video-file-to-an-html5-video-player-with-nod ...
- sap人员编制
[转]中小SAP项目中的人员编制 转自http://w39.itpub.net/post/24/398817 对于SAP项目来说,常有人把项目所需的人员说的很多--每个模块一个内部顾问和一个开发的 ...
- html5 canvas基本用法
通过对canvas的初步了解,经过几天的总结,吧canvas的基本用法总结如下:方便以后查阅 <!doctype html> <html> <head> <m ...
- Zookeeper集群搭建安装
三台 Linux虚拟机,每台都需要安装Jdk环境 1.上传Zookeeper安装包 (比较大 直接上传得了) 或者:wget https://mirrors.tuna.tsinghua.edu.cn/ ...
- servlet串行拦截器实现例子
至于串行过滤器有什么作用,我实在不知.我的理解是它只是说明 过滤器的串行运行方式 需求:当用户没有登录访问更新页面的时候,跳转到登录页面 1.登录页面:login.jsp <%@ page la ...
- 多线程之:volatile变量的一次写操作的过程
一:对volatile修饰的变量进行一次写操作的完整过程 在 java 垃圾回收整理一文中,描述了jvm运行时刻内存的分配.其中有一个内存区域是jvm虚拟机栈,每一个线程运行时都有一个线程栈,线程 ...