← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1290329] Re: Add option to run Selenium tests headless

 

** Changed in: horizon
       Status: Fix Committed => Fix Released

** Changed in: horizon
    Milestone: None => juno-2

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1290329

Title:
  Add option to run Selenium tests headless

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  Selenium tests by default need a display and a browser driver for setup.
  If no display settings are provided then the native display is used.
  But if you run the tests on Jenkins or on a Vagrant machine, you usually want to run them headless.

  In the setUp method of the BaseTestCase class, we define the Selenium webdriver. Tests inherit from this class.
  Also we have a Selenium TestCase SeleniumTestCase, where we should also check for the option.

  We can set an environment constant named WITH_DISPLAY to check, if we should start a headless session or not.
  The default value should be True, which means that we run the tests with head = display.
  If is False we can use https://pypi.python.org/pypi/xvfbwrapper/0.1.2 to start a headless session.

  We should close the  headless session on tearDown, if one was opened.

  TODOs:

  - In run_tests.sh we should add a new option to set the display type: head or headless. This will initialize a new environment constant - SELENIUM_WITH_DISPLAY
  - Check for Selenium setup in TestCases and add a new condition to check the SELENIUM_WITH_DISPLAY value
  - if the constant is set to True (default) then we will initialize the setup as it is now
  - elif the constant is set to False, then we will start a new xvfb session (headless)
  - at tearDown close the headless session if one is opened
  - update requirements.txt with the new package

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1290329/+subscriptions


References