Selenium rocks. Unfortunately, every time I sit down at a new client I wind up having to do boilerplate setup to get a nose-testable Selenium environment. By nose-testable I mean something that automatically sets up and closes down the selenium server (and the client servers under test, though that's a separate issue).
To be useful for development, you pretty much need to install FireBug into your profiles, as well as copy over the Selenium auto-inserted extensions (so they don't pop up that annoying "installed add-ons" dialog on every test run). It's all trivial stuff, but it takes an hour or two to get right (at least), and doing it for every client is a bit of a PITA.
So, since I was sick anyway and couldn't charge for the whole day, I went ahead and took some time off over the past few days to build a little package that contains a Firefox 3.5 profile with the extensions installed (that also works for Firefox 3.0 in my tests so far, though I've only used FF35 for firebug work) as well as some boilerplate code for running the Selenium server in a sub-process with setUp/tearDown friendly code for creating/destroying the whole setup.
Of course, this all assumes that you're running the selenium server on the same machine as the client, but that's okay for me for now. Eventually I suppose I could have it have an alternate mode where it didn't do that, but at that point you're into wanting to start/stop virtual machines and the like, this is more for "getting started quickly" than having a final solution.
from noseknowsselenium.nns import createSelenium, stopSelenium
class TestFF35(unittest.TestCase ):
def setUp( self ):
self.sel = createSelenium(
browser = '*firefox /usr/bin/firefox-3.5',
def tearDown( self ):
stopSelenium( self.sel )
def test_basic( self ):
title = self.sel.get_title()
assert 'Fletcher' in title, title
with the idea that you'd install NoseKnowsSelenium into your TurboGears virtualenv and then be able to test on a Linux firefox-3.5 desktop. In the real world you also start your test server in-process and do test setUp/tearDown for that.
Whether to release it is a question. I doubt there are that many people wanting to use it as-is, and I'll have to keep it up-to-date for new FireBug and Selenium releases (I could likely automate that). It really feels one of those projects where, were I to release it, someone would just step up and say "oh, that's handled perfectly by this maintained and complete project over here".
So, interwebs, what is the name of that package?
Pingbacks are closed.