-
Notifications
You must be signed in to change notification settings - Fork 5
Selenium Testing
Very quick notes on testing Mzalendo using selenium
./manage test [app_name] --selenium-only
Use the Selenium IDE in Firefox, switch it to python mode and then record what you want to test. Select all the steps that were recorded, copy them and then paste into the python test script (will paste as python code). You'll still need te hevily modify the generated code, but it is an excellent start.
Testing the twitter integration is tricky if you gets lots of captchas and 'Twitter overloaded' errors. Avoid lunch breaks...
There are several settings in the general.yml file that relate only to selenium. There are also some fields for other websites (eg twitter) which are needed to test the integration wit them.
You need to be on a machine where the selenium server can access a FireFox binary and it can start. Attempts to get this working on debian were frustrating as the virtual machine did not have X and so odd errors crop up (AttributeError - None does not have attribute 'rfind' - translation: "Can't find the firefox binary"). Running the tests on a Mac box worked nicely.
The internet comments that you can run the browser headless if started under xvfb but the django-selenium app currently wants to start its own selenium server (rather than connect to a running one) so this is tricky. The output from the tests is also minimal so trying to debug tests where you can't see the browser would be very difficult. The proper approach would be to have the server connect to a grid but the Selenium docs for that are minimal.