End To End Testing

March 31, 2014 2.2k views
I am having difficulties setting upp an environment that executes end-to-end tests. This is probably because i dont get the whole concept yet, but this is what i want to achive: Have the jenkins server, that is installed on the droplet, run my selenium-protractor-jasmine end-to-end tests when there is new stuff in the repo. I have the hook and all set up, and jenkins detects new content, but how do i get the tests to run...? I need to be able to spawn a browser, so i installed xorg, if i ssh -X to the droplet i can start a browser, but how do i get the tests (or perhaps Jenkins) to do that? Is it possible for a service so spawn a browser within the droplet itself, since it cannot ssh -X, if so how? Or, do i have to place jenkins in another droplet, and ssh -X jenkins into the droplet where the tests are, and spawn a browser in that way? Any help would be greatly appreciated! Cheers!
1 Answer
You might want to look into using the xvfb-run command. It sets up a virtual X server environment. It's very useful for running tests of GUI programs in a headless environment. It's provided by the xvfb package in Ubuntu and Debian.

In the scripts that Jenkins runs to drive your tests, you should be able to prepend xvfb-run to commands requiring X. There is also a Jenkins plugin that might help simplify things for you.

Have another answer? Share your knowledge.