Skip to content

Instantly share code, notes, and snippets.

@winhamwr
Created Feb 20, 2010
Embed
What would you like to do?
fabric stub for getting selenium 2 python bindings to install
def _install_webdriver(venv_path):
"""
Install/build the python webdriver client. The setup.py is busted, so we have
to do extra work beyond the virtualenv.
See: http://groups.google.com/group/webdriver/browse_thread/thread/f5c3484ab5ae5800/fdae02fa223d00b0
"""
webdriver_dir = os.path.join(venv_path, 'src', 'webdriver')
py_bin = os.path.join(venv_path, 'bin', 'python')
with cd(webdriver_dir):
# Build webdriver
run('rake firefox_xpi')
run('%s setup.py build' % py_bin)
run('mkdir build/lib/webdriver/build_artifacts')
run('cp build/webdriver-extension.zip build/lib/webdriver/build_artifacts/')
# Install the webdriver client to the virtualenv
run('deactivate ; source %s && add2virtualenv %s' % (
os.path.join(venv_path, 'bin/activate'),
os.path.join(venv_path, 'src/webdriver/build/lib')), pty=True)
sudo('chown -R hudson:policystat %s' % webdriver_dir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment