Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SeleniumRcGrailsPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class SeleniumRcGrailsPlugin {

def version = "1.0.2"
def version = "1.0.2.StartSelenium-Fix"
def grailsVersion = "1.2.0 > *"
def dependsOn = [:]
def pluginExcludes = [
Expand Down
9 changes: 7 additions & 2 deletions scripts/_Selenium.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ target(registerSeleniumTestType: "Registers the selenium test type with the appr
}

target(startSelenium: "Starts Selenium and launches a browser") {
startSeleniumServer()
if( seleniumConfig.selenium.server.start ) {
startSeleniumServer()
}

// this isn't done in initial config construction as it requires app config to be loaded and use of -clean can cause problems
depends(determineSeleniumUrl)
Expand All @@ -54,7 +56,10 @@ target(stopSelenium: "Stops Selenium") {
event "StatusUpdate", ["Stopping Selenium session"]
seleniumRunner.stopSelenium()
selenium = null
stopSeleniumServer()

if( seleniumConfig.selenium.server.start ) {
stopSeleniumServer()
}
}

target(registerSeleniumTestListeners: "Registers listeners for the Selenium test lifecycle") {
Expand Down
2 changes: 2 additions & 0 deletions scripts/_SeleniumConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import grails.util.GrailsUtil
seleniumUrl = null
seleniumConfig = null


target(loadSeleniumConfig: "Loads Selenium config into seleniumConfig variable") {
event "StatusUpdate", ["loading selenium config"]
depends(loadDefaultConfig, mergeApplicationConfig, mergeSystemProperties)
Expand All @@ -36,6 +37,7 @@ selenium {
slow = false
singleWindow = true
windowMaximize = false
startSeleniumServer = true
screenshot {
dir = "${testReportsDir.path.replace(File.separator, '/')}/screenshots"
onFail = false
Expand Down
6 changes: 6 additions & 0 deletions src/templates/conf/SeleniumConfigTemplate.groovy
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
selenium {

/*
slow = false // true to run tests in slow resources mode
singleWindow = true // true for single window mode, false for multi-window mode
browser = "*firefox" // can include full path to executable, default value is *firefox or *iexplore on Windows
url = null // the base URL for tests, defaults to Grails server url
defaultTimeout = 60000 // the timeout after which selenium commands will fail
windowMaximize = false // true to maximize browser on startup

screenshot {
dir = "./target/test-reports/screenshots" // directory where screenshots are placed relative to project root
onFail = false // true to capture screenshots on test failures
}

server {
host = "localhost" // the host the selenium server will run on
port = 4444 // the port the selenium server will run on
start = true // false to use another instance (already up) of selenium server with same config above
}

userExtensions = "" // path to user extensions javascript file
*/

}