Merge "Add configuration mechanism to turn off browser maximisation"

This commit is contained in:
Jenkins 2016-02-11 12:05:05 +00:00 committed by Gerrit Code Review
commit 5af1205c9d
5 changed files with 18 additions and 3 deletions

1
.gitignore vendored
View File

@ -21,6 +21,7 @@ openstack_dashboard/local/local_settings.py
openstack_dashboard/local/local_settings.diff
openstack_dashboard/local/.secret_key_store
openstack_dashboard/test/.secret_key_store
openstack_dashboard/test/integration_tests/local-horizon.conf
openstack_dashboard/wsgi/horizon.wsgi
doc/build/
doc/source/sourcecode

View File

@ -8,7 +8,8 @@ Running the integration tests
#. Set up an OpenStack server
#. Update the configuration file at `horizon.conf`
#. Update the configuration file at `horizon.conf` or add overrides
to that file in `local-horizon.conf` which is ignored by git.
#. Run the tests. ::

View File

@ -85,6 +85,9 @@ SeleniumGroup = [
cfg.StrOpt('screenshots_directory',
default="integration_tests_screenshots",
help="Output screenshot directory"),
cfg.BoolOpt('maximize_browser',
default=True,
help="Is the browser size maximized for each test?"),
]
ScenarioGroup = [
@ -129,7 +132,12 @@ def _get_config_files():
'integration_tests')
conf_file = os.environ.get('HORIZON_INTEGRATION_TESTS_CONFIG_FILE',
"%s/horizon.conf" % conf_dir)
return [conf_file]
config_files = [conf_file]
local_config = os.environ.get('HORIZON_INTEGRATION_TESTS_LOCAL_CONFIG',
"%s/local-horizon.conf" % conf_dir)
if os.path.isfile(local_config):
config_files.append(local_config)
return config_files
def get_config():

View File

@ -86,7 +86,8 @@ class BaseTestCase(testtools.TestCase):
self.driver = webdriver.WebDriverWrapper(
desired_capabilities=desired_capabilities
)
self.driver.maximize_window()
if self.CONFIG.selenium.maximize_browser:
self.driver.maximize_window()
self.driver.implicitly_wait(self.CONFIG.selenium.implicit_wait)
self.driver.set_page_load_timeout(
self.CONFIG.selenium.page_timeout)

View File

@ -29,6 +29,10 @@ implicit_wait=10
# (integer value)
explicit_wait=300
# Maximize the browser window at the start of each test?
# (boolean)
maximize_browser=yes
[image]
# http accessible image (string value)
http_image=http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz