updated README
This commit is contained in:
parent
55ea3a347a
commit
c02ead4ee2
52
README.rst
52
README.rst
|
@ -4,28 +4,35 @@
|
||||||
|
|
||||||
Python wrapper for running display inside X virtual framebuffer (Xvfb)
|
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)
|
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.
|
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)
|
* Xvfb ('sudo apt-get install xvfb' or similar)
|
||||||
* Python 2
|
* Python 2
|
||||||
|
|
||||||
**********************************
|
|
||||||
Install xvfbwrapper from PyPI:
|
|
||||||
**********************************
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
pip install xvfbwrapper
|
|
||||||
|
|
||||||
|
|
||||||
************************
|
************************
|
||||||
Example: Basic Usage
|
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()
|
vdisplay.stop()
|
||||||
|
|
||||||
*****************************************************
|
****************************************************
|
||||||
Example: Headless Selenium WebDriver and Firefox:
|
Example: Headless Selenium WebDriver and Firefox
|
||||||
*****************************************************
|
****************************************************
|
||||||
* install selenium bindings: `pip install selenium`
|
* install selenium bindings: `pip install selenium`
|
||||||
* Firefox will launch inside virtual display (headless)
|
* Firefox will launch inside virtual display (headless)
|
||||||
* browser is not shown while test is run
|
* 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
|
from selenium import webdriver
|
||||||
|
|
||||||
|
|
||||||
class TestUbuntuHomepage(unittest.TestCase):
|
class TestHomepages(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.vdisplay = Xvfb(width=1280, height=720)
|
self.vdisplay = Xvfb(width=1280, height=720)
|
||||||
self.vdisplay.start()
|
self.vdisplay.start()
|
||||||
self.browser = webdriver.Firefox()
|
self.browser = webdriver.Firefox()
|
||||||
|
|
||||||
def testTitle(self):
|
def testUbuntuHomepage(self):
|
||||||
self.browser.get('http://www.ubuntu.com')
|
self.browser.get('http://www.ubuntu.com')
|
||||||
self.assertIn('Ubuntu', self.browser.title)
|
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):
|
def tearDown(self):
|
||||||
self.browser.quit()
|
self.browser.quit()
|
||||||
self.vdisplay.stop()
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main(verbosity=2)
|
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…
Reference in New Issue