From c02ead4ee2d911f0ad1841d015e00c40c41b7424 Mon Sep 17 00:00:00 2001 From: Corey Goldberg Date: Sun, 18 Nov 2012 11:45:15 -0500 Subject: [PATCH] updated README --- README.rst | 52 +++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/README.rst b/README.rst index 54ccea7..1e081ff 100644 --- a/README.rst +++ b/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 `_ + +---- + +********************************* + 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