...
 
Commits (2)
......@@ -26,7 +26,7 @@ import org.asciidoctor.gradle.AsciidoctorTask
plugins {
id 'java'
id 'eclipse'
id 'org.asciidoctor.convert' version '2.0.0'
id 'org.asciidoctor.convert' version '2.4.0'
}
//apply from: 'common.gradle'
......@@ -73,15 +73,15 @@ configurations {
class CheckOFBizIsUp extends DefaultTask {
String ofbizDir = project.rootProject.projectDir
String ofbizUrl
@TaskAction
def spawnProcess() {
int code = -1
URL checkUrl = new URL ( ofbizUrl)
HttpURLConnection connection = ( HttpURLConnection ) checkUrl.openConnection ();
HttpURLConnection connection = ( HttpURLConnection ) checkUrl.openConnection ();
connection.setRequestMethod("GET");
try {
connection.connect () ;
connection.connect () ;
code = connection.getResponseCode() ;
}
catch(ConnectException e) {
......@@ -93,10 +93,10 @@ class CheckOFBizIsUp extends DefaultTask {
builder.redirectErrorStream(true)
builder.directory(new File(ofbizDir))
Process process = builder.start()
InputStream stdout = process.getInputStream()
BufferedReader reader = new BufferedReader(new InputStreamReader(stdout))
def line
while ((line = reader.readLine()) != null) {
println line
......@@ -131,7 +131,7 @@ dependencies {
compile 'org.seleniumhq.selenium:selenium-java:3.141.59'
compile 'org.seleniumhq.selenium:htmlunit-driver:2.32.1'
compile 'com.testingbot:testingbotrest:1.0.5'
// pluginLibsCompile 'junit:junit-dep:4.10'
// pluginLibsCompile 'org.codehaus.groovy:groovy-all:2.4.5'
// pluginLibsCompile 'org.apache.httpcomponents:httpclient:4.5.2'
......@@ -225,13 +225,13 @@ task generateOfbSwdDocumentation(type: AsciidoctorTask) {
//this should check if ofbiz is avaialable at the url defined in seleniul.properties
// OHE 2019.02.12 no more use, currently checking in ofbiz running is done in job
task waitForOfbiz(type: CheckOFBizIsUp) {
Properties props = new Properties()
Properties props = new Properties()
props.load(file('./config/selenium.properties').newDataInputStream())
ofbizUrl props.getProperty('ofbiz.started.test.url')
}
// a task to run one selenium at a time
task runSingleSelenium(type : Test) {
doFirst {
if (!project.hasProperty('testName')) {
throw new GradleException('testName is missing, try with -PtestName=<your class Name>')
......@@ -285,7 +285,7 @@ task injectSeleniumJs () {
def file = "${project.rootProject.projectDir}/framework/common/widget/CommonScreens.xml"
def toReplace = '<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.11.0.min.js" global="true"/>'
def replaceWith = '<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.11.0.min.js" global="true"/>\n <set field="layoutSettings.javaScripts[]" value="/images/selenium.js" global="true" /><!-- added by selenium plugin-->'
replaceTextInFile(file, toReplace, replaceWith)
replaceTextInFile(file, toReplace, replaceWith)
file = "${project.rootProject.projectDir}/framework/common/template/includes/Lookup.ftl"
toReplace = 'document.write("<scr" + "ipt type="text/javascript" src="<@ofbizContentUrl>/images/jquery/jquery-1.11.0.min.js</@ofbizContentUrl>"></scr" + "ipt>");'
......@@ -331,14 +331,14 @@ task injectSeleniumJs () {
toReplace = '<VisualThemeResource visualThemeId="RAINBOWSTONE_AMBER" resourceTypeEnumId="VT_HDR_JAVASCRIPT" resourceValue="/images/jquery/jquery-1.11.0.min.js" sequenceId="02"/>'
replaceWith = '<VisualThemeResource visualThemeId="RAINBOWSTONE_AMBER" resourceTypeEnumId="VT_HDR_JAVASCRIPT" resourceValue="/images/jquery/jquery-1.11.0.min.js" sequenceId="02"/>\n <VisualThemeResource visualThemeId="RAINBOWSTONE_AMBER" resourceTypeEnumId="VT_HDR_JAVASCRIPT" resourceValue="/images/selenium.js" sequenceId="99"/><!-- added by selenium plugin-->'
replaceTextInFile(file, toReplace, replaceWith)
}
}
task install(dependsOn : [injectSeleniumJs]) {
doLast { }
}
task uninstall {
// uninstall logic for this plugin
......