Add option to run Selenium tests headless
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Medium
|
Maria Nita |
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:/
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_
- Check for Selenium setup in TestCases and add a new condition to check the SELENIUM_
- 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
Changed in horizon: | |
assignee: | nobody → Maria Nita (maria-nita-dn) |
status: | New → In Progress |
description: | updated |
description: | updated |
description: | updated |
Changed in horizon: | |
milestone: | none → juno-2 |
status: | Fix Committed → Fix Released |
Changed in horizon: | |
milestone: | juno-2 → 2014.2 |
I believe this will help us get rid of the selenium-specific script in infra (see https:/ /github. com/openstack- infra/config/ blob/master/ modules/ jenkins/ files/slave_ scripts/ run-selenium. sh), which means hopefully we could use regular tox jobs and avoid the problems around having a hard-coded command in run-selenium.sh (e.g. the integration tests also depend on selenium but run with a different flag, so can't use that script).
The review is currently open at https:/ /review. openstack. org/#/c/ 79764/ .