Skip to content

Instantly share code, notes, and snippets.

@antony
Created November 30, 2011 10:43
Show Gist options
  • Select an option

  • Save antony/1408625 to your computer and use it in GitHub Desktop.

Select an option

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

antony commented Nov 30, 2011

Copy link
Copy Markdown
Author

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
Copy Markdown

this is awesome, thanks

@arturoherrero

Copy link
Copy Markdown

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

@mgryszko

Copy link
Copy Markdown

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