updated README

changes/49/376949/1
Corey Goldberg 10 years ago
parent 55ea3a347a
commit c02ead4ee2
  1. 52
      README.rst

@ -4,28 +4,35 @@
Python wrapper for running display inside X virtual framebuffer (Xvfb)
Home: http://pypi.python.org/pypi/xvfbwrapper
Dev: https://github.com/cgoldberg/xvfbwrapper
* `Selenium Project Home <http://selenium.googlecode.com>`_
----
*********************************
Install xvfbwrapper from PyPI
*********************************
::
pip install xvfbwrapper
**************************************
About Xvfb (X Virtual Framebuffer)
**************************************
In the X Window System, Xvfb or X virtual framebuffer is an X11 server that performs all graphical operations in memory, not showing any screen output. This virtual server does not require the computer it is running on to even have a screen or any input device. Only a network layer is necessary.
************************
System Requirements:
************************
***********************
System Requirements
***********************
* Xvfb ('sudo apt-get install xvfb' or similar)
* Python 2
**********************************
Install xvfbwrapper from PyPI:
**********************************
::
pip install xvfbwrapper
************************
Example: Basic Usage
************************
@ -41,9 +48,9 @@ In the X Window System, Xvfb or X virtual framebuffer is an X11 server that perf
vdisplay.stop()
*****************************************************
Example: Headless Selenium WebDriver and Firefox:
*****************************************************
****************************************************
Example: Headless Selenium WebDriver and Firefox
****************************************************
* install selenium bindings: `pip install selenium`
* Firefox will launch inside virtual display (headless)
* browser is not shown while test is run
@ -56,16 +63,20 @@ In the X Window System, Xvfb or X virtual framebuffer is an X11 server that perf
from selenium import webdriver
class TestUbuntuHomepage(unittest.TestCase):
class TestHomepages(unittest.TestCase):
def setUp(self):
self.vdisplay = Xvfb(width=1280, height=720)
self.vdisplay.start()
self.browser = webdriver.Firefox()
def testTitle(self):
def testUbuntuHomepage(self):
self.browser.get('http://www.ubuntu.com')
self.assertIn('Ubuntu', self.browser.title)
def testGoogleHomepage(self):
self.browser.get('http://www.google.com')
self.assertIn('Google', self.browser.title)
def tearDown(self):
self.browser.quit()
self.vdisplay.stop()
@ -74,10 +85,5 @@ In the X Window System, Xvfb or X virtual framebuffer is an X11 server that perf
if __name__ == '__main__':
unittest.main(verbosity=2)
************************************************
pip install latest dev branch from git repo:
************************************************
::
----
pip install -e git+http://github.com/cgoldberg/xvfbwrapper.git#egg=xvfbwrapper

Loading…
Cancel
Save