From v2.6.x, JSPWiki uses Selenium to web-unit-test the web-application. Here is a quick 'how-to' to help you run these tests.
What is Selenium
Selenium is a test tool for web applications. Selenium tests run directly in a browser, just as real users do. And they run in Internet Explorer, Mozilla and Firefox on Windows, Linux, and Macintosh.
Download from http://selenium-core.openqa.org/
Instructions for Manual runs from the Selenium console, aka Selenium Core
Selenium Core uses a unique mechanism which allows it to run on so many platforms. Written in pure JavaScript/DHTML, you copy Selenium Core tests directly into your your application webserver, allowing the tests to run in any supported browser on the client-side. Thus, you must have write access to the machine your web application server is running on to install Selenium Core.
First copy Selenium Core routines to your application webserver
- copy from /selenium_core_0/core/** to your <jspwiki-dir>/selenium/**
Then copy the Selenium Core Test examples to your application webserver
- copy from /selenium_core_0/tests/** to your <jspwiki-dir>/tests/**
When you now point your browser to http://your-jspwiki-apps/selenium/TestRunner.html, you should see the Core Selenium testing console. The default test suite ../tests/TestSuite.html is ready to be run. You can run it to check whether your setup is ok.
Now run the JSPWiki webtests.
First copy the webtests to your application webserver.
- copy from <JSPWiki-source-dir>/tests/etc/selenium/tests/** to your <jspwiki-dir>/tests/**
(if you want you can first make the ./tests directory empty but that is not required)
Then run the tests:
- point your browser to http://your-jspwiki-apps/selenium/TestRunner.html
- change the Test Suite input field to ../tests/JSPWikiTestSuite.html
- now you can run the full suite or any individual test
Notes:
- make sure your browsers Locale is set to english; the current web-tests still contain some hard-coded english texts
- make sure you JSPWiki site is idle: go to My Prefs and clear the user preferences and browser cookies before running the tests.
Instruction for Automated runs from an ant task
Under construction
Read the instructions from build.xml and issue following command from the unix prompt:
>> ant webtests