diff --git a/application.properties b/application.properties index 9108a5d..017ddc1 100644 --- a/application.properties +++ b/application.properties @@ -1,5 +1,5 @@ #Grails Metadata file #Fri Mar 08 09:50:39 CST 2013 -app.grails.version=2.4.4 +app.grails.version=2.5.5 app.name=geb-example app.version=0.2 diff --git a/grails-app/conf/BuildConfig.groovy b/grails-app/conf/BuildConfig.groovy index edcd3db..4d3fd05 100644 --- a/grails-app/conf/BuildConfig.groovy +++ b/grails-app/conf/BuildConfig.groovy @@ -54,11 +54,15 @@ grails.project.dependency.resolution = { test "org.seleniumhq.selenium:selenium-chrome-driver:${webdriverVersion}" test "org.seleniumhq.selenium:selenium-firefox-driver:${webdriverVersion}" test "org.seleniumhq.selenium:selenium-ie-driver:${webdriverVersion}" + test("com.codeborne:phantomjsdriver:1.2.1") { + // phantomjs driver pulls in a different selenium version amongs other stuff it seemed + transitive = false + } test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4" // For downloading browser-specific drivers that browsers like Chrome and IE require - test "io.github.bonigarcia:webdrivermanager:1.3.1" + test "io.github.bonigarcia:webdrivermanager:1.4.8" } plugins { @@ -75,7 +79,7 @@ grails.project.dependency.resolution = { compile ":asset-pipeline:2.3.8" - test ":remote-control:1.5" + test ":remote-control:2.0" test ":geb:${gebVersion}" } } diff --git a/grails-app/conf/Config.groovy b/grails-app/conf/Config.groovy index da37bc4..8153152 100644 --- a/grails-app/conf/Config.groovy +++ b/grails-app/conf/Config.groovy @@ -16,28 +16,24 @@ grails.project.groupId = appName // change this to alter the default package nam // The ACCEPT header will not be used for content negotiation for user agents containing the following strings (defaults to the 4 major rendering engines) grails.mime.disable.accept.header.userAgents = ['Gecko', 'WebKit', 'Presto', 'Trident'] grails.mime.types = [ // the first one is the default format - all: '*/*', // 'all' maps to '*' or the first available format in withFormat - atom: 'application/atom+xml', - css: 'text/css', - csv: 'text/csv', - form: 'application/x-www-form-urlencoded', - html: ['text/html','application/xhtml+xml'], - js: 'text/javascript', - json: ['application/json', 'text/json'], - multipartForm: 'multipart/form-data', - rss: 'application/rss+xml', - text: 'text/plain', - hal: ['application/hal+json','application/hal+xml'], - xml: ['text/xml', 'application/xml'] + all: '*/*', // 'all' maps to '*' or the first available format in withFormat + atom: 'application/atom+xml', + css: 'text/css', + csv: 'text/csv', + form: 'application/x-www-form-urlencoded', + html: ['text/html','application/xhtml+xml'], + js: 'text/javascript', + json: ['application/json', 'text/json'], + multipartForm: 'multipart/form-data', + rss: 'application/rss+xml', + text: 'text/plain', + hal: ['application/hal+json','application/hal+xml'], + xml: ['text/xml', 'application/xml'] ] // URL Mapping Cache Max Size, defaults to 5000 //grails.urlmapping.cache.maxsize = 1000 -// What URL patterns should be processed by the resources plugin -grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*'] -grails.resources.adhoc.includes = ['/images/**', '/css/**', '/js/**', '/plugins/**'] - // Legacy setting for codec used to encode data with ${} grails.views.default.codec = "html" @@ -100,7 +96,7 @@ environments { } // log4j configuration -log4j = { +log4j.main = { // Example of changing the log pattern for the default console appender: // //appenders { @@ -108,14 +104,14 @@ log4j = { //} error 'org.codehaus.groovy.grails.web.servlet', // controllers - 'org.codehaus.groovy.grails.web.pages', // GSP - 'org.codehaus.groovy.grails.web.sitemesh', // layouts - 'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping - 'org.codehaus.groovy.grails.web.mapping', // URL mapping - 'org.codehaus.groovy.grails.commons', // core / classloading - 'org.codehaus.groovy.grails.plugins', // plugins - 'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration - 'org.springframework', - 'org.hibernate', - 'net.sf.ehcache.hibernate' + 'org.codehaus.groovy.grails.web.pages', // GSP + 'org.codehaus.groovy.grails.web.sitemesh', // layouts + 'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping + 'org.codehaus.groovy.grails.web.mapping', // URL mapping + 'org.codehaus.groovy.grails.commons', // core / classloading + 'org.codehaus.groovy.grails.plugins', // plugins + 'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration + 'org.springframework', + 'org.hibernate', + 'net.sf.ehcache.hibernate' } diff --git a/grailsw b/grailsw index c033fa6..6b74176 100755 --- a/grailsw +++ b/grailsw @@ -132,7 +132,7 @@ fi if [ -z "$STARTER_CONF" ]; then STARTER_CONF="$GRAILS_HOME/conf/groovy-starter.conf" fi -STARTER_CLASSPATH="wrapper/grails-wrapper-runtime-2.4.4.jar:wrapper:." +STARTER_CLASSPATH="wrapper/grails-wrapper-runtime-2.5.5.jar:wrapper:." # Allow access to Cocoa classes on OS X if $darwin; then @@ -200,7 +200,7 @@ if $mingw ; then fi if [ -z "$GRAILS_AGENT_CACHE_DIR" ]; then - GRAILS_AGENT_CACHE_DIR=~/.grails/2.4.4/ + GRAILS_AGENT_CACHE_DIR=~/.grails/2.5.5/ fi SPRINGLOADED_PARAMS=profile=grails\;cacheDir=$GRAILS_AGENT_CACHE_DIR if [ ! -d "$GRAILS_AGENT_CACHE_DIR" ]; then @@ -208,7 +208,7 @@ if [ ! -d "$GRAILS_AGENT_CACHE_DIR" ]; then fi # Process JVM args -AGENT_STRING="-javaagent:wrapper/springloaded-1.2.1.RELEASE.jar -Xverify:none -Dspringloaded.synchronize=true -Djdk.reflect.allowGetCallerClass=true -Dspringloaded=$SPRINGLOADED_PARAMS" +AGENT_STRING="-javaagent:wrapper/springloaded-1.2.5.RELEASE.jar -Xverify:none -Dspringloaded.synchronize=true -Djdk.reflect.allowGetCallerClass=true -Dspringloaded=$SPRINGLOADED_PARAMS" CMD_LINE_ARGS="" DISABLE_RELOADING=true diff --git a/grailsw.bat b/grailsw.bat index 3e5aa5e..5ecf769 100644 --- a/grailsw.bat +++ b/grailsw.bat @@ -60,7 +60,7 @@ if "%GRAILS_HOME:~-1%"=="\" SET GRAILS_HOME=%GRAILS_HOME:~0,-1% :init for %%x in ("%USERPROFILE%") do set SHORTHOME=%%~fsx -if "x%GRAILS_AGENT_CACHE_DIR%" == "x" set GRAILS_AGENT_CACHE_DIR=%SHORTHOME%/.grails/2.4.4/ +if "x%GRAILS_AGENT_CACHE_DIR%" == "x" set GRAILS_AGENT_CACHE_DIR=%SHORTHOME%/.grails/2.5.5/ set SPRINGLOADED_PARAMS="profile=grails;cacheDir=%GRAILS_AGENT_CACHE_DIR%" if not exist "%GRAILS_AGENT_CACHE_DIR%" mkdir "%GRAILS_AGENT_CACHE_DIR%" @@ -69,7 +69,7 @@ if "%GRAILS_NO_PERMGEN%" == "" ( if not errorlevel 1 set GRAILS_NO_PERMGEN=1 ) -set AGENT_STRING=-javaagent:wrapper/springloaded-1.2.1.RELEASE.jar -Xverify:none -Dspringloaded.synchronize=true -Djdk.reflect.allowGetCallerClass=true -Dspringloaded=\"%SPRINGLOADED_PARAMS%\" +set AGENT_STRING=-javaagent:wrapper/springloaded-1.2.5.RELEASE.jar -Xverify:none -Dspringloaded.synchronize=true -Djdk.reflect.allowGetCallerClass=true -Dspringloaded=\"%SPRINGLOADED_PARAMS%\" set DISABLE_RELOADING= if "%GRAILS_OPTS%" == "" ( set GRAILS_OPTS=-server -Xmx768M -Xms64M -Dfile.encoding=UTF-8 @@ -140,7 +140,7 @@ set CMD_LINE_ARGS=%$ :execute @rem Setup the command line -set STARTER_CLASSPATH=wrapper/grails-wrapper-runtime-2.4.4.jar;wrapper;. +set STARTER_CLASSPATH=wrapper/grails-wrapper-runtime-2.5.5.jar;wrapper;. if exist "%USERPROFILE%/.groovy/init.bat" call "%USERPROFILE%/.groovy/init.bat" @@ -169,7 +169,7 @@ set JAVA_OPTS=%GRAILS_OPTS% %JAVA_OPTS% %AGENT% set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%" set JAVA_OPTS=%JAVA_OPTS% -Dgrails.home="%GRAILS_HOME%" -set JAVA_OPTS=%JAVA_OPTS% -Dgrails.version=2.4.4 +set JAVA_OPTS=%JAVA_OPTS% -Dgrails.version=2.5.5 set JAVA_OPTS=%JAVA_OPTS% -Dbase.dir=. set JAVA_OPTS=%JAVA_OPTS% -Dtools.jar="%TOOLS_JAR%" set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%" diff --git a/test/functional/GebConfig.groovy b/test/functional/GebConfig.groovy index 32fd65f..79a2145 100644 --- a/test/functional/GebConfig.groovy +++ b/test/functional/GebConfig.groovy @@ -7,9 +7,12 @@ import io.github.bonigarcia.wdm.ChromeDriverManager import io.github.bonigarcia.wdm.InternetExplorerDriverManager +import io.github.bonigarcia.wdm.PhantomJsDriverManager + import org.openqa.selenium.chrome.ChromeDriver import org.openqa.selenium.firefox.FirefoxDriver import org.openqa.selenium.ie.InternetExplorerDriver +import org.openqa.selenium.phantomjs.PhantomJSDriver // http://www.gebish.org/manual/current/configuration.html#waiting_for_base_navigator baseNavigatorWaiting = true @@ -39,4 +42,13 @@ environments { driver = { new InternetExplorerDriver() } } + + phantom { + PhantomJsDriverManager.getInstance().setup() + waiting { + timeout = 2 + } + driver = { new PhantomJSDriver() } + } + } diff --git a/test/functional/geb/example/SimpleTestSpec.groovy b/test/functional/geb/example/SimpleTestSpec.groovy new file mode 100644 index 0000000..19d6c3f --- /dev/null +++ b/test/functional/geb/example/SimpleTestSpec.groovy @@ -0,0 +1,29 @@ +package geb.example + +import geb.spock.GebSpec + +class SimpleTestSpec extends GebSpec { + + def "sanity check list page"() { + given: + go "idea/list" + + expect: "it to contain the basic header" + driver.pageSource.contains("

