For some of the more time consuming tests, we have as a temporary solution implemented some test automation using Selenium. These tests are amongst other deletion of records, leave edited page warning, cancel button and checking whether all fields are saved. This has been done for primary tab of all procedural and cataloging records as well as for the secondary tab.
This page explains how to run these automated tests.
To run the tests you need to have java and ant installed. To do this under windows:
Download and install Java JDK 6
- Open this page in a browser
- click the "Java Download" button with the text "Java Platform (JDK)" written underneath it.
- This will bring you to a listing of downloads. If you are on a 32-bit machine, select the Windows x86 link, if you are under 64-bit, download Windows x64 .. Or if in doubt just default to the x86 one.
- Once you accept licence terms agreement, download should start, and once done the program should guide you through the installation. Make sure you notice (or choose) where java is installed - you'll need that info for when installing ant.
- Finally set the JAVA_HOME environment variable by opening the console and typing:
set JAVA_HOME=C:\path_to\java\jdk1.6.0_02)- typing in the location where you install java
Download and install ant
- Go to http://code.google.com/p/winant/
- Use the link under "get it" to download ant
- Open the downloaded file and follow the instructions
Retrieving the code
The code can be found on GitHub: https://github.com/kaspermarkus/cspace-qa. To download it as a zip-file, either go to the GitHub page, click the download button, and select how you want to download it. Alternatively, use this direct link to get a zipped version of the file: https://github.com/kaspermarkus/cspace-qa/zipball/master
Once you got the file unpack it.
Running the automated tests
Running the tests consist of two steps; starting a selenium server and running the actual tests. This is explained below.
Starting the Selenium server
Assuming you are in the root of the code downloaded from git:
Running Primary tab tests:
Assuming you're in the root of the downloaded code, enter the following to run the tests against the QA server:
Running Secondary tab tests only:
Assuming you're in the root of the downloaded code:
If you are running the selenium server on another port than the default (port 4444), you can set this using the
portnum parameter, like so:
If you want to test against another server - localhost for example, use the
baseurl parameter, like so:
Of course, these can be combined, like so: