You’ll need at least the following gems:
rspec selenium-client
You first need to copy /config/config_private.yml.example to /config/config_private.yml and change:
url => the root of the EOL Website instance you are testing. This could be www.eol.org or localhost:3000. If you are testing localhost then you must be running in staging or integration (preferable) mode in order to have access to production-like data
browser => which browser will Selenium use for testing. Currently there are limitations based on your operating system. Mac OS X => Safari; Linux => Firefox.
curator => the username of the curator to be used in testing
curator_password => the password of the above curator user account
To start the selenium client you need to run:
rake selenium:start
The selenium log is written to the console, so it is recommended to start the selenium client in a separate console window. Open another console and run:
rake
When finished, the selenium client can be stopped by running:
rake selenium:stop
Sometimes it is beneficial to run server on a remote machine – for example you test from OS X and you want to test how site is working with Firefox, or IE
The easiest way is to do it using a virtual machine (VMWare for example)
-
Install eol_acceptance on your virtual machine (you need java and selenium-client gem on it)
-
Run ‘rake selenium:start’ on the REMOTE machine
-
You do NOT need to configure remote config_private.yml file
-
Set you local config_private file as following:
host: IP_TO_YOUR_REMOTE_VM url: "http://www.eol.org" #or any other url you want to test browser: "*firefox" curator: curator_name curator_password: secret_passwor
Now you should be able to run tests on your local machine using the browser on the remote machine
Please note – if your url is “localhost:3000” you also have to run eol application on the remote machine.