Idea List

") + + when: + println driver.pageSource + + then: + title == "Idea List" + //pageSource gives entire page + driver.pageSource.contains("

Idea List

") + + when: "create is clicked" + $("div.nav a.create").click() + + then: "make sure it has the right title" + title == "Create Idea" + //driver.pageSource.contains("

Idea List

") + } +} diff --git a/wrapper/grails-wrapper-runtime-2.4.4.jar b/wrapper/grails-wrapper-runtime-2.4.4.jar deleted file mode 100644 index 2f605f3..0000000 Binary files a/wrapper/grails-wrapper-runtime-2.4.4.jar and /dev/null differ diff --git a/wrapper/grails-wrapper-runtime-2.5.5.jar b/wrapper/grails-wrapper-runtime-2.5.5.jar new file mode 100644 index 0000000..64c897e Binary files /dev/null and b/wrapper/grails-wrapper-runtime-2.5.5.jar differ diff --git a/wrapper/grails-wrapper.properties b/wrapper/grails-wrapper.properties index 74391ce..82d01c4 100644 --- a/wrapper/grails-wrapper.properties +++ b/wrapper/grails-wrapper.properties @@ -1 +1 @@ -wrapper.dist.url=http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/ +wrapper.dist.url=https://github.com/grails/grails-core/releases/download/v2.5.5/ diff --git a/wrapper/springloaded-1.2.1.RELEASE.jar b/wrapper/springloaded-1.2.1.RELEASE.jar deleted file mode 100644 index 86b648f..0000000 Binary files a/wrapper/springloaded-1.2.1.RELEASE.jar and /dev/null differ diff --git a/wrapper/springloaded-1.2.5.RELEASE.jar b/wrapper/springloaded-1.2.5.RELEASE.jar new file mode 100644 index 0000000..dee25d6 Binary files /dev/null and b/wrapper/springloaded-1.2.5.RELEASE.jar differ