Skip to content

Instantly share code, notes, and snippets.

@antony
Created November 30, 2011 10:43
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antony/1408625 to your computer and use it in GitHub Desktop.
Save antony/1408625 to your computer and use it in GitHub Desktop.
Running functional tests with Xephyr
includeTargets << grailsScript("_GrailsInit")
display = ':65'
resolution = '-screen 1024x768'
target('default': "Run tests with xephyr") {
List parsedArgs = args.split() as List
exec (executable: 'Xephyr', spawn: true) {
arg(line:display)
arg(line:resolution)
}
event("ExecCommand", ['env', ["DISPLAY=${display}", 'grails']+parsedArgs, 'Xephyr Failed: Could not execute task in embedded X display'])
exec (executable:'killall') {
arg(line:'Xephyr')
}
}
@antony
Copy link
Author

antony commented Nov 30, 2011

Running grails functional tests with Xephyr.

The reason you'd want to run with Xephyr is so that your functional tests never lose focus, you can continue using the machine whilst your test suite runs.

sudo apt-get install xephyr

then place this file into your grails app's scripts directory, and prefix any targets you use with 'xephyr' - i.e:

grails xephyr test-app

@tomaslin
Copy link

this is awesome, thanks

@arturoherrero
Copy link

It's seems to solve the same thing that textbox by @doktor500 and @mgryszko with a different approach.

@mgryszko
Copy link

Did you try vnc4server? I think it does the same (adds a headless X server), but it allows you to connect with VNC to the server. You can watch tests being executed and record them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment