Selenium Tests for the Jenkins CI Server
Go to file
R. Tyler Croy 90134e06c9 Refactor step definitions into much more logical files 2012-07-31 16:55:08 -07:00
features Refactor step definitions into much more logical files 2012-07-31 16:55:08 -07:00
lib Port over the job disabling scenario 2012-07-31 05:49:21 -07:00
test/selenium Start removing methods for tests that have been ported into cucumber 2012-07-31 05:49:21 -07:00
.gitignore Tidy up the gitignore a bit 2012-03-19 10:45:50 -07:00
Gemfile Add the json gem as a dependency 2012-03-19 10:46:07 -07:00
README.markdown doc update 2012-05-08 18:09:03 -07:00
Rakefile Add a rake task to avoid running tests that require network 2012-07-31 05:17:58 -07:00
grab-latest-rc.sh Follow redirects in the fetch script 2012-07-30 02:22:31 -07:00
setup.sh

README.markdown

Selenium tests for Jenkins

This is a project to flesh out some of the manual test cases for Jenkins LTS in an automated fashion.

Right now the project is in a very early state, and is in dire need of some Page Objects for the more standard components of Jenkins such as the:

  • Root actions link listing (top left sidebar)
  • New Job control
  • Various plugin configuration sections on the job/configure page
  • Node configuration
  • etc

Drop me a line (rtyler on Freenode) if you're interested in helping out

Current test matrix

The tests cases that have been completed or nede to be completed can be found on the Selenium Test Cases page on the Jenkins wiki

For historical reasons, there are older tests that are written for test/unit (in the test directory) and newer tests that are written for cucumber (in the features directory.)

Running tests

To run the test, JENKINS_WAR=path/to/your/jenkins.war bundle exec rake. This will run both the older test/unit tests as well as cucumber tests in one go.

There is a bit of a delay since we bring up Jenkins for every single test, with it's own sandboxed workspace as well:

Choosing the JenkinsController

This test harness has an abstraction called JenkinsController that allows you to use different logic for starting/stopping Jenkins. We use this to reuse the same set of tests for testing stand-alone jenkins.war to testing packages.

See the source code for the list of available controllers. If you see a line like register :remote_sysv, that means the ID of that controller is remote_sysv.

To select a controller, run the test with the 'type' environment variable set to the controller ID, such as: type=remote_sysv bundle exec rake. Controllers take their configurations from environment variables. Again, see the controller source code for details until we document them here.

Running one test

You can run a single cucumber test by pointing to a test scenario in terms of its file name and line number like bundle exec cucumber features/freestyle_build.feature:6

If someone knows how to run a single test/unit test case, please update this document.