All Projects → cgoldberg → Xvfbwrapper

cgoldberg / Xvfbwrapper

Licence: other
Manage headless displays with Xvfb (X virtual framebuffer)

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Xvfbwrapper

Django Salesman
Headless e-commerce framework for Django.
Stars: ✭ 157 (-24.88%)
Mutual labels:  headless
Headless Framework
[Preview/Alpha] WordPress Headless Framework
Stars: ✭ 182 (-12.92%)
Mutual labels:  headless
Glmark2
glmark2 is an OpenGL 2.0 and ES 2.0 benchmark
Stars: ✭ 199 (-4.78%)
Mutual labels:  x11
Vendure
A headless GraphQL ecommerce framework for the modern web
Stars: ✭ 2,961 (+1316.75%)
Mutual labels:  headless
Azpainter
Full color painting software for Unix-like systems for illustration drawing. This is un-official little fixed repository for package maintainers of image editor AzPainter (based on "mlib" toolkit). Official repository - http://azsky2.html.xdomain.jp/arc/download.html
Stars: ✭ 179 (-14.35%)
Mutual labels:  x11
Headless Burp
Automate security tests using Burp Suite.
Stars: ✭ 192 (-8.13%)
Mutual labels:  headless
Picom
A lightweight compositor for X11
Stars: ✭ 2,299 (+1000%)
Mutual labels:  x11
Storyblok
You found an issue with one of our products? - submit it here as an issue!
Stars: ✭ 206 (-1.44%)
Mutual labels:  headless
Api
A high-performance RESTful API layer designed in support of API-first development and COPE. Connects your content to the world
Stars: ✭ 180 (-13.88%)
Mutual labels:  headless
Chamferwm
A tiling X11 window manager with Vulkan compositor.
Stars: ✭ 200 (-4.31%)
Mutual labels:  x11
Docker Osx
Run Mac in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X!
Stars: ✭ 20,774 (+9839.71%)
Mutual labels:  x11
Sara
Originally a fork of catwm, now an offspring of dwm with a streamlined featureset, plus some bspwm.
Stars: ✭ 179 (-14.35%)
Mutual labels:  x11
Midway
Headless Starter with Sanity + Gatsby + Shopify Repo
Stars: ✭ 195 (-6.7%)
Mutual labels:  headless
Pop
Monorepo of the PoP project, including: a server-side component model in PHP, a GraphQL server, a GraphQL API plugin for WordPress, and a website builder
Stars: ✭ 160 (-23.44%)
Mutual labels:  headless
Xf86 Input Wacom
X.Org driver for Wacom devices
Stars: ✭ 201 (-3.83%)
Mutual labels:  x11
Google Meet Scheduler
😴 Attends classes for you.
Stars: ✭ 150 (-28.23%)
Mutual labels:  headless
Pyload
The free and open-source Download Manager written in pure Python
Stars: ✭ 2,393 (+1044.98%)
Mutual labels:  headless
Kime
Korean IME
Stars: ✭ 208 (-0.48%)
Mutual labels:  x11
Chromeless
🖥 Chrome automation made simple. Runs locally or headless on AWS Lambda.
Stars: ✭ 13,254 (+6241.63%)
Mutual labels:  headless
Alttab
The task switcher for minimalistic window managers or standalone X11 session
Stars: ✭ 196 (-6.22%)
Mutual labels:  x11

=============== xvfbwrapper

Manage headless displays with Xvfb (X virtual framebuffer)

.. image:: https://travis-ci.org/cgoldberg/xvfbwrapper.svg?branch=master :target: https://travis-ci.org/cgoldberg/xvfbwrapper



Info:



About xvfbwrapper:

xvfbwrapper is a python module for controlling virtual displays with Xvfb.



What is Xvfb?:

Xvfb (X virtual framebuffer) is a display server implementing the X11 display server protocol. It runs in memory and does not require a physical display. Only a network layer is necessary.

Xvfb is useful for running acceptance tests on headless servers.



Install xvfbwrapper from PyPI:

.. code:: bash

pip install xvfbwrapper



System Requirements:

  • X11 Windowing System
  • Xvfb (sudo apt-get install xvfb, yum install xorg-x11-server-Xvfb, etc)
  • Python 2.7 or 3.4+

++++++++++++ Examples ++++++++++++


Basic Usage:

.. code:: python

from xvfbwrapper import Xvfb

vdisplay = Xvfb()
vdisplay.start()

try:
    # launch stuff inside virtual display here.
finally:
    # always either wrap your usage of Xvfb() with try / finally,
    # or alternatively use Xvfb as a context manager.
    # If you don't, you'll probably end up with a bunch of junk in /tmp
    vdisplay.stop()


Basic Usage, specifying display geometry:

.. code:: python

from xvfbwrapper import Xvfb

vdisplay = Xvfb(width=1280, height=740)
vdisplay.start()

try:
    # launch stuff inside virtual display here.
finally:
    vdisplay.stop()


Basic Usage, specifying display number:

.. code:: python

from xvfbwrapper import Xvfb

vdisplay = Xvfb(display=23)
vdisplay.start()
# Xvfb is started with display :23
# see vdisplay.new_display


Usage as a Context Manager:

.. code:: python

from xvfbwrapper import Xvfb

with Xvfb() as xvfb:
    # launch stuff inside virtual display here.
    # Xvfb will stop when this block completes


Testing Example: Headless Selenium WebDriver Tests:

This test class uses selenium webdriver and xvfbwrapper to run test cases on Firefox with a headless display.

.. code:: python

import unittest

from selenium import webdriver
from xvfbwrapper import Xvfb


class TestPages(unittest.TestCase):

    def setUp(self):
        self.xvfb = Xvfb(width=1280, height=720)
        self.addCleanup(self.xvfb.stop)
        self.xvfb.start()
        self.browser = webdriver.Firefox()
        self.addCleanup(self.browser.quit)

    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)


if __name__ == '__main__':
    unittest.main()
  • virtual display is launched
  • Firefox launches inside virtual display (headless)
  • browser is not shown while tests are run
  • conditions are asserted in each test case
  • browser quits during cleanup
  • virtual display stops during cleanup

Look Ma', no browser!

(You can also take screenshots inside the virtual display to help diagnose test failures)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